getting wrong values from xQueueReceive
Posted: Tue Mar 19, 2019 7:19 am
hello All,
Please find my Code below.
I am sending ibeacon data in queue using struct.
I have a field int rssi in struct
i am assigning rssi =scan_result->scan_rst.rssi;
After sending a struct in Queue I am able to get correct rssi
but After poping out the same struct...I am not getting correct rssi.
Other parameters like major and Minor are correct.
What could be error?
Please find my Code below.
I am sending ibeacon data in queue using struct.
I have a field int rssi in struct
i am assigning rssi =scan_result->scan_rst.rssi;
After sending a struct in Queue I am able to get correct rssi
but After poping out the same struct...I am not getting correct rssi.
Other parameters like major and Minor are correct.
What could be error?
Code: Select all
struct AMessage {
uint16_t major;
uint16_t minor;
int rssi;
uint16_t slno;
}xMessage;
xMessage.major =major;
xMessage.minor =minor;
xMessage.rssi =scan_result->scan_rst.rssi;
xMessage.slno = i;
if (xQueueSendToFront(xQueue1, (void * ) &xMessage, (TickType_t ) 0)) {
ESP_LOGI(TAG, "RSSI of packet:%d dbm", scan_result->scan_rst.rssi);
ESP_LOGI(TAG, "rssi=(%d)" , xMessage.rssi);
struct AMessage pxMessage1;
if (xQueueReceive( xQueue1, &pxMessage1, 0)){
ESP_LOGI(TAG, "==pxMessage.rssi =%d : " , pxMessage1.rssi);
}
}