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.

SimpleBLEPeripheral, how to read RSSI.

Hi,

 I am completely new in C for SoC and i need help.

I have two keyFob's.

On one of them I was load the simpleBLEPeripheral (#1) program.

To second simpleBLECentral (#2)

I would like to modify the  simpleBLEPeripheral so, that when I press the left button on  keyFob#1 the RSSI is read and entered into a variable. 

I get tired of it already the third day. Please write for me this one simple instruction and show me the place in the code, where I should place it.. 

I will be very grateful.

Sorry for bad english 

 

best regards

  • Hi Paul,

    have a look at peripheral.h. there is definition of the gapRolesRssiRead_t callback located in gapRolesCBs_t you need to provide to GAPRole_StartDevice().

    by setting GAPROLE_RSSI_READ_RATE to a suitable value you can obtain a regular update in the rssi-value which you then can 'freeze' into another variable when the button is pressed.

    HTH

    Andre

  • Thank you very much. Now everything is working the way I wanted.

    best regards

    Paul

  • Hi, I added a tast keySta_ProcessEvent  in tasksArr:

    const pTaskEventHandlerFn tasksArr[] = {
    LL_ProcessEvent, // task 0
    Hal_ProcessEvent, // task 1
    HCI_ProcessEvent, // task 2
    #if defined ( OSAL_CBTIMER_NUM_TASKS )
    OSAL_CBTIMER_PROCESS_EVENT( osal_CbTimerProcessEvent ), // task 3
    #endif
    L2CAP_ProcessEvent, // task 4
    GAP_ProcessEvent, // task 5
    GATT_ProcessEvent, // task 6
    SM_ProcessEvent, // task 7
    GAPRole_ProcessEvent, // task 8
    GAPBondMgr_ProcessEvent, // task 9
    GATTServApp_ProcessEvent, // task 10
    SimpleBLEPeripheral_ProcessEvent, // task 11
    keySta_ProcessEvent // task12
    };

    I have added 7 keys at port P1.0,P1.2~P1.7. Their interrupt are all processed in keySta_ProcessEvent. They work very well.

    I set static uint16 RSSIReadRate = 100;

    I wish when I press P1.3, I can get the rssi value:

    rbArmSwKeyVal[0] = rssiValue;

    VOID RbArmSwProfile_UpdateParam( RBARMSW_KEY_ATTR);

    but it cannot work after tried many times. I am looking forward for your reply. Thanks so much!