Added some RF-related debug prints in signing code

If a failed transmsission is detected, a debug print will give
a hint to why the signing session fails.
This commit is contained in:
Patrick Fallberg
2016-06-21 20:34:57 +02:00
parent be92707cc6
commit 012de4496f
+15 -6
View File
@@ -142,7 +142,9 @@ void signerPresentation(MyMessage &msg, uint8_t destination) {
SIGN_DEBUG(PSTR("Whitelisting required\n")); SIGN_DEBUG(PSTR("Whitelisting required\n"));
#endif #endif
_sendRoute(msg); if (!_sendRoute(msg)) {
SIGN_DEBUG(PSTR("Failed to transmit signing presentation!"));
}
#if defined(MY_SIGNING_FEATURE) #if defined(MY_SIGNING_FEATURE)
// If we do support signing, wait for the gateway to tell us how it prefer us to transmit our messages // If we do support signing, wait for the gateway to tell us how it prefer us to transmit our messages
@@ -164,7 +166,9 @@ bool signerProcessInternal(MyMessage &msg) {
prepareSigningPresentation(msg, sender); prepareSigningPresentation(msg, sender);
SIGN_DEBUG(PSTR("Informing node %d that we do not require signatures because we do not support it\n"), SIGN_DEBUG(PSTR("Informing node %d that we do not require signatures because we do not support it\n"),
sender); sender);
_sendRoute(msg); if (!_sendRoute(msg)) {
SIGN_DEBUG(PSTR("Failed to transmit signing presentation!"));
}
return true; // No need to further process I_SIGNING_PRESENTATION in this case return true; // No need to further process I_SIGNING_PRESENTATION in this case
} }
#elif defined(MY_SIGNING_FEATURE) #elif defined(MY_SIGNING_FEATURE)
@@ -182,9 +186,12 @@ bool signerProcessInternal(MyMessage &msg) {
#if defined(MY_SIGNING_ATSHA204) #if defined(MY_SIGNING_ATSHA204)
if (signerAtsha204GetNonce(msg)) { if (signerAtsha204GetNonce(msg)) {
#endif #endif
SIGN_DEBUG(PSTR("Transmittng nonce\n")); if (!_sendRoute(build(msg, _nc.nodeId, msg.sender, NODE_SENSOR_ID,
_sendRoute(build(msg, _nc.nodeId, msg.sender, NODE_SENSOR_ID, C_INTERNAL, I_NONCE_RESPONSE, false))) {
C_INTERNAL, I_NONCE_RESPONSE, false)); SIGN_DEBUG(PSTR("Failed to transmit nonce!\n"));
} else {
SIGN_DEBUG(PSTR("Transmitted nonce\n"));
}
} else { } else {
SIGN_DEBUG(PSTR("Failed to generate nonce!\n")); SIGN_DEBUG(PSTR("Failed to generate nonce!\n"));
} }
@@ -248,7 +255,9 @@ bool signerProcessInternal(MyMessage &msg) {
} else { } else {
SIGN_DEBUG(PSTR("Informing node %d that we do not require whitelisting\n"), sender); SIGN_DEBUG(PSTR("Informing node %d that we do not require whitelisting\n"), sender);
} }
_sendRoute(msg); if (!_sendRoute(msg)) {
SIGN_DEBUG(PSTR("Failed to transmit signing presentation!"));
}
#endif // MY_GATEWAY_FEATURE #endif // MY_GATEWAY_FEATURE
return true; // No need to further process I_SIGNING_PRESENTATION return true; // No need to further process I_SIGNING_PRESENTATION
} else if (msg.type == I_NONCE_RESPONSE) { } else if (msg.type == I_NONCE_RESPONSE) {