BLE passkey defining and setting

In BLE.setPairingPasskey(peer, passkey); the passkey is defined as const uint8_t* type. Assuming this passkey is '000000' to '999999' how should this be defined and set as a parameter in the setter method?

It appears that it must be the 6 ASCII digits. Because it's not a null-terminated c-string, it's not declared as const char *, but you can cast a 6-digit c-string to const uint8_t * and it should work.

1 Like

Thanks - I had done that cast (const uint8_t*) and the compiler threw a warning about loss of precision. The type used just seems odd when the passkey digits are [0-9] so why not use char* ?