Skip to content

Commit d0d2c20

Browse files
committed
send UHWID even if token is not genereted during the GetUHWID request
1 parent 2365825 commit d0d2c20

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

examples/provisioning/ClaimingHandler.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ void ClaimingHandlerClass::getIdReqHandler() {
7070
return;
7171
}
7272

73+
byte _uhwidBytes[32];
74+
hexStringToBytes(*_uhwid, _uhwidBytes, _uhwid->length());
75+
//Send UHWID
76+
ProvisioningOutputMessage idMsg = {MessageOutputType::UHWID};
77+
idMsg.m.uhwid = _uhwidBytes;
78+
_agentManager->sendMsg(idMsg);
79+
7380
String token = CreateJWTToken(*_uhwid, _ts, _secureElement);
7481
Serial.print("Token: ");//TODO REMOVE
7582
Serial.println(token);
@@ -78,12 +85,7 @@ void ClaimingHandlerClass::getIdReqHandler() {
7885
sendStatus(StatusMessage::ERROR);
7986
return;
8087
}
81-
byte _uhwidBytes[32];
82-
hexStringToBytes(*_uhwid, _uhwidBytes, _uhwid->length());
83-
//Send UHWID
84-
ProvisioningOutputMessage idMsg = {MessageOutputType::UHWID};
85-
idMsg.m.uhwid = _uhwidBytes;
86-
_agentManager->sendMsg(idMsg);
88+
8789
//Send JWT
8890
ProvisioningOutputMessage jwtMsg = {MessageOutputType::JWT};
8991
jwtMsg.m.jwt = token.c_str();
@@ -125,4 +127,4 @@ void ClaimingHandlerClass::resetStoredCredRequestCb() {
125127
bool ClaimingHandlerClass::sendStatus(StatusMessage msg) {
126128
ProvisioningOutputMessage statusMsg = { MessageOutputType::STATUS, { msg } };
127129
return _agentManager->sendMsg(statusMsg);
128-
}
130+
}

0 commit comments

Comments
 (0)