0

Create custom service from ble_app_uart_c example

SaiTejaManchukanti gravatar image

asked 2017-11-13 15:23:50 +0100

updated 2017-11-13 15:24:28 +0100

Hello, I would like to make changes in ble_app_uart_c example for connecting to a custom peripheral.

Service Uuid of my peripheral is as follows : 99aa0001-d0e3-44ce-a306-ba057b9b25a7 Characteristic1 uuid of this service : 99aa0002-d0e3-44ce-a306-ba057b9b25a7 Characteristic2 uuid of this service : 99aa0003-d0e3-44ce-a306-ba057b9b25a7

I made following change according to NUS_BASE_UUID variable

define NUS_BASE_UUID {{0xA7, 0x25, 0x9B, 0x7B, 0x05, 0xBA, 0x06, 0xA3, 0xCE, 0x44, 0xE3, 0xD0, 0x00, 0x00, 0xAA, 0x99}}

define BLE_UUID_NUS_SERVICE 0x0001

define BLE_UUID_NUS_TX_CHARACTERISTIC 0x0002

define BLE_UUID_NUS_RX_CHARACTERISTIC 0x0003

By doing so I am unable to connect my central to peripheral. Are there any other variables need to be changed? Please help me in this regard

edit retag flag offensive close delete report spam

1 answer

Sort by ยป oldest newest most voted
0
Joakim-Jakobsen gravatar image

answered 2017-11-14 15:42:10 +0100

updated 2017-11-14 15:42:40 +0100

Hi SajTeja!

I tested this with the ble_app_uart example and the ble_app_uart_c example in SDK 14.1, and it works fine.

Did you remember to change the UUID in both the peripheral and the central?

In the ble_app_uart example I changed the NUS_BASE_UUID in ble_nus.c to the following:

#define NUS_BASE_UUID  {{0xA7, 0x25, 0x9B, 0x7B, 0x05, 0xBA, 0x06, 0xA3, 0xCE, 0x44, 0xE3, 0xD0, 0x00, 0x00, 0xAA, 0x99}}

And in the ble_app_uart_c example I change the NUS_BASE_UUID in ble_nus_c.h to the following:

#define NUS_BASE_UUID  {{0xA7, 0x25, 0x9B, 0x7B, 0x05, 0xBA, 0x06, 0xA3, 0xCE, 0x44, 0xE3, 0xD0, 0x00, 0x00, 0xAA, 0x99}}

When I build and flash the example the devices automatically connect.
Did you remember to flash the correct versions of the softdevice?

Best regards.
Joakim.

edit flag offensive delete publish link more

Comments

Thank you for your time Joakim.

I am using SDK 12.2.0. And I am using correct version of software. For peripheral, I am using arduino core developed by sandeep Mistry . https://github.com/sandeepmistry/ardu... For central, I am using the example code provided in SDK.

I am able to achieve the data transmission between central and peripheral with NUS servive UUID. But with my custom UUID, I am not able to achieve communication between peripheral and central. I am using same UUID in central and peripheral. What might be the possible issue?

SaiTeja ( 2017-11-15 05:30:37 +0100 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-11-13 15:23:50 +0100

Seen: 39 times

Last updated: nov. 14