Lines Matching refs:param

161     subdev_notify_param_t *param = (subdev_notify_param_t *)pdata;  in aiot_subdev_notify()  local
165 switch (param->cb_type) { in aiot_subdev_notify()
171 if (mp_obj_is_fun(param->iot_gateway_handle->callback[param->cb_type])) { in aiot_subdev_notify()
172 callback_to_python(param->iot_gateway_handle->callback[param->cb_type], in aiot_subdev_notify()
173 mp_obj_new_int(param->ret_code)); in aiot_subdev_notify()
182 mp_obj_new_int(param->ret_code)); in aiot_subdev_notify()
184 mp_obj_new_str(param->params, strlen(param->params))); in aiot_subdev_notify()
185 if (mp_obj_is_fun(param->iot_gateway_handle->callback[param->cb_type])) { in aiot_subdev_notify()
186 callback_to_python(param->iot_gateway_handle->callback[param->cb_type], dict); in aiot_subdev_notify()
190 aos_free(param->params); in aiot_subdev_notify()
198 mp_obj_new_int(param->ret_code)); in aiot_subdev_notify()
200 MP_OBJ_FROM_PTR(param->iot_gateway_handle)); in aiot_subdev_notify()
201 if (mp_obj_is_fun(param->iot_gateway_handle->callback[param->cb_type])) { in aiot_subdev_notify()
202 callback_to_python(param->iot_gateway_handle->callback[param->cb_type], dict); in aiot_subdev_notify()
212 aos_free(param); in aiot_subdev_notify()
218 subdev_notify_param_t *param; in aiot_subdev_recv_handler() local
220 param = aos_malloc(sizeof(subdev_notify_param_t)); in aiot_subdev_recv_handler()
221 if (!param) { in aiot_subdev_recv_handler()
226 memset(param, 0, sizeof(subdev_notify_param_t)); in aiot_subdev_recv_handler()
229 param->iot_gateway_handle = iot_gateway_handle; in aiot_subdev_recv_handler()
233 param->cb_type = ON_TOPOADD; in aiot_subdev_recv_handler()
234param->ret_code = packet->data.generic_reply.code == 200 ? 0 : packet->data.generic_reply.code; in aiot_subdev_recv_handler()
237 param->cb_type = ON_TOPOREMOVE; in aiot_subdev_recv_handler()
238param->ret_code = packet->data.generic_reply.code == 200 ? 0 : packet->data.generic_reply.code; in aiot_subdev_recv_handler()
241 param->cb_type = ON_TOPOGET; in aiot_subdev_recv_handler()
242param->ret_code = packet->data.generic_reply.code == 200 ? 0 : packet->data.generic_reply.code; in aiot_subdev_recv_handler()
243 param->params = __amp_strdup(packet->data.generic_reply.data); in aiot_subdev_recv_handler()
246 param->cb_type = ON_LOGIN; in aiot_subdev_recv_handler()
247param->ret_code = packet->data.generic_reply.code == 200 ? 0 : packet->data.generic_reply.code; in aiot_subdev_recv_handler()
250 param->cb_type = ON_LOGOUT; in aiot_subdev_recv_handler()
251param->ret_code = packet->data.generic_reply.code == 200 ? 0 : packet->data.generic_reply.code; in aiot_subdev_recv_handler()
254 param->cb_type = ON_SUBREGISTER; in aiot_subdev_recv_handler()
255param->ret_code = packet->data.generic_reply.code == 200 ? 0 : packet->data.generic_reply.code; in aiot_subdev_recv_handler()
264 aos_free(param); in aiot_subdev_recv_handler()
271 aos_free(param); in aiot_subdev_recv_handler()
275 aos_free(param); in aiot_subdev_recv_handler()
280 py_task_schedule_call(aiot_subdev_notify, param); in aiot_subdev_recv_handler()
287 subdev_notify_param_t *param; in aiot_mqtt_message_cb() local
294 param = aos_malloc(sizeof(subdev_notify_param_t)); in aiot_mqtt_message_cb()
295 if (!param) { in aiot_mqtt_message_cb()
299 memset(param, 0, sizeof(subdev_notify_param_t)); in aiot_mqtt_message_cb()
301 param->iot_gateway_handle = iot_gateway_handle; in aiot_mqtt_message_cb()
303 param->option = message->option; in aiot_mqtt_message_cb()
314 param->cb_type = ON_DISCONNECT; in aiot_mqtt_message_cb()
315 param->ret_code = message->event.code; in aiot_mqtt_message_cb()
316 param->event_type = message->event.type; in aiot_mqtt_message_cb()
319 aos_free(param); in aiot_mqtt_message_cb()
326 param->ret_code = message->recv.code; in aiot_mqtt_message_cb()
327 param->topic_len = message->recv.topic_len; in aiot_mqtt_message_cb()
328 param->payload_len = message->recv.payload_len; in aiot_mqtt_message_cb()
329 param->topic = __amp_strdup(message->recv.topic); in aiot_mqtt_message_cb()
330 param->payload = __amp_strdup(message->recv.payload); in aiot_mqtt_message_cb()
331 param->recv_type = message->recv.type; in aiot_mqtt_message_cb()
334 aos_free(param); in aiot_mqtt_message_cb()
338 aos_free(param); in aiot_mqtt_message_cb()
342 py_task_schedule_call(aiot_subdev_notify, param); in aiot_mqtt_message_cb()
352 subdev_notify_param_t *param; in aiot_gateway_connect() local
395 param = aos_malloc(sizeof(subdev_notify_param_t)); in aiot_gateway_connect()
396 if (!param) { in aiot_gateway_connect()
403 param->ret_code = 0; in aiot_gateway_connect()
404 param->iot_gateway_handle = iot_gateway_handle; in aiot_gateway_connect()
405 param->cb_type = ON_CONNECT; in aiot_gateway_connect()
406 param->option = AIOT_MQTTOPT_EVENT_HANDLER; in aiot_gateway_connect()
407 param->event_type = AIOT_MQTTEVT_CONNECT; in aiot_gateway_connect()
408 py_task_schedule_call(aiot_subdev_notify, param); in aiot_gateway_connect()