PN532: Fix hex formatting to 2 char len per byte

PN532: Fix hex formatting to 2 char len per byte
This commit is contained in:
Andre Thomas 2019-01-06 16:32:50 +02:00 committed by GitHub
parent e9c687cf09
commit 64ba6fcf8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -289,7 +289,7 @@ void PN532_ScanForTag(void)
char uids[15];
sprintf(uids,"");
for (uint8_t i = 0;i < uid_len;i++) {
sprintf(uids,"%s%X",uids,uid[i]);
sprintf(uids,"%s%02X",uids,uid[i]);
}
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_TIME "\":\"%s\""), GetDateAndTime(DT_LOCAL).c_str());
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("%s,\"PN532\":{\"UID\":\"%s\"}}"), mqtt_data, uids);