blecm_ReadRSSI()

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Juar_2150386
Level 4
Level 4
5 likes given First like received First like given

Hi,

I'm working with a 20736 and can't find answer about blecm_ReadRSSI() returned value

int blecm_ReadRSSI(void)

To calculate the RSSI level, I take the first byte and I convert to a decimal signed valu. for example:

if blecm_ReadRSSI() returns 0x000000B4, it's a -76dBm signal

Is always true that the RSSI information's is in the first byte?

So the signal level is always between [-128; 0] dBm ans never lower than -128 dBm? Or I need to take the second byte ?

Do you have explaination about returned valu of this function.

Thanks

0 Likes
1 Solution

Hi julien_horizon​,

In practical scenario, you can get RSSI between -90 to 0. Device cannot detect the signal beyond these values.

However you can give a try and check for the positive values.

View solution in original post

3 Replies
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

Hi,

The function int blecm_ReadRSSI(void) returns a signed integer value. You can directly print the RSSI value using this function.

For example,

               int rssi_val;

               rssi_val = blecm_ReadRSSI();

               ble_trace1("RSSI = %d", rssi_val);

Note that 127 is an error code, i.e. if you receive 127, then print error.

0 Likes

I ask this question because I use RSSI filter:

For exemple, If I fix rssiLevelLimit to -50 dBm. this valu is a INT8 (-50dBm = 0xCE)

UINT8 valrssiRx = (blecm_ReadRSSI() & 0x000000ff);

I check if ( valrssiRx >rssiLevelLimit && valrssiRx >= 0x80).      // valrssiRx <0 and not far of the limit

If true I accept notification (for example)

In my application, the valu rssiLevelLimit can be change by the user and I would like to now if blecm_ReadRSSI() return valu beetween [0;127].  If is the case I nedd to change my condition to accept positive valu.

I undestand that 127 is an error code.

Is it possible to have reception <-128 dBm ? In this case I need to use INT16 in my application.

I hope I have been understandable

0 Likes

Hi julien_horizon​,

In practical scenario, you can get RSSI between -90 to 0. Device cannot detect the signal beyond these values.

However you can give a try and check for the positive values.