MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_wlan_set_mac

Function rt_wlan_set_mac

components/drivers/wlan/dev_wlan_mgnt.c:1135–1156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133}
1134
1135rt_err_t rt_wlan_set_mac(rt_uint8_t mac[6])
1136{
1137 rt_err_t err = RT_EOK;
1138
1139 if (_sta_is_null())
1140 {
1141 return -RT_EIO;
1142 }
1143 RT_WLAN_LOG_D("%s is run mac: %02x:%02x:%02x:%02x:%02x:%02x",
1144 __FUNCTION__, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
1145
1146 MGNT_LOCK();
1147 err = rt_wlan_dev_set_mac(STA_DEVICE(), mac);
1148 if (err != RT_EOK)
1149 {
1150 RT_WLAN_LOG_E("set sta mac addr fail");
1151 MGNT_UNLOCK();
1152 return err;
1153 }
1154 MGNT_UNLOCK();
1155 return err;
1156}
1157
1158rt_err_t rt_wlan_get_mac(rt_uint8_t mac[6])
1159{

Callers

nothing calls this directly

Calls 2

_sta_is_nullFunction · 0.85
rt_wlan_dev_set_macFunction · 0.85

Tested by

no test coverage detected