Good morning @Vinz1911
You can find here an example related to use a Spike Prime Hub as BLE Central Role, with notify subscription from the BLE Peripheral (in this case, the PU Remote Control): https://github.com/GianCann/SpikePrimeHub/tree/master/ble
After download the code on the Spike, you can connect to a specific remote control with this command:
bt.gap_connect(0,b'\xa4\x34\xf1\x9b\x07\x9e',2000)
Where \xa4\x34\xf1\x9b\x07\x9e is the BLE Address of the device you want to connect (you can find with the command bt.gap_scan(10000, 30000, 30000) or with the app nRF Connect )
After connected with the remote, if you push a any button, you get a value in this format:
\x05\x00\x0E\x00\x01
- The first byte (x05) is the lengh of the entire message (5 bytes)
- The second byte (x00) is not used at this moment
- The third byte (x0E) is related to "Button device" (you can ignore this)
- The fourth byte can be 0x00 (Buttons A) or 0x01 (Buttons B)
- The last byte can be: x01 = Button '+' pressed, xFF = Button '-' pressed, x7F = Button 'red' pressed, x00 = (any) Button released
So, if you press (and hold pressed) the B+ button you receive the \x05\x00\x0E\x01\x01 data, and when released the button you receive \x05\x00\x0E\x01\x00
Or, if you press (and hold pressed) the A- button you receive the \x05\x00\x0E\x00\xFF data, and when released the button you receive \x05\x00\x0E\x00\x00
For the central green button you receive:
\x05\x00\x08\x02\x01 when pressed
\x05\x00\x08\x02\x00 when released
Note: with my example you don't need to read the data in loop, because the code subcribe the notification from the remote, so you receive the datawith the _IRQ_GATTC_NOTIFY event.
Tell me if you need other infos ;)