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.

RSSI issue

Other Parts Discussed in Thread: CC2541

Hi there,

I am using the CC2541 keyfob module for detecting the signal strength, the main problem is I can't read the rssi value. I am posting part of the where I defined the RSSI parameters. newRSSI register is showing null all the time.

Is there a better way to read the RSSI value?

****************

static void peripheralStateNotificationCB( gaprole_States_t newState );
static void keyfobapp_RSSI( int8 newRSSI );

/*********************************************************************
* PROFILE CALLBACKS
*/

// GAP Role Callbacks
static gapRolesCBs_t keyFob_PeripheralCBs =
{
peripheralStateNotificationCB, // Profile State Change Callbacks
keyfobapp_RSSI // When a valid RSSI is read from controller

};

int8  rssi_value = 0;

static void keyfobapp_RSSI( int8 newRSSI )
{
rssi_value = newRSSI;
if(rssi_value <= 10){
//buzzerStart( BUZZER_ALERT_LOW_FREQ );
HalLedSet( HAL_LED_1, HAL_LED_MODE_ON);
HalLedSet( HAL_LED_2, HAL_LED_MODE_OFF);
}
else
{
//buzzerStart( BUZZER_ALERT_HIGH_FREQ );
HalLedSet( HAL_LED_1, HAL_LED_MODE_OFF);
HalLedSet( HAL_LED_2, HAL_LED_MODE_ON);
}
}

Regards

Siva

  • It looks like you're on the right path. What exactly is the error? Are you not getting any RSSI values or are they always the same? Have you started the RSSI reading? See the simpleBLEcentral for example of doing this.

    Also note that there is a bug in the 1.4.0 stack such that RSSI values will only be updated for non-empty packets. Therefore, you will need to transfer some data, perhaps using a dummy GATT_Notification to update the RSSI. This will be fixed in the 1.4.1 release.