Bluetooth: Mesh: Provisioning: Fix OOB string output
The OOB string was being generated in an incorrect way, resulting essentially in garbage. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
198d96cc9a
commit
ec6fd3575b
1 changed files with 3 additions and 3 deletions
|
@ -618,7 +618,7 @@ static int prov_auth(u8_t method, u8_t action, u8_t size)
|
|||
}
|
||||
|
||||
if (output == BT_MESH_DISPLAY_STRING) {
|
||||
char str[9];
|
||||
unsigned char str[9];
|
||||
u8_t i;
|
||||
|
||||
bt_rand(str, size);
|
||||
|
@ -627,7 +627,7 @@ static int prov_auth(u8_t method, u8_t action, u8_t size)
|
|||
for (i = 0; i < size; i++) {
|
||||
str[i] %= 36;
|
||||
if (str[i] < 10) {
|
||||
str[i] += '\0';
|
||||
str[i] += '0';
|
||||
} else {
|
||||
str[i] += 'A' - 10;
|
||||
}
|
||||
|
@ -636,7 +636,7 @@ static int prov_auth(u8_t method, u8_t action, u8_t size)
|
|||
|
||||
memcpy(link.auth, str, size);
|
||||
|
||||
return prov->output_string(str);
|
||||
return prov->output_string((char *)str);
|
||||
} else {
|
||||
u32_t div[8] = { 10, 100, 1000, 10000, 100000,
|
||||
1000000, 10000000, 100000000 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue