RSSI:(Received Signal Strength Indication),接收的信号强度指示.一般为负数;
范围:-100至0;
意义:绝对值越小代表信号越好;
位置:设备信息数据结构中;
/**
* GAP_DEVICE_INFO_EVENT message format. This message is sent to the
* app during a Device Discovery Request, when a new advertisement or scan
* response is received.
*/
typedef struct
{
osal_event_hdr_t hdr; //!< GAP_MSG_EVENT and status
uint8 opcode; //!< GAP_DEVICE_INFO_EVENT
uint8 eventType; //!< Advertisement Type: @ref GAP_ADVERTISEMENT_REPORT_TYPE_DEFINES
uint8 addrType; //!< address type: @ref GAP_ADDR_TYPE_DEFINES
uint8 addr[B_ADDR_LEN]; //!< Address of the advertisement or SCAN_RSP
int8 rssi; //!< Advertisement or SCAN_RSP RSSI
uint8 dataLen; //!< Length (in bytes) of the data field (evtData)
uint8 *pEvtData; //!< Data field of advertisement or SCAN_RSP
} gapDeviceInfoEvent_t;
在接收广播数据结构体中,即在事件 GAP_DEVICE_INFO_EVENT中可以读取:
int8 rssi = -pEvent->deviceInfo.rssi;
|