Skip to content

Commit f5e546b

Browse files
committed
Add debug prints
1 parent 6cf548a commit f5e546b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/uniqueHWId.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,33 @@
1313
#include "uniqueHWId.h"
1414

1515
bool UniqueHWId::begin() {
16-
_init =_sId.begin() && _nId.begin();
16+
_init = (_sId.begin() && _nId.begin());
1717
return _init;
1818
}
1919

2020
bool UniqueHWId::get(uint8_t* in, uint32_t size) {
2121
if (_init == false || size < BOARD_PROVISIONING_ID_SIZE) {
22+
Serial.println("size ERROR");
2223
return false;
2324
}
2425
uint8_t offset = 0;
2526
if (!microId::get(&in[offset], size)) {
27+
Serial.println("microId ERROR");
2628
return false;
2729
}
30+
Serial.print("microId: ");Serial.println(THEXT::encode(&in[offset], UC_UID_SIZE));
2831
offset += UC_UID_SIZE;
2932
if (!_nId.get(&in[offset], size - offset)) {
33+
Serial.println("networkId ERROR");
3034
return false;
3135
}
36+
Serial.print("networkId: ");Serial.println(THEXT::encode(&in[offset], NETWORK_ID_SIZE));
3237
offset += NETWORK_ID_SIZE;
3338
if (!_sId.get(&in[offset], size - offset)) {
39+
Serial.println("secureId ERROR");
3440
return false;
3541
}
42+
Serial.print("secureId: ");Serial.println(THEXT::encode(&in[offset], CRYPTO_SN_SIZE));
3643
return true;
3744
}
3845

@@ -41,6 +48,7 @@ String UniqueHWId::get() {
4148
if (!get(data, sizeof(data))) {
4249
return String("");
4350
}
51+
Serial.print("preSHA: ");Serial.println(THEXT::encode(data, BOARD_PROVISIONING_ID_SIZE));
4452
uint8_t out[SHA256_DIGEST_SIZE];
4553
SHA256::sha256(data, sizeof(data), out);
4654
return THEXT::encode(out, sizeof(out));

0 commit comments

Comments
 (0)