Files
TencentOS-tiny/examples/tencent_cloud_sdk_mqtt/tencent_cloud_sdk_mqtt.c
supowang 65ce348b0e delete some project files
fix some project and delete some files
2019-09-17 17:32:51 +08:00

49 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include "tos.h"
/* 用户根据自己的底层通信链路来配置此宏
* 如果是基于以太网lwip的链路这里应该定义 USE_LWIP
* 如果是基于模组的通信链路这里应该定义相应的模组宏如使用ESP8266则定义 USE_ESP8266
* */
#define USE_ESP8266
#ifdef USE_LWIP
#include "lwip/api.h"
#include "lwip/sockets.h"
#include "lwip/err.h"
#include "lwip/sys.h"
#endif
#ifdef USE_ESP8266
#include "esp8266.h"
#endif
void application_entry(void *arg)
{
extern void mqtt_basic_thread(void);
#ifdef USE_LWIP
dns_init();
MX_LWIP_Init();
#endif
#ifdef USE_ESP8266
extern int esp8266_sal_init(hal_uart_port_t uart_port);
extern int esp8266_join_ap(const char *ssid, const char *pwd);
esp8266_sal_init(HAL_UART_PORT_0);
esp8266_join_ap("SheldonDai", "srnr6x9xbhmb0");
#endif
#ifdef USE_NB_BC35
extern int bc35_28_95_sal_init(hal_uart_port_t uart_port);
bc35_28_95_sal_init(HAL_UART_PORT_0);
#endif
mqtt_basic_thread();
while (1) {
printf("This is a mqtt demo!\r\n");
tos_task_delay(1000);
}
}