|
|
@ -13,6 +13,7 @@
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <poll.h>
|
|
|
|
#include <poll.h>
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
|
|
|
|
//#include "cmd.h"
|
|
|
|
//#include "cmd.h"
|
|
|
|
#include "file.h"
|
|
|
|
#include "file.h"
|
|
|
@ -51,28 +52,10 @@ int mqtt_reconn_times = 0;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void _mqtt_iota_log_print(int level, char* format, va_list args)
|
|
|
|
void _mqtt_iota_log_print(int level, char* format, va_list args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
LOG("level=%d", level);
|
|
|
|
vprintf(format, args);
|
|
|
|
vprintf(format, args);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* description: mqtt参数初始化.
|
|
|
|
|
|
|
|
param:
|
|
|
|
|
|
|
|
return: (E_NONE)成功,(其他)失败
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
void _mqtt_param_init()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mqtt_param_t *param = &mqtt_ctrl.param;
|
|
|
|
|
|
|
|
strcpy(param->server_addr, CSG_SERVER_ADDRESS_DEFAULT);
|
|
|
|
|
|
|
|
param->server_port = CSG_SERVER_PORT_DEFAULT;
|
|
|
|
|
|
|
|
strcpy(param->user_name, CSG_USER_NAME_DEFAULT);
|
|
|
|
|
|
|
|
strcpy(param->password, CSG_PASSWORD_DEFAULT);
|
|
|
|
|
|
|
|
strcpy(param->client_id, CSG_CLIENT_ID_DEFAULT);
|
|
|
|
|
|
|
|
strcpy(param->device_id, CSG_DEVICE_ID_DEFAULT);
|
|
|
|
|
|
|
|
strcpy(param->service_id, CSG_SERVICE_ID_DEFAULT);
|
|
|
|
|
|
|
|
param->keep_live_time = CSG_KEEP_LIVE_TIME_DEFAULT;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* description: iota配置设置.
|
|
|
|
/* description: iota配置设置.
|
|
|
|
param:
|
|
|
|
param:
|
|
|
|
return:
|
|
|
|
return:
|
|
|
@ -465,7 +448,7 @@ void *_mqtt_manage_thread(void *args)
|
|
|
|
|
|
|
|
|
|
|
|
_mqtt_iota_confing_set();
|
|
|
|
_mqtt_iota_confing_set();
|
|
|
|
|
|
|
|
|
|
|
|
_mqtt_iota_callback_set();
|
|
|
|
//_mqtt_iota_callback_set();
|
|
|
|
|
|
|
|
|
|
|
|
ret = IOTA_Login();
|
|
|
|
ret = IOTA_Login();
|
|
|
|
LOG("IOTA_Login, retval=%d", ret);
|
|
|
|
LOG("IOTA_Login, retval=%d", ret);
|
|
|
|