- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is it possible to set passKey lenght to 4 digits? I have checked example where passkey=123456 and tried to modify it to passkey=1234.
To do so I have changed passKey to:
//passkey=1234(dec)-> HEX 0x000004D2 -> 0x00 0x00 0x04 0xD2 -> (little endian) 0xD2 0x04 0x00 0x00
const UINT8 passKey[LESMP_MAX_KEY_SIZE] = {0xD2, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
And i tried to modify: lesmp_setSMPassKey((UINT8*)passKey, LESMP_MAX_KEY_SIZE); to lesmp_setSMPassKey((UINT8*)passKey, 4);
That didn't work. Any help would be usefull.
Best Regards
Solved! Go to Solution.
- Labels:
-
Security
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may refer to the BT Spec 4.x for more details on this. If you really want to implement a 4-digit passkey, you may automatically append two zeros to it to make it a 6-digit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe the 6-digit length is a requirement for secure simple pairing in ble. Not sure it can be changed out in the code...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may refer to the BT Spec 4.x for more details on this. If you really want to implement a 4-digit passkey, you may automatically append two zeros to it to make it a 6-digit.