ble_app_interactive using gatt to send command

Hello,

I am using nRF52840 DK to build ble_app_interactive.

Now I have device with NUS,I can connect to device using ble_app_interactive.

I have added NUS into ble_app_interactive,and I tried using gatt to send command.

But it shows the selected service does not contain the characteristic. I am sure that I have NUS in the device,and I can use nRF connect app to see it.

I want to ask if there is any step I did wrong, thank you.

Parents
  • Hello,

    Did you do the service discovery first?

    e.g.

    $ scan on

    $ connect <device address>

    $ gatt services <device address> /* Discover all primary services */

    $ gatt characteristics <device address> 1 /* Discover the characteristics for the NUS service (16-bit UUID = 0x0001)

    $ gatt write command <device address> 2  1 /* Write '1' (i.e. 0x31) to NUS RX characteristic 0x0002  */

    Best regards,

    Vidar

Reply
  • Hello,

    Did you do the service discovery first?

    e.g.

    $ scan on

    $ connect <device address>

    $ gatt services <device address> /* Discover all primary services */

    $ gatt characteristics <device address> 1 /* Discover the characteristics for the NUS service (16-bit UUID = 0x0001)

    $ gatt write command <device address> 2  1 /* Write '1' (i.e. 0x31) to NUS RX characteristic 0x0002  */

    Best regards,

    Vidar

Children
Related