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.

CCS/CC2640R2F: How to print multiple peripherals RSSI readings simultaneously in Simple Central ?

Part Number: CC2640R2F

Tool/software: Code Composer Studio

I'm working on BLE5 simple central code to connect to multiple peripherals and get their RSSI values. Right now i am able to connect to multiple devices and print their RSSI values sequentially lilke o print the RSSI readings parallely from all the devices at the same time.

What changes have to be done to get multiple values simulatenously on the terminal ?

  • Hi Ujwal,
    Do you mean that you would like to bugger the RSSI values on the CC2640R2 and print them in larger batches?
  • Basically print all the multiple RSSI readings at the same time in the terminal. Any methodology will do.

  • Hi Ujwal,

    Not sure what you mean by parallel here. The connections don't happen at the same time anyway, and there is no API to read out a group of RSSIs.

    You can use the API GAP_RegisterConnEventCb(...) to get reports after each connection event for each connection. This includes the RSSI.

    From gap.h:

     /**
    * Register/Unregister a connection event callback
    *
    * It is only possible to register for one connection handle of for all
    * connection handles. In the case of unregistering, it does not matter what
    * connHandle or cb is passed in as whatever is currently registered will be
    * unregistered.
    *
    * @warning The application owns the memory pointed to by pReport in
    * @ref pfnGapConnEvtCB_t. That is, it is responsible for freeing this memory.
    *
    * @note The callback needs to be registered for each reconnection. It is not
    * retained across a disconnect / reconnect.
    *
    * @param cb Function pointer to a callback.
    * @param action Register or unregister the callback.
    * @param connHandle if @ref LINKDB_CONNHANDLE_ALL, apply to all connections. <br>
    *        else, apply only for a specific connection.
    *
    * @return @ref SUCCESS
    * @return @ref bleGAPNotFound : connection handle not found
    * @return @ref bleInvalidRange : the callback function was NULL or action is
    *         invalid
    * @return @ref bleMemAllocError : there is not enough memory to register the callback.
    */
    extern bStatus_t GAP_RegisterConnEventCb(pfnGapConnEvtCB_t cb,
                                             GAP_CB_Action_t action,
                                             uint16_t connHandle);

    Please see project_zero or multi_role projects for how to use this API and how to implement the callback function that receives the connection event information.

    Best regards,
    Aslak