这里有个回调函数,好奇心想了解下,认真思考还是不得其姐。特来请教大家
是这情况
应用程序使用的时候 这样调用就可以了
/* Register Callback */
IOT_RegisterCallback(ITE_CONNECT_SUCC, user_connected_event_handler);
IOT_RegisterCallback(ITE_DISCONNECTED, user_disconnected_event_handler);
IOT_RegisterCallback(ITE_PROPERTY_SET, user_property_set_event_handler);
IOT_RegisterCallback(ITE_REPORT_REPLY, user_report_reply_event_handler);
IOT_RegisterCallback(ITE_TIMESTAMP_REPLY, user_timestamp_reply_event_handler);
IOT_RegisterCallback(ITE_INITIALIZE_COMPLETED, user_initialized);
IOT_RegisterCallback(ITE_PERMIT_JOIN, user_permit_join_event_handler);
看了头文件宏定义
#ifndef _INFRA_COMPAT_H_
#define _INFRA_COMPAT_H_
#include "infra_defs.h"
#include "infra_list.h"
#undef being_deprecated
#define being_deprecated
typedef enum _IOT_LogLevel {
IOT_LOG_NONE = 0,
IOT_LOG_CRIT,
IOT_LOG_ERROR,
IOT_LOG_WARNING,
IOT_LOG_INFO,
IOT_LOG_DEBUG,
} IOT_LogLevel;
void IOT_SetLogLevel(IOT_LogLevel level);
void IOT_DumpMemoryStats(IOT_LogLevel level);
/**
* @brief event list used for iotx_regist_event_monitor_cb
*/
enum iotx_event_t {
IOTX_AWSS_START = 0x1000, /* AWSS start without enbale, just supports device discover */
IOTX_AWSS_ENABLE, /* AWSS enable */
IOTX_AWSS_LOCK_CHAN, /* AWSS lock channel(Got AWSS sync packet) */
IOTX_AWSS_CS_ERR, /* AWSS AWSS checksum is error */
IOTX_AWSS_PASSWD_ERR, /* AWSS decrypt passwd error */
IOTX_AWSS_GOT_SSID_PASSWD, /* AWSS parse ssid and passwd successfully */
IOTX_AWSS_CONNECT_ADHA, /* AWSS try to connnect adha (device discover, router solution) */
IOTX_AWSS_CONNECT_ADHA_FAIL, /* AWSS fails to connect adha */
IOTX_AWSS_CONNECT_AHA, /* AWSS try to connect aha (AP solution) */
IOTX_AWSS_CONNECT_AHA_FAIL, /* AWSS fails to connect aha */
IOTX_AWSS_SETUP_NOTIFY, /* AWSS sends out device setup information (AP and router solution) */
IOTX_AWSS_CONNECT_ROUTER, /* AWSS try to connect destination router */
IOTX_AWSS_CONNECT_ROUTER_FAIL, /* AWSS fails to connect destination router. */
IOTX_AWSS_GOT_IP, /* AWSS connects destination successfully and got ip address */
IOTX_AWSS_SUC_NOTIFY, /* AWSS sends out success notify (AWSS sucess) */
IOTX_AWSS_BIND_NOTIFY, /* AWSS sends out bind notify information to support bind between user and device */
IOTX_AWSS_ENABLE_TIMEOUT, /* AWSS enable timeout(user needs to call awss_config_press again to enable awss) */