Browse Source

[components][drivers][wlan] 修复WLAN事件附加数据为空的问题

tangyuxin 5 years ago
parent
commit
8a3e66bc27
1 changed files with 2 additions and 1 deletions
  1. 2 1
      components/drivers/wlan/wlan_mgnt.c

+ 2 - 1
components/drivers/wlan/wlan_mgnt.c

@@ -260,7 +260,8 @@ static rt_err_t rt_wlan_send_to_thread(rt_wlan_event_t event, void *buff, int le
     msg->event = event;
     if (len != 0)
     {
-        msg->buff = ((char *)msg) + sizeof(struct rt_wlan_msg);
+        msg->buff = (void *)&msg[1];
+        rt_memcpy(msg->buff, buff, len);
         msg->len = len;
     }