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.

SIMPLELINK-CC2640R2-SDK: 3.20: Multi Role receive notifications from 2 Simple Peripheral Boards?

Part Number: SIMPLELINK-CC2640R2-SDK

Hi,

My application is to send sensor data from 2 simple peripherals to Multi Role example program. For example at peripheral side I press a button and write to Simple Profile Characteristics 4. Then at Multi Role side receive the notification and display data at LCD. At the moment the Multi Role can only read and write to peripherals. Do yo have any code reference that I can use for this implementation?

-kel

  • Hi Markel,

    Not beyond the existing sample applications in the SDK.

  • What do you mean? Can I get help with this?

    I just need the extra code to handle notifications. I see code for simple central but for 1 peripheral to 1 central device. What I need to do is 2 peripheral notifications to 1 multi role.

    -kel

  • Hello Markel,

    1)

    You can register to receive notifcations with GATT_RegisterForInd() then catch them in multi_role_processGATTMsg:

      else if (pMsg->method == ATT_HANDLE_VALUE_NOTI)

    2)

    Then you check which connection was the source of the notification( pMsg->connHandle). 

    3)

    The message received will then be of type attHandleValueNoti_t:

    typedef struct
    {
    uint16 handle; //!< Handle of the attribute that has been changed (must be first field)
    uint16 len; //!< Length of value
    uint8 *pValue; //!< Current value of the attribute (0 to ATT_MTU_SIZE-3)
    } attHandleValueNoti_t;

    Cast it to play with it's members:

    attHandleValueNoti_t noti = (attHandleValueNoti_t) pMsg->msg;