Trying to send some bytes via BLE to an app on the flipper

Hi,
I want to send a few bytes of text from a linux laptop via BLE to the flipper zero, and display it on screen (or at least in the debug log).
Therefore I’m trying to get an app to work that registers a callback via furi_hal_bt_serial_set_event_callback. (follow by furi_hal_bt_start_advertising())
But the registered callback function never gets called, despite the device receiving the sent bytes, as can be seen in the log:
93195872 [D][BtSerialSvc] Received 14 bytes
93195874 [D][BtSerialSvc] Available buff size: 1010

On the sender side, i simply sent those 14 bytes to the uuid
19ed82ae-ed21-4c9d-4145-228e62fe0000
(using gattlib)

What do I have to do to cause the callback function to be called, if data is recieved?

If I connect via the flipper android app, and hit some buttons, then the function does get called, but not if I simply send some bytes to the uuid. So it seems more steps are needed on the sending side? Or does something need to be started/initialised/enabled from the recieving side too?

1 Like

I got a bit further ahead in this regard by modifying the fbs (Flipper Zero BT Serial App Example) app a bit.
See https://github.com/maybe-hello-world/fbs/issues/2
That works, albeit unreliably, by sending the message repeatedly, and restarting the receiving end.
What would be the proper way to receive data?
And how can I reply with a few bytes?

2 Likes

Sorry I don’t have an answer but I wanted to say great job so far! I hope you continue letting us know how this goes.

1 Like