This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2650MODA: CC2650MODA

Part Number: CC2650MODA

I m trying to modify code of simple_peripheral and simple_central so that when there is any IO operation on simple_peripheral, a data to be sent to central device and based on the data it will take some action. IO interface i could add but i m struck in implementing how data to be sent from peripheral?

Do i need to use GATT_WriteCharValue to send data from simple_peripheral? if so, how to get the write handler? 

Need to prove some POC at the earliest to take it further. 

Please share any info on how to send data from simple_peripheral to simple_central application? or if any modified code available please do share for reference.

Thanks

  • Hi Arathi,
    You can utilize the simple GATT service and enable notifications to send data from the peripheral device. Please see these SLA for the basics;

    dev.ti.com/.../ble_01_basic.html

    dev.ti.com/.../ble_01_custom_profile.html
  • Thanks for the input.

    I used Characteristic 1 GATT method to send from simple_peripheral on some IO operation. But i m not clear, how this can be received in simple_central application?

    is the existing sample code does this already? or please let me know what changes are required?

  • GATT_WriteCharValue and GATT_ReadCharValue fails in simple_central.

    what may be the reason?

  • Hello Arathi,

    If you send a notification from the peripheral (GATT server) you must catch the GATT message in SimpleCentral_processGATTMsg in simple_central.c:

    else if(pMsg->method == ATT_HANDLE_VALUE_NOTI)
        {
            // print first byte in notification on line 8.
            Display_print1(dispHandle, 8, 0, "Notification: %d", pMsg->msg.handleValueNoti.pValue[0]);
        }

    There are two different implementations to send notifications,

    1) Through characteristic (preferred).

    The essence of this is covered in the simplelink training modules linked to by Joakim above. In this case you need make changes to simple_central to discover the CCCD and enable notifications, then catch these in SimpleCentral_processGATTMsg as shown above. In this case you will receive info about the characteristic value attribute handle in pMsg->msg.handleValueNoti.handle.

    e2e.ti.com/.../1845170

    2) Directly with GATT_Notification().

    Refer to the gattServApp_SendNotiInd function on how to correctly send notifications.  A buffer must be allocated when sending a GATT_Notification, please refer to section "5.3.5 Allocating Memory for GATT Procedures" in the User's Guide. In this case where you simply send notification directly the noti.handle value is not relevant as it does not correspond to any characteristic value attribute handle.

  • Thanks. Will try