fix a bug in tencent_firmware wrapper
This commit is contained in:
@@ -487,6 +487,8 @@ tencent_firmware_module_t tencent_firmware_module_esp8266 = {
|
||||
|
||||
int esp8266_tencent_firmware_sal_init(hal_uart_port_t uart_port)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
if (tos_at_init(uart_port, esp8266_tencent_firmware_at_event,
|
||||
sizeof(esp8266_tencent_firmware_at_event) /
|
||||
sizeof(esp8266_tencent_firmware_at_event[0])) != 0) {
|
||||
@@ -497,8 +499,8 @@ int esp8266_tencent_firmware_sal_init(hal_uart_port_t uart_port)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tos_tf_module_init() != 0) {
|
||||
return -1;
|
||||
if ((ret = tos_tf_module_init()) != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -56,19 +56,19 @@ int tos_tf_module_register(tencent_firmware_module_t *module)
|
||||
int tos_tf_module_init(void)
|
||||
{
|
||||
if (tos_mail_q_create(&mqtt_message_mail, mqtt_message_pool, MQTT_MESSAGE_NUM_MAX, sizeof(mqtt_message_t)) != K_ERR_NONE) {
|
||||
return -1;
|
||||
return -2;
|
||||
}
|
||||
|
||||
tos_list_init(&mqtt_sub_list);
|
||||
|
||||
if (tos_mmblk_pool_create(&sub_list_node_mbp, sub_list_node_pool, MQTT_SUB_TOPIC_MAX, sizeof(mqtt_message_handlers_t)) != K_ERR_NONE) {
|
||||
return -1;
|
||||
return -3;
|
||||
}
|
||||
|
||||
if (tos_task_create(&mqtt_message_handle_task, "mqtt_message_handle",
|
||||
mqtt_message_handle_task_entry, NULL, MQTT_MESSAGE_HANDLE_TASK_PRIO,
|
||||
mqtt_message_handle_task_stack, MQTT_MESSAGE_HANDLE_TASK_STACK_SIZE, 10) != K_ERR_NONE) {
|
||||
return -1;
|
||||
return -4;
|
||||
}
|
||||
|
||||
if (g_tencent_firmware_module && g_tencent_firmware_module->init) {
|
||||
|
@@ -79,7 +79,7 @@ typedef struct mqtt_param_st {
|
||||
|
||||
typedef struct mqtt_message_st {
|
||||
char topic[64];
|
||||
char payload[128];
|
||||
char payload[256];
|
||||
} mqtt_message_t;
|
||||
|
||||
typedef void (*message_handler_t)(mqtt_message_t* msg);
|
||||
|
Reference in New Issue
Block a user