This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ble_nus example

Hello, I am working on modified version of ble_nus example and I tried to send data to nordic DK. In Android, I used

BluetoothGattCharacteristic characteristic = mBluetoothGattService.getCharacteristic(UUID.fromString("6E400003-B5A3-F393-E0A9-E50E24DCCA9E"));

and

characteristic.setValue(new byte[] {5});

and in Nordic SDK

I tried to receive the data in nus_data_handler,

The method, characteristic.setValue(new byte[] {5}); returns true, but

I guess nus_data_handler doesn't receive the data.

What is the problem? Please help me.

Parents
  • Hi Gary,

    If you want to write the data from the phone to the DK, you should write to the characteristic which has write property, in this case it should be the TX characteristic 6E400002-B5A3-F393-E0A9-E50E24DCCA9E

    There could be some confusion on the naming as in some documentation we inverted the naming from RX to TX and vice versa.

    All data sent over BLE is converted to byte array , so I dont think it's a problem.

    Please find the source code for nRFUART on github, it should help.

Reply
  • Hi Gary,

    If you want to write the data from the phone to the DK, you should write to the characteristic which has write property, in this case it should be the TX characteristic 6E400002-B5A3-F393-E0A9-E50E24DCCA9E

    There could be some confusion on the naming as in some documentation we inverted the naming from RX to TX and vice versa.

    All data sent over BLE is converted to byte array , so I dont think it's a problem.

    Please find the source code for nRFUART on github, it should help.

Children
No Data
Related