| 1178 | } |
| 1179 | |
| 1180 | rt_err_t rt_wlan_get_info(struct rt_wlan_info *info) |
| 1181 | { |
| 1182 | if (_sta_is_null()) |
| 1183 | { |
| 1184 | return -RT_EIO; |
| 1185 | } |
| 1186 | RT_WLAN_LOG_D("%s is run", __FUNCTION__); |
| 1187 | |
| 1188 | if (rt_wlan_is_connected() == RT_TRUE) |
| 1189 | { |
| 1190 | /* Initialize the information to the scan first */ |
| 1191 | *info = _sta_mgnt.info; |
| 1192 | /* Try using get_info's API for more new information */ |
| 1193 | if (rt_wlan_dev_get_info(STA_DEVICE(), info) != RT_EOK) |
| 1194 | { |
| 1195 | /* The get_info returns an error and gets the rssi value separately */ |
| 1196 | info->rssi = rt_wlan_get_rssi(); |
| 1197 | } |
| 1198 | return RT_EOK; |
| 1199 | } |
| 1200 | return -RT_ERROR; |
| 1201 | } |
| 1202 | |
| 1203 | int rt_wlan_get_rssi(void) |
| 1204 | { |
no test coverage detected