Emeryth / sma-q2-oss

Open source firmware for the SMA-Q2 smart watch
MIT License
67 stars 17 forks source link

use the device id to create a unique ble identifier #16

Open x29a opened 3 years ago

x29a commented 3 years ago

currently this creates an exception on bootup, i assume the device id is to long. when only using one byte as suffix, it works.

Any ideas?

This change requires a new build of GB as described here: https://github.com/Emeryth/Gadgetbridge/pull/2 or included in the upstream PR.

x29a commented 3 years ago

After more investigation, i found the default advertising name size to be 31, so that should be more than enough?

The error i get is NRF_ERROR_INVALID_PARAM.

The strlen of the new name returns 22, so that would be <31.

x29a commented 3 years ago

Ok, looks like a classical fail. Defined the buffer too small (22 is greater than the 15 after all).

Now all 8 bytes of the Device ID are used so the BLE device name might be something like SMAQ2-DEADBEEF.