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

Writing to Peripheral from Central

Hi, 

I am using nRF52840 Preview DK, with SDK V15.3.0 and Softdevice API V6.1.1

First, I modified the 'ble blinky peripheral example' to have more characteristics tying it to appropriate event handler and I have verified that it works using nRF Connect App.

Secondly, I modified the 'ble blinky central example', in that instead of the UUID of LED characteristic , I inserted the UUID of my own characteristic, my characteristic has the same attributes and structure as the  LED characteristic. 

On the central the characteristic is successfully found and given a connection handle, when I write to it by pressing the button, the event is properly executed and writing message gets printed.

but, there seems to be no action on the peripheral side, it receives nothing, when I again change the UUID to LED characteristic everything works fine and it's event handler gets called on the peipheral, but, with my chacteristic UUID no action takes place on the peripheral side.

can someone please explain ?

Parents
  • First I would recommend that you get a new DK, the preview kit has an engineering revision chip, and SDK 15 is not tested against that.

    Do you have a sniffer trace that shows what is happening? Also are you getting a call to ble_lbs_on_ble_evt when you perform the write?

  • Ok, so, I started off from a fresh ble-central example and started to add each characteristics 1-by-1 and I put up counter named 'flag' in the 

    ble_lbs_on_db_disc_evt()

    like this

    case LBS_UUID_ALARM_CHAR:
    evt.params.peer_db.alarm_handle = p_char->characteristic.handle_value;
    flag++;
    break;
    
    case LBS_UUID_BUZZER_CHAR:
    evt.params.peer_db.buzzer_handle = p_char->characteristic.handle_value;
    flag++;
    break;

    so that I know if my characteristic is getting found and assigned a handle

    and so, I found a weird behavior, the program stopped discovering characteristics above the count of 5

    meaning after 5 discovering 5 characteristics it won't proceed to discover any more characteristics, till 5 characteristics everything works fine. 

    I took a quick glance through the sdk_config.h file to see if there is any setting related to this, but, I couldn't find any ?

    is there something I am missing ?

Reply
  • Ok, so, I started off from a fresh ble-central example and started to add each characteristics 1-by-1 and I put up counter named 'flag' in the 

    ble_lbs_on_db_disc_evt()

    like this

    case LBS_UUID_ALARM_CHAR:
    evt.params.peer_db.alarm_handle = p_char->characteristic.handle_value;
    flag++;
    break;
    
    case LBS_UUID_BUZZER_CHAR:
    evt.params.peer_db.buzzer_handle = p_char->characteristic.handle_value;
    flag++;
    break;

    so that I know if my characteristic is getting found and assigned a handle

    and so, I found a weird behavior, the program stopped discovering characteristics above the count of 5

    meaning after 5 discovering 5 characteristics it won't proceed to discover any more characteristics, till 5 characteristics everything works fine. 

    I took a quick glance through the sdk_config.h file to see if there is any setting related to this, but, I couldn't find any ?

    is there something I am missing ?

Children
No Data
Related