Lines Matching refs:topic
25 static alcs_mqtt_status_e __alcs_mqtt_publish(char *topic, int qos, void *data, in __alcs_mqtt_publish() argument
28 return (IOT_MQTT_Publish_Simple(NULL, topic, qos, data, len) < 0) in __alcs_mqtt_publish()
33 static alcs_mqtt_status_e __alcs_mqtt_send_response(char *topic, int id, in __alcs_mqtt_send_response() argument
55 status = __alcs_mqtt_publish(topic, 1, msg_pub, strlen(msg_pub)); in __alcs_mqtt_send_response()
243 char *topic; in __alcs_mqtt_subscribe_callback() local
264 topic = (char *)ptopic_info->ptopic; in __alcs_mqtt_subscribe_callback()
273 if (topic == NULL || payload == NULL || topic_len == 0 || in __alcs_mqtt_subscribe_callback()
283 COAP_INFO("Receivce Message, Topic: %.*s\n", topic_len, topic); in __alcs_mqtt_subscribe_callback()
286 (strncmp(topic_compare, topic, topic_len) == 0)) { in __alcs_mqtt_subscribe_callback()
375 (strncmp(topic_compare, topic, topic_len) == 0)) { in __alcs_mqtt_subscribe_callback()
440 (strncmp(topic_compare, topic, topic_len) == 0)) { in __alcs_mqtt_subscribe_callback()
485 static alcs_mqtt_status_e __alcs_mqtt_subscribe(void *ctx, char *topic) in __alcs_mqtt_subscribe() argument
487 return (IOT_MQTT_Subscribe(NULL, topic, 0, __alcs_mqtt_subscribe_callback, in __alcs_mqtt_subscribe()
496 char topic[ALCS_MQTT_TOPIC_MAX_LEN] = { 0 }; in alcs_mqtt_init() local
511 memset(topic, 0, ALCS_MQTT_TOPIC_MAX_LEN); in alcs_mqtt_init()
512 HAL_Snprintf(topic, ALCS_MQTT_TOPIC_MAX_LEN, in alcs_mqtt_init()
515 if (__alcs_mqtt_subscribe((void *)ctx, topic) != ALCS_MQTT_STATUS_SUCCESS) { in alcs_mqtt_init()
516 COAP_ERR("ALCS Subscribe Failed, Topic: %s", topic); in alcs_mqtt_init()
520 memset(topic, 0, ALCS_MQTT_TOPIC_MAX_LEN); in alcs_mqtt_init()
521 HAL_Snprintf(topic, ALCS_MQTT_TOPIC_MAX_LEN, in alcs_mqtt_init()
524 if (__alcs_mqtt_subscribe((void *)ctx, topic) != ALCS_MQTT_STATUS_SUCCESS) { in alcs_mqtt_init()
525 COAP_ERR("ALCS Subscribe Failed, Topic: %s", topic); in alcs_mqtt_init()
529 memset(topic, 0, ALCS_MQTT_TOPIC_MAX_LEN); in alcs_mqtt_init()
531 topic, ALCS_MQTT_TOPIC_MAX_LEN, in alcs_mqtt_init()
534 if (__alcs_mqtt_subscribe((void *)ctx, topic) != ALCS_MQTT_STATUS_SUCCESS) { in alcs_mqtt_init()
535 COAP_ERR("ALCS Subscribe Failed, Topic: %s", topic); in alcs_mqtt_init()
619 char topic[ALCS_MQTT_TOPIC_MAX_LEN] = { 0 }; in alcs_prefixkey_get() local
628 HAL_Snprintf(topic, ALCS_MQTT_TOPIC_MAX_LEN, in alcs_prefixkey_get()
640 COAP_INFO("ALCS Prefix Get, Topic: %s, Payload: %s", topic, msg_pub); in alcs_prefixkey_get()
641 status = __alcs_mqtt_publish(topic, 1, msg_pub, strlen(msg_pub)); in alcs_prefixkey_get()
654 char topic[ALCS_MQTT_TOPIC_MAX_LEN] = { 0 }; in alcs_mqtt_subdev_prefix_get() local
665 HAL_Snprintf(topic, ALCS_MQTT_TOPIC_MAX_LEN, in alcs_mqtt_subdev_prefix_get()
680 COAP_ERR("ALCS Prefix Get, Topic: %s, Payload: %s", topic, msg_pub); in alcs_mqtt_subdev_prefix_get()
681 status = __alcs_mqtt_publish(topic, 1, msg_pub, strlen(msg_pub)); in alcs_mqtt_subdev_prefix_get()