- UID
- 1260
- 麦力
- 1059
- 注册时间
- 2016-8-8
- 最后登录
- 2018-5-26
- 精华
- 0
- 阅读权限
- 50
- 在线时间
- 42 小时
|
5#
楼主 |
发表于 2016-8-19 17:23:10
|
只看该作者
本帖最后由 dualxu 于 2016-8-23 15:32 编辑
现在我碰到的问题是maibu_get_ble_rssi()接口返回不成功,rssi没有正常获取到,总是我预设的默认值11
哪位大神帮我看看撒?
/*添加蓝牙RSSI数据图层*/
GRect frame_rssi = {{SYSINFO_BLERSSI_ORIGIN_X, SYSINFO_BLERSSI_ORIGIN_Y}, {SYSINFO_BLERSSI_SIZE_H, SYSINFO_BLERSSI_SIZE_W}};
int8_t rssi = 11;
float length = 5.0;
int8_t ret_rssi = 0;
ret_rssi = maibu_get_ble_rssi(&rssi);
if(0 == ret_rssi)
{
//length = get_length_by_rssi(rssi);
sprintf(str, "RSSI:%d 距离:%0.2fm", rssi,length);
LayerText lt_rssi = {str, frame_rssi, GAlignLeft, U_ASCII_ARIAL_12, 0};
P_Layer layer_text_rssi = app_layer_create_text(<_rssi);
if(layer_text_rssi != NULL)
{
app_window_add_layer(p_window, layer_text_rssi);
}
}
else{
sprintf(str, "RSSI***:%d", ret_rssi);
LayerText lt_rssi = {str, frame_rssi, GAlignLeft, U_ASCII_ARIAL_12, 0};
P_Layer layer_text_rssi = app_layer_create_text(<_rssi);
if(layer_text_rssi != NULL)
{
app_window_add_layer(p_window, layer_text_rssi);
}
} |
|