mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 21:18:13 +08:00
去掉 udp send data success!
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -71,6 +71,10 @@ int application_start(void)
|
|||||||
int i;
|
int i;
|
||||||
os_log("Start %s",VERSION);
|
os_log("Start %s",VERSION);
|
||||||
|
|
||||||
|
uint8_t mac[32];
|
||||||
|
mico_wlan_get_mac_address(mac);
|
||||||
|
os_log("mac[%s]", mac);
|
||||||
|
|
||||||
//char main_num=0;
|
//char main_num=0;
|
||||||
OSStatus err = kNoErr;
|
OSStatus err = kNoErr;
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ void udp_thread(void *arg)
|
|||||||
if(len<1024) buf[len]=0;
|
if(len<1024) buf[len]=0;
|
||||||
os_log("udp recv from %s:%d, len:%d ", ip_address,addr.sin_port, len);
|
os_log("udp recv from %s:%d, len:%d ", ip_address,addr.sin_port, len);
|
||||||
user_function_cmd_received(1,buf);
|
user_function_cmd_received(1,buf);
|
||||||
// sendto(udp_fd, buf, len, 0, (struct sockaddr *) &addr, sizeof(struct sockaddr_in));
|
// sendto(udp_fd, buf, len, 0, (struct sockaddr *) &addr, sizeof(struct sockaddr_in));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* recv msg from user worker thread to be sent to server */
|
/* recv msg from user worker thread to be sent to server */
|
||||||
@@ -106,9 +106,9 @@ void udp_thread(void *arg)
|
|||||||
|
|
||||||
// send message to server
|
// send message to server
|
||||||
err = udp_msg_send(udp_fd, (const unsigned char*)p_send_msg->data, p_send_msg->datalen);
|
err = udp_msg_send(udp_fd, (const unsigned char*)p_send_msg->data, p_send_msg->datalen);
|
||||||
// require_noerr_string(err, MQTT_reconnect, "ERROR: udp publish data err");
|
// require_noerr_string(err, MQTT_reconnect, "ERROR: udp publish data err");
|
||||||
|
|
||||||
os_log("udp send data success! msg=[%ld].\r\n", p_send_msg->datalen);
|
//os_log("udp send data success! msg=[%ld].\r\n", p_send_msg->datalen);
|
||||||
free(p_send_msg);
|
free(p_send_msg);
|
||||||
p_send_msg = NULL;
|
p_send_msg = NULL;
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ OSStatus user_udp_send(char *arg)
|
|||||||
OSStatus err = kUnknownErr;
|
OSStatus err = kUnknownErr;
|
||||||
p_udp_send_msg_t p_send_msg = NULL;
|
p_udp_send_msg_t p_send_msg = NULL;
|
||||||
|
|
||||||
// app_log("======App prepare to send ![%d]======", MicoGetMemoryInfo()->free_memory);
|
// app_log("======App prepare to send ![%d]======", MicoGetMemoryInfo()->free_memory);
|
||||||
|
|
||||||
/* Send queue is full, pop the oldest */
|
/* Send queue is full, pop the oldest */
|
||||||
if (mico_rtos_is_queue_full(&udp_msg_send_queue) == true)
|
if (mico_rtos_is_queue_full(&udp_msg_send_queue) == true)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ set auto-load safe-path /
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
mico make TC1@MK3031@moc debug
|
mico make TC1@MK3031@moc debug
|
||||||
|
(gdb) target remote localhost:3333
|
||||||
(gdb) b SetLogRecord
|
(gdb) b SetLogRecord
|
||||||
(gdb) commands 1
|
(gdb) commands 1
|
||||||
> silent
|
> silent
|
||||||
@@ -24,3 +25,23 @@ mico make TC1@MK3031@moc debug
|
|||||||
```
|
```
|
||||||
|
|
||||||
参考: <https://www.tablix.org/~avian/blog/archives/2012/08/monitoring_serial_console_through_jtag/>
|
参考: <https://www.tablix.org/~avian/blog/archives/2012/08/monitoring_serial_console_through_jtag/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mico make TC1@MK3031@moc debug
|
||||||
|
target remote localhost:3333
|
||||||
|
b SetLogRecord
|
||||||
|
commands 1
|
||||||
|
silent
|
||||||
|
p log
|
||||||
|
p \n
|
||||||
|
c
|
||||||
|
end
|
||||||
|
set height 0
|
||||||
|
c
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user