提交 b65231a5 编写于 作者: C caveguy 提交者: 夏晓文

BugID:18189048:[linkkit example] delete useless linkit_data_arrived (#783)

* BugID:18189048:[linkkit example] delete useless linkit_data_arrived

* [breeze] Fix comboapp issues. 1. Add aos_loop_run() in comboapp. 2.Fix stuch issue after reboot for the 1st time. 3. Rm unused breeze_event_dispatcher. (#802)

* 1. fix the bug that esp8266 can't compile on windows (#811)

2. fix the bug that `aos upload` esp8266 & esp32 error on windows

* bugID:18694981:[dm]fix no connect event when reconnect happend issue

Change-Id: I3aa20b6aabe89d9ac39b9fe00daa8dc1cac11f50
上级 715605b6
......@@ -484,20 +484,6 @@ static int thing_prop_changed(const void *thing_id, const char *property, void *
return 0;
}
/* there is some data transparent transmission by linkkit */
static int linkit_data_arrived(const void *thing_id, const void *params, int len, void *ctx)
{
APP_TRACE("thing@%p: masterdev_linkkit_data(%d byte): %s\n", thing_id, len, (const char *)params);
/* do user's data arrived process logical here. */
/* ............................... */
/* user's data arrived process logical complete */
return 0;
}
#ifdef POST_WIFI_STATUS
static int is_active(app_context_t *sample_ctx)
......@@ -648,7 +634,7 @@ int linkkit_example()
.thing_disable = thing_disable, /* thing disabled handler */
.thing_call_service = thing_call_service, /* self-defined service handler */
.thing_prop_changed = thing_prop_changed, /* property set handler */
.linkit_data_arrived = linkit_data_arrived, /* transparent transmission data handler */
.linkit_data_arrived = NULL,
};
......
......@@ -345,19 +345,6 @@ static int thing_prop_changed(const void *thing_id, const char *property, void *
}
/* there is some data transparent transmission by linkkit */
static int linkit_data_arrived(const void *thing_id, const void *params, int len, void *ctx)
{
EXAMPLE_TRACE("thing@%p: masterdev_linkkit_data(%d byte): %s\n", thing_id, len, (const char *)params);
/* do user's data arrived process logical here. */
/* ............................... */
/* user's data arrived process logical complete */
return 0;
}
#ifdef POST_WIFI_STATUS
static int is_active(sample_context_t *sample_ctx)
......@@ -556,7 +543,7 @@ int linkkit_example()
.thing_disable = thing_disable, /* thing disabled handler */
.thing_call_service = thing_call_service, /* self-defined service handler */
.thing_prop_changed = thing_prop_changed, /* property set handler */
.linkit_data_arrived = linkit_data_arrived, /* transparent transmission data handler */
.linkit_data_arrived = NULL,
};
EXAMPLE_TRACE("linkkit start");
......
......@@ -466,22 +466,6 @@ static int thing_prop_changed(const void *thing_id, const char *property,
return 0;
}
/* there is some data transparent transmission by linkkit */
static int linkit_data_arrived(const void *thing_id, const void *params,
int len, void *ctx)
{
EXAMPLE_TRACE("thing@%p: masterdev_linkkit_data(%d byte): %s\n", thing_id,
len, (const char *)params);
/* do user's data arrived process logical here. */
/* ............................... */
/* user's data arrived process logical complete */
return 0;
}
static int is_active(sample_context_t *sample_ctx)
{
#ifdef LOCAL_CONN_ENABLE
......@@ -667,8 +651,7 @@ int linkkit_example()
.thing_call_service =
thing_call_service, /* self-defined service handler */
.thing_prop_changed = thing_prop_changed, /* property set handler */
.linkit_data_arrived =
linkit_data_arrived, /* transparent transmission data handler */
.linkit_data_arrived = NULL,
};
EXAMPLE_TRACE("linkkit start");
......
......@@ -70,7 +70,8 @@ static void _iotx_linkkit_event_callback(iotx_dm_event_types_t type, char *paylo
}
switch (type) {
case IOTX_DM_EVENT_CLOUD_CONNECTED: {
case IOTX_DM_EVENT_CLOUD_CONNECTED:
case IOTX_DM_EVENT_CLOUD_RECONNECT: {
if (ctx->user_event_handler->connected) {
ctx->user_event_handler->connected();
}
......
......@@ -1754,8 +1754,8 @@ int dm_msg_combine_login_reply(dm_msg_response_payload_t *response)
}
aos_get_version_info((unsigned char *)subdev_aos_verson, (unsigned char *)random_num, (unsigned char *)subdev_mac_num,
(unsigned char *)subdev_chip_code, (unsigned char *)aos_active_data, AOS_ACTIVE_INFO_LEN);
memcpy(aos_active_data+40, "1111111111222222222233333333334444444444", 40);
memcpy(aos_active_data + 40, "1111111111222222222233333333334444444444", 40);
active_param_len = strlen(DM_MSG_THING_AOS_ACTIVE_INFO_PAYLOAD) + strlen(aos_active_data) + 1;
active_param = DM_malloc(active_param_len);
if (active_param == NULL) {
......@@ -1946,17 +1946,7 @@ int dm_msg_cloud_disconnect(void)
int dm_msg_cloud_reconnect(void)
{
int res = 0;
char product_key[PRODUCT_KEY_MAXLEN] = {0};
char device_name[DEVICE_NAME_MAXLEN] = {0};
HAL_GetProductKey(product_key);
HAL_GetDeviceName(device_name);
/* Send To User */
res = _dm_msg_send_to_user(IOTX_DM_EVENT_CLOUD_RECONNECT, NULL);
return res;
return _dm_msg_send_to_user(IOTX_DM_EVENT_CLOUD_RECONNECT, NULL);
}
const char DM_MSG_EVENT_FOUND_DEVICE_FMT[] DM_READ_ONLY = "{\"product_key\":\"%s\",\"device_name\":\"%s\"}";
......
......@@ -471,7 +471,8 @@ static void _linkkit_gateway_event_callback(iotx_dm_event_types_t type, char *pa
}
switch (type) {
case IOTX_DM_EVENT_CLOUD_CONNECTED: {
case IOTX_DM_EVENT_CLOUD_CONNECTED:
case IOTX_DM_EVENT_CLOUD_RECONNECT: {
if (linkkit_gateway_ctx->init_params.event_cb) {
linkkit_event_t event;
......@@ -933,7 +934,7 @@ static void _linkkit_gateway_event_callback(iotx_dm_event_types_t type, char *pa
linkkit_gateway_dev_callback_node_t *node = NULL;
lite_cjson_t lite, lite_item_devid, lite_item_rawdata;
char *output = NULL;
if (payload == NULL) {
return;
}
......@@ -1274,7 +1275,7 @@ static void _linkkit_gateway_event_callback(iotx_dm_event_types_t type, char *pa
if (payload == NULL) {
return;
}
/* Parse Payload */
memset(&lite, 0, sizeof(lite_cjson_t));
res = lite_cjson_parse(payload, strlen(payload), &lite);
......@@ -1450,7 +1451,7 @@ int linkkit_gateway_stop(int devid)
linkkit_gateway_ctx->mutex = NULL;
linkkit_gateway_ctx->upstream_mutex = NULL;
memset(&linkkit_gateway_ctx->init_params,0,sizeof(linkkit_params_t));
memset(&linkkit_gateway_ctx->init_params, 0, sizeof(linkkit_params_t));
linkkit_gateway_ctx->dispatch_thread = NULL;
linkkit_gateway_ctx->fota_callback = NULL;
INIT_LIST_HEAD(&linkkit_gateway_ctx->dev_callback_list);
......
......@@ -190,7 +190,8 @@ static void _linkkit_solo_event_callback(iotx_dm_event_types_t type, char *paylo
}
switch (type) {
case IOTX_DM_EVENT_CLOUD_CONNECTED: {
case IOTX_DM_EVENT_CLOUD_CONNECTED:
case IOTX_DM_EVENT_CLOUD_RECONNECT: {
if (linkkit_solo_ctx->user_callback->on_connect) {
linkkit_solo_ctx->user_callback->on_connect(linkkit_solo_ctx->user_context);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册