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

Creating a custom UART connection over BLE

I would like to use the ble_app_uart_c example, found here, to connect to a custom peripheral. What values should I change in the central device code in order to connect to a device, service, and characteristic of my choice?

I am guessing I need to change the UUID of the service I am searching for. Also, I assume should be able to change the UUID's for the RX and TX characteristics of the service I want to read from and write to.

Do I need to change how the handles for these characteristics are retrieved? Are there any another changes I need to make in order to get the nRF52 to establish a serial connection with my device?

I am using IAR, and the nRF52832 with softdevice 132 loaded onto it.

Parents
  • If you change all UUID values correctly then GATT service discovery in ble_db_discovery module should make the job for you.

  • Not really. In Nordic BLE stack all UUIDs are 128-bit (that's actually true in BT SIG Core as well;). They just come in pair of values: 16-bit UUID + 128-bit UUID base. Now the only standard 128-base which is in SoftDevice pre-configured is the one defined for 16-bit BT SIG UUIDs (logical;). What Nordic BLE UART examples are doing is that they provision second (custom) 128-bit UUID to Soft Device during init and then they use it as base for all custom 16-bit UUIDs. This is the same on GATT Server as well as GATT Client side. SO the answer is: provision correctly your specific 128-bit UUID base and use it for provisioning all Service/Characteristic UUIDs together with 16-bit values (but I'm pretty sure this is already happening in Nordic SDK examples).

Reply
  • Not really. In Nordic BLE stack all UUIDs are 128-bit (that's actually true in BT SIG Core as well;). They just come in pair of values: 16-bit UUID + 128-bit UUID base. Now the only standard 128-base which is in SoftDevice pre-configured is the one defined for 16-bit BT SIG UUIDs (logical;). What Nordic BLE UART examples are doing is that they provision second (custom) 128-bit UUID to Soft Device during init and then they use it as base for all custom 16-bit UUIDs. This is the same on GATT Server as well as GATT Client side. SO the answer is: provision correctly your specific 128-bit UUID base and use it for provisioning all Service/Characteristic UUIDs together with 16-bit values (but I'm pretty sure this is already happening in Nordic SDK examples).

Children
No Data
Related