提交 7918a571 编写于 作者: S supowang

Update nb-iot_example.c

上级 1fd25076
......@@ -4,9 +4,9 @@
#include "cmsis_os.h"
#define NB_IoT_TEST_TASK0_STK_SIZE 1024
#define NB_IoT_TEST_TASK_STK_SIZE 1024
void nb_iot_demo(void);
osThreadDef(nb_iot_demo, osPriorityNormal, 1, NB_IoT_TEST_TASK0_STK_SIZE);
osThreadDef(nb_iot_demo, osPriorityNormal, 1, NB_IoT_TEST_TASK_STK_SIZE);
int socket_id=-1;
#define RECV_LEN 1024
......@@ -14,15 +14,15 @@ uint8_t recv_data[RECV_LEN];
void nb_iot_demo(void)
{
int recv_len = -1;
int recv_len = -1;
int bc35_28_95_sal_lwm2m_init(hal_uart_port_t uart_port);
bc35_28_95_sal_lwm2m_init(HAL_UART_PORT_0);
socket_id = tos_sal_module_connect("49.4.85.232","5683",TOS_SAL_PROTO_UDP);
if(socket_id!=-1){
printf("connect to clound first time and need to report!\n");
if(socket_id !=-1){
printf("connect to cloud success! fd: %d\n", socket_id);
}
else{
printf("udp connect success! fd: %d\n", socket_id);
printf("connect to cloud failed!\n");
}
while (1) {
tos_sal_module_send(socket_id, (const void*)"22", strlen("22"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册