how to send a notification enabled response, or service initialized indication for the BLE SMP service

hello Nordic

i am working with nrf52840 running ncs v2.8.0 

this device connects with a central, via BLE, the central running on linux.

i am working with smp (simple management protocol) with some user group id and also some build in groups. 

the problem i have is that when the 2 device establishes a connection then the linux side is ready faster then the nrf and if i send a message then it is not received in the nrf device which is nor ready yet for receiving (if i put a hold on the send for 2 seconds then all is fine).

i want the nrf device to send some "is ready" message indication to the central (by it self, not as a replay to a command sent from central) once the SMP service is initialize, or notifications on it are enabled. since the SMP service is initialized and built with in the ncs (which i don't want to change internally) i wonder how this can be done, i think there are some api in more advanced ncs versions but for now we are working with ncs2.8.0

hope you can help 

best regards

Ziv

Parents
  • Hi,

    I am not sure what this not ready state could be. Configuration of services happens before the device starts advertising, so that should be OK. I sthe problem that some procedures has not completed, or something else? Can you share a sniffer trace and log from the problematic case so that we can understand more about what the root cause here is?

  • hi

    i am calling it "ready" stat, i am not sure what it is called on the ncs internals,  i just know that when i establish a connection with my linux side (using blueZ) if i try to send a command from the linux (central) using the SMP service, before i enable notification, then the ncs side (peripheral) just don't get this message or just don't replay to it (which makes sense if notification was not enabled yet) ....

    i want that instead of waiting for the notification enable on the linux side and then on the linux side send a command and get response.. that i can send automatic message from the ncs side after the SMP characteristic of the SMP service get notify enabled by the central .. is my goal clearer now ? 

  • Hi,

    I am stil not sure about this.

    ziv123 said:
    that i can send automatic message from the ncs side after the SMP characteristic of the SMP service get notify enabled by the central

    The Linux side is the central, and GATT client, and it is the one that writes to the CCCD on the nRF (GATT server) to enable notifications. So it knows when it has enabled notifications, and it seems strange that you would need the nRF to tell the central that it has enabled notifications? (If it failes for some reason, there would either be an error if not allowed, or retranmissions until disconnect if the reason is packet drop).

Reply
  • Hi,

    I am stil not sure about this.

    ziv123 said:
    that i can send automatic message from the ncs side after the SMP characteristic of the SMP service get notify enabled by the central

    The Linux side is the central, and GATT client, and it is the one that writes to the CCCD on the nRF (GATT server) to enable notifications. So it knows when it has enabled notifications, and it seems strange that you would need the nRF to tell the central that it has enabled notifications? (If it failes for some reason, there would either be an error if not allowed, or retranmissions until disconnect if the reason is packet drop).

Children
No Data
Related