CommsChampion Ecosystem MQTT-SN Client
MQTT-SN client library.
Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1//
2// Copyright 2016 - 2026 (C). Alex Robenko. All rights reserved.
3//
4// SPDX-License-Identifier: MPL-2.0
5//
6// This Source Code Form is subject to the terms of the Mozilla Public
7// License, v. 2.0. If a copy of the MPL was not distributed with this
8// file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
12
13#pragma once
14
15#include "cc_mqttsn_client/common.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif // #ifdef __cplusplus
20
31
39
47
62
76void cc_mqttsn_client_process_data(CC_MqttsnClientHandle client, const unsigned char* buf, unsigned bufLen, CC_MqttsnDataOrigin origin);
77
88
94
105
111
122
128
134
139
147
157
166
171
182
188
203
209
216
222
229
235
242
248
260
266
277
283
288
297
304
310
317
323
330
336
348
357
372 void* cbData);
373
382
389
395
402
408
413
420
425
432
444
453
471 const CC_MqttsnConnectConfig* config,
472 const CC_MqttsnWillConfig* willConfig,
474 void* cbData);
475
480
489
496
502
509
515
527
536
551 void* cbData);
552
561
568
574
581
587
592
599
611
620
636 const CC_MqttsnSubscribeConfig* config,
638 void* cbData);
639
648
655
661
668
674
679
686
698
707
723 const CC_MqttsnUnsubscribeConfig* config,
725 void* cbData);
726
735
742
748
755
761
766
773
785
794
810 const CC_MqttsnPublishConfig* config,
812 void* cbData);
813
822
829
835
842
848
853
860
872
881
897 const CC_MqttsnWillConfig* config,
899 void* cbData);
900
909
916
922
929
935
940
947
959
968
984 const CC_MqttsnSleepConfig* config,
986 void* cbData);
987
988// --------------------- Callbacks ---------------------
989
1001 CC_MqttsnClientHandle client,
1003 void* data);
1004
1017 CC_MqttsnClientHandle client,
1019 void* data);
1020
1031 CC_MqttsnClientHandle client,
1033 void* data);
1034
1043 CC_MqttsnClientHandle client,
1045 void* data);
1046
1056 CC_MqttsnClientHandle client,
1058 void* data);
1059
1067 CC_MqttsnClientHandle client,
1069 void* data);
1070
1078 CC_MqttsnClientHandle client,
1080 void* data);
1081
1088 CC_MqttsnClientHandle client,
1090 void* data);
1091
1092#ifdef __cplusplus
1093}
1094#endif
CC_MqttsnErrorCode cc_mqttsn_client_set_verify_outgoing_topic_enabled(CC_MqttsnClientHandle client, bool enabled)
Control outgoing topic format verification.
void cc_mqttsn_client_discard_all_gateway_infos(CC_MqttsnClientHandle client)
Discard stored information on all available gateways.
void cc_mqttsn_client_set_send_output_data_callback(CC_MqttsnClientHandle client, CC_MqttsnSendOutputDataCb cb, void *data)
Set callback to send raw data over I/O link.
void cc_mqttsn_client_set_gwinfo_delay_request_callback(CC_MqttsnClientHandle client, CC_MqttsnGwinfoDelayRequestCb cb, void *data)
Set callback to request a random timeout to send GWINFO as a response to the SEARCHGW from other clie...
void cc_mqttsn_client_process_data(CC_MqttsnClientHandle client, const unsigned char *buf, unsigned bufLen, CC_MqttsnDataOrigin origin)
Provide data, received over I/O link, to the library for processing.
CC_MqttsnErrorCode cc_mqttsn_client_set_allowed_adv_losses(CC_MqttsnClientHandle client, unsigned count)
Set number of allowed ADVERTISE message misses.
CC_MqttsnErrorCode cc_mqttsn_client_set_default_retry_count(CC_MqttsnClientHandle client, unsigned value)
Set number of retry attempts to perform before reporting unsuccessful result of the operation (Nretry...
CC_MqttsnErrorCode cc_mqttsn_client_set_verify_incoming_topic_enabled(CC_MqttsnClientHandle client, bool enabled)
Control incoming topic format verification.
unsigned long long cc_mqttsn_client_get_incoming_topic_id_storage_limit(CC_MqttsnClientHandle client)
Retrieve currently configured limit of the topic IDs stored for the incoming messages.
void cc_mqttsn_client_set_gw_disconnect_report_callback(CC_MqttsnClientHandle client, CC_MqttsnGwDisconnectedReportCb cb, void *data)
Set callback to report unsolicited disconnection of the gateway.
void(* CC_MqttsnGwStatusReportCb)(void *data, CC_MqttsnGwStatus status, const CC_MqttsnGatewayInfo *info)
Callback used to report gateway status.
Definition common.h:374
unsigned cc_mqttsn_client_get_default_gw_adv_duration(CC_MqttsnClientHandle client)
Get current default gateway advertise configuration.
CC_MqttsnErrorCode cc_mqttsn_client_asleep_check_messages(CC_MqttsnClientHandle client)
Check messages when in "asleep" state.
unsigned cc_mqttsn_client_get_default_retry_period(CC_MqttsnClientHandle client)
Set configured retry period to wait between resending unacknowledged message to the gateway (Tretry f...
unsigned cc_mqttsn_client_get_allowed_adv_losses(CC_MqttsnClientHandle client)
Get current configuration of allowed ADVERTISE message misses.
CC_MqttsnErrorCode cc_mqttsn_client_set_default_retry_period(CC_MqttsnClientHandle client, unsigned value)
Set retry period to wait between resending unacknowledged message to the gateway (Tretry from spec).
void cc_mqttsn_client_tick(CC_MqttsnClientHandle client, unsigned ms)
Notify client about requested time expiry.
bool cc_mqttsn_client_get_verify_incoming_msg_subscribed(CC_MqttsnClientHandle client)
Retrieve current incoming message being correctly subscribed control.
void(* CC_MqttsnMessageReportCb)(void *data, const CC_MqttsnMessageInfo *msgInfo)
Callback used to report incoming messages.
Definition common.h:392
void(* CC_MqttsnGwDisconnectedReportCb)(void *data, CC_MqttsnGatewayDisconnectReason reason)
Callback used to report unsolicited disconnection of the gateway.
Definition common.h:381
bool cc_mqttsn_client_get_verify_incoming_topic_enabled(CC_MqttsnClientHandle client)
Retrieve current incoming topic format verification control.
void(* CC_MqttsnNextTickProgramCb)(void *data, unsigned duration)
Callback used to request time measurement.
Definition common.h:340
unsigned cc_mqttsn_client_get_default_broadcast_radius(CC_MqttsnClientHandle client)
Get current broadcast radius configuration.
void(* CC_MqttsnSendOutputDataCb)(void *data, const unsigned char *buf, unsigned bufLen, unsigned broadcastRadius)
Callback used to request to send data to the gateway.
Definition common.h:364
CC_MqttsnErrorCode cc_mqttsn_client_set_outgoing_topic_id_storage_limit(CC_MqttsnClientHandle client, unsigned long long limit)
Specify limit of the topic IDs stored for the outgoing messages.
CC_MqttsnErrorCode cc_mqttsn_client_set_verify_incoming_msg_subscribed(CC_MqttsnClientHandle client, bool enabled)
Control verification of the incoming message being correctly subscribed.
unsigned long long cc_mqttsn_client_get_outgoing_topic_id_storage_limit(CC_MqttsnClientHandle client)
Retrieve currently configured limit of the topic IDs stored for the outgoing messages.
CC_MqttsnErrorCode cc_mqttsn_client_set_incoming_topic_id_storage_limit(CC_MqttsnClientHandle client, unsigned long long limit)
Specify limit of the topic IDs stored for the incoming messages.
struct CC_MqttsnClient * CC_MqttsnClientHandle
Handler used to access client specific data structures.
Definition common.h:147
void cc_mqttsn_client_free(CC_MqttsnClientHandle client)
Free previously allocated client.
unsigned(* CC_MqttsnCancelNextTickWaitCb)(void *data)
Callback used to request termination of existing time measurement.
Definition common.h:349
void cc_mqttsn_client_set_next_tick_program_callback(CC_MqttsnClientHandle client, CC_MqttsnNextTickProgramCb cb, void *data)
Set callback to call when time measurement is required.
void(* CC_MqttsnErrorLogCb)(void *data, const char *msg)
Callback used to report discovered errors.
Definition common.h:399
unsigned(* CC_MqttsnGwinfoDelayRequestCb)(void *data)
Callback used to request delay (in ms) to wait before responding with GWINFO message on behalf of a g...
Definition common.h:406
void cc_mqttsn_client_init_gateway_info(CC_MqttsnGatewayInfo *info)
Initialize the CC_MqttsnGatewayInfo structure.
void cc_mqttsn_client_set_cancel_next_tick_wait_callback(CC_MqttsnClientHandle client, CC_MqttsnCancelNextTickWaitCb cb, void *data)
Set callback to terminate current time measurement.
CC_MqttsnErrorCode cc_mqttsn_client_set_available_gateway_info(CC_MqttsnClientHandle client, const CC_MqttsnGatewayInfo *info)
Update stored available gateway information.
CC_MqttsnErrorCode cc_mqttsn_client_get_available_gateway_info(CC_MqttsnClientHandle client, unsigned idx, CC_MqttsnGatewayInfo *info)
Retrieve stored available gateway information.
void cc_mqttsn_client_set_message_report_callback(CC_MqttsnClientHandle client, CC_MqttsnMessageReportCb cb, void *data)
Set callback to report incoming messages.
CC_MqttsnErrorCode cc_mqttsn_client_discard_available_gateway_info(CC_MqttsnClientHandle client, unsigned char gwId)
Discard stored available gateway information.
unsigned cc_mqttsn_client_get_default_retry_count(CC_MqttsnClientHandle client)
Get configured number of retry attempts to perform before reporting unsuccessful result of the operat...
CC_MqttsnClientHandle cc_mqttsn_client_alloc()
Allocate new client.
bool cc_mqttsn_client_get_verify_outgoing_topic_enabled(CC_MqttsnClientHandle client)
Retrieve current outgoing topic format verification control.
void cc_mqttsn_client_set_gw_status_report_callback(CC_MqttsnClientHandle client, CC_MqttsnGwStatusReportCb cb, void *data)
Set callback to report status of the gateway.
void cc_mqttsn_client_set_error_log_callback(CC_MqttsnClientHandle client, CC_MqttsnErrorLogCb cb, void *data)
Set callback to report error messages.
CC_MqttsnErrorCode cc_mqttsn_client_set_default_gw_adv_duration(CC_MqttsnClientHandle client, unsigned ms)
Set default gateway advertise duration.
CC_MqttsnErrorCode cc_mqttsn_client_set_default_broadcast_radius(CC_MqttsnClientHandle client, unsigned value)
Set broadcast radius.
unsigned cc_mqttsn_client_get_available_gateways_count(CC_MqttsnClientHandle client)
Get number of available gateways.
struct CC_MqttsnConnect * CC_MqttsnConnectHandle
Handle for "connect" operation.
Definition common.h:165
CC_MqttsnErrorCode cc_mqttsn_client_connect_cancel(CC_MqttsnConnectHandle handle)
Cancel the allocated "connect" operation.
CC_MqttsnConnectHandle cc_mqttsn_client_connect_prepare(CC_MqttsnClientHandle client, CC_MqttsnErrorCode *ec)
Prepare "connect" operation.
CC_MqttsnErrorCode cc_mqttsn_client_connect_set_retry_count(CC_MqttsnConnectHandle handle, unsigned count)
Configure the retry count for the "connect" operation.
void cc_mqttsn_client_connect_init_config_will(CC_MqttsnWillConfig *config)
Intialize the CC_MqttsnWillConfig configuration structure.
unsigned cc_mqttsn_client_connect_get_retry_period(CC_MqttsnConnectHandle handle)
Retrieve the configured retry period for the "connect" operation.
CC_MqttsnErrorCode cc_mqttsn_client_connect_config_will(CC_MqttsnConnectHandle handle, const CC_MqttsnWillConfig *config)
Perform will configuration of the "connect" operation.
unsigned cc_mqttsn_client_connect_get_retry_count(CC_MqttsnConnectHandle handle)
Retrieve the configured retry count for the "connect" operation.
void(* CC_MqttsnConnectCompleteCb)(void *data, CC_MqttsnAsyncOpStatus status, const CC_MqttsnConnectInfo *info)
Callback used to report completion of the connect operation.
Definition common.h:424
void cc_mqttsn_client_connect_init_config(CC_MqttsnConnectConfig *config)
Intialize the CC_MqttsnConnectConfig configuration structure.
CC_MqttsnErrorCode cc_mqttsn_client_connect_set_retry_period(CC_MqttsnConnectHandle handle, unsigned ms)
Configure the retry period for the "connect" operation.
CC_MqttsnConnectionStatus cc_mqttsn_client_get_connection_status(CC_MqttsnClientHandle client)
Check the inner state of the library of whether it's connected to the gateway.
CC_MqttsnErrorCode cc_mqttsn_client_connect_send(CC_MqttsnConnectHandle handle, CC_MqttsnConnectCompleteCb cb, void *cbData)
Send the "connect" operation.
CC_MqttsnErrorCode cc_mqttsn_client_connect(CC_MqttsnClientHandle client, const CC_MqttsnConnectConfig *config, const CC_MqttsnWillConfig *willConfig, CC_MqttsnConnectCompleteCb cb, void *cbData)
Prepare and send "connect" request in one go.
CC_MqttsnErrorCode cc_mqttsn_client_connect_config(CC_MqttsnConnectHandle handle, const CC_MqttsnConnectConfig *config)
Perform configuration of the "connect" operation.
CC_MqttsnErrorCode cc_mqttsn_client_disconnect(CC_MqttsnClientHandle client, CC_MqttsnDisconnectCompleteCb cb, void *cbData)
Prepare and send "disconnect" request in one go.
struct CC_MqttsnDisconnect * CC_MqttsnDisconnectHandle
Handle for "disconnect" operation.
Definition common.h:174
unsigned cc_mqttsn_client_disconnect_get_retry_count(CC_MqttsnDisconnectHandle handle)
Retrieve the configured retry count for the "disconnect" operation.
unsigned cc_mqttsn_client_disconnect_get_retry_period(CC_MqttsnDisconnectHandle handle)
Retrieve the configured retry period for the "disconnect" operation.
CC_MqttsnErrorCode cc_mqttsn_client_disconnect_set_retry_count(CC_MqttsnDisconnectHandle handle, unsigned count)
Configure the retry count for the "disconnect" operation.
CC_MqttsnErrorCode cc_mqttsn_client_disconnect_send(CC_MqttsnDisconnectHandle handle, CC_MqttsnDisconnectCompleteCb cb, void *cbData)
Send the "disconnect" operation.
CC_MqttsnDisconnectHandle cc_mqttsn_client_disconnect_prepare(CC_MqttsnClientHandle client, CC_MqttsnErrorCode *ec)
Prepare "disconnect" operation.
void(* CC_MqttsnDisconnectCompleteCb)(void *data, CC_MqttsnAsyncOpStatus status)
Callback used to report completion of the disconnect operation.
Definition common.h:432
CC_MqttsnErrorCode cc_mqttsn_client_disconnect_cancel(CC_MqttsnDisconnectHandle handle)
Cancel the allocated "disconnect" operation.
CC_MqttsnErrorCode cc_mqttsn_client_disconnect_set_retry_period(CC_MqttsnDisconnectHandle handle, unsigned ms)
Configure the retry period for the "disconnect" operation.
CC_MqttsnConnectionStatus
Connection state.
Definition common.h:124
CC_MqttsnErrorCode
Error code returned by various API functions.
Definition common.h:55
CC_MqttsnDataOrigin
Data origin.
Definition common.h:134
struct CC_MqttsnPublish * CC_MqttsnPublishHandle
Handle for "publish" operation.
Definition common.h:201
unsigned cc_mqttsn_client_publish_get_retry_period(CC_MqttsnPublishHandle handle)
Retrieve the configured retry period for the "publish" operation.
CC_MqttsnPublishHandle cc_mqttsn_client_publish_prepare(CC_MqttsnClientHandle client, CC_MqttsnErrorCode *ec)
Prepare "publish" operation.
CC_MqttsnErrorCode cc_mqttsn_client_publish_set_retry_count(CC_MqttsnPublishHandle handle, unsigned count)
Configure the retry count for the "publish" operation.
CC_MqttsnErrorCode cc_mqttsn_client_publish_config(CC_MqttsnPublishHandle handle, const CC_MqttsnPublishConfig *config)
Perform configuration of the "publish" operation.
void(* CC_MqttsnPublishCompleteCb)(void *data, CC_MqttsnPublishHandle handle, CC_MqttsnAsyncOpStatus status, const CC_MqttsnPublishInfo *info)
Callback used to report completion of the publish operation.
Definition common.h:473
CC_MqttsnErrorCode cc_mqttsn_client_publish_cancel(CC_MqttsnPublishHandle handle)
Cancel the allocated "publish" operation.
unsigned cc_mqttsn_client_publish_get_retry_count(CC_MqttsnPublishHandle handle)
Retrieve the configured retry count for the "publish" operation.
CC_MqttsnErrorCode cc_mqttsn_client_publish(CC_MqttsnClientHandle client, const CC_MqttsnPublishConfig *config, CC_MqttsnPublishCompleteCb cb, void *cbData)
Prepare and send "publish" request in one go.
CC_MqttsnErrorCode cc_mqttsn_client_publish_send(CC_MqttsnPublishHandle handle, CC_MqttsnPublishCompleteCb cb, void *cbData)
Send the "publish" operation.
CC_MqttsnErrorCode cc_mqttsn_client_publish_set_retry_period(CC_MqttsnPublishHandle handle, unsigned ms)
Configure the retry period for the "publish" operation.
void cc_mqttsn_client_publish_init_config(CC_MqttsnPublishConfig *config)
Intialize the CC_MqttsnPublishConfig configuration structure.
CC_MqttsnErrorCode cc_mqttsn_client_search_set_broadcast_radius(CC_MqttsnSearchHandle handle, unsigned broadcastRadius)
Configure the broadcast radius for the "search" operation.
CC_MqttsnErrorCode cc_mqttsn_client_search_set_retry_count(CC_MqttsnSearchHandle handle, unsigned count)
Configure the retry count for the "search" operation.
void(* CC_MqttsnSearchCompleteCb)(void *data, CC_MqttsnAsyncOpStatus status, const CC_MqttsnGatewayInfo *info)
Callback used to report completion of the asynchronous operation.
Definition common.h:414
unsigned cc_mqttsn_client_search_get_retry_count(CC_MqttsnSearchHandle handle)
Retrieve the configured retry count for the "search" operation.
CC_MqttsnErrorCode cc_mqttsn_client_search_send(CC_MqttsnSearchHandle handle, CC_MqttsnSearchCompleteCb cb, void *cbData)
Send the "search" operation.
CC_MqttsnErrorCode cc_mqttsn_client_search_set_retry_period(CC_MqttsnSearchHandle handle, unsigned ms)
Configure the retry period for the "search" operation.
CC_MqttsnErrorCode cc_mqttsn_client_search(CC_MqttsnClientHandle handle, CC_MqttsnSearchCompleteCb cb, void *cbData)
Prepare and send "search" request in one go.
struct CC_MqttsnSearch * CC_MqttsnSearchHandle
Handle for "search" operation.
Definition common.h:156
unsigned cc_mqttsn_client_search_get_broadcast_radius(CC_MqttsnSearchHandle handle)
Retrieve the configured broadcast radius for the "search" operation.
unsigned cc_mqttsn_client_search_get_retry_period(CC_MqttsnSearchHandle handle)
Retrieve the configured retry period for the "search" operation.
CC_MqttsnSearchHandle cc_mqttsn_client_search_prepare(CC_MqttsnClientHandle client, CC_MqttsnErrorCode *ec)
Prepare "search" operation.
CC_MqttsnErrorCode cc_mqttsn_client_search_cancel(CC_MqttsnSearchHandle handle)
Cancel the allocated "search" operation.
void cc_mqttsn_client_sleep_init_config(CC_MqttsnSleepConfig *config)
Intialize the CC_MqttsnSleepConfig configuration structure.
unsigned cc_mqttsn_client_sleep_get_retry_period(CC_MqttsnSleepHandle handle)
Retrieve the configured retry period for the "sleep" operation.
struct CC_MqttsnSleep * CC_MqttsnSleepHandle
Handle for "sleep" operation.
Definition common.h:219
CC_MqttsnErrorCode cc_mqttsn_client_sleep_send(CC_MqttsnSleepHandle handle, CC_MqttsnSleepCompleteCb cb, void *cbData)
Send the "sleep" operation.
CC_MqttsnErrorCode cc_mqttsn_client_sleep_set_retry_period(CC_MqttsnSleepHandle handle, unsigned ms)
Configure the retry period for the "sleep" operation.
void(* CC_MqttsnSleepCompleteCb)(void *data, CC_MqttsnAsyncOpStatus status)
Callback used to report completion of the sleep operation.
Definition common.h:491
CC_MqttsnSleepHandle cc_mqttsn_client_sleep_prepare(CC_MqttsnClientHandle client, CC_MqttsnErrorCode *ec)
Prepare "sleep" operation.
CC_MqttsnErrorCode cc_mqttsn_client_sleep_set_retry_count(CC_MqttsnSleepHandle handle, unsigned count)
Configure the retry count for the "sleep" operation.
CC_MqttsnErrorCode cc_mqttsn_client_sleep(CC_MqttsnClientHandle client, const CC_MqttsnSleepConfig *config, CC_MqttsnSleepCompleteCb cb, void *cbData)
Prepare and send "sleep" request in one go.
CC_MqttsnErrorCode cc_mqttsn_client_sleep_cancel(CC_MqttsnSleepHandle handle)
Cancel the allocated "sleep" operation.
unsigned cc_mqttsn_client_sleep_get_retry_count(CC_MqttsnSleepHandle handle)
Retrieve the configured retry count for the "sleep" operation.
CC_MqttsnErrorCode cc_mqttsn_client_sleep_config(CC_MqttsnSleepHandle handle, const CC_MqttsnSleepConfig *config)
Perform configuration of the "sleep" operation.
struct CC_MqttsnUnsubscribe * CC_MqttsnUnsubscribeHandle
Handle for "unsubscribe" operation.
Definition common.h:192
unsigned cc_mqttsn_client_subscribe_get_retry_count(CC_MqttsnSubscribeHandle handle)
Retrieve the configured retry count for the "subscribe" operation.
CC_MqttsnSubscribeHandle cc_mqttsn_client_subscribe_prepare(CC_MqttsnClientHandle client, CC_MqttsnErrorCode *ec)
Prepare "subscribe" operation.
unsigned cc_mqttsn_client_subscribe_get_retry_period(CC_MqttsnSubscribeHandle handle)
Retrieve the configured retry period for the "subscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_subscribe_config(CC_MqttsnSubscribeHandle handle, const CC_MqttsnSubscribeConfig *config)
Perform configuration of the "subscribe" operation.
struct CC_MqttsnSubscribe * CC_MqttsnSubscribeHandle
Handle for "subscribe" operation.
Definition common.h:183
void(* CC_MqttsnSubscribeCompleteCb)(void *data, CC_MqttsnSubscribeHandle handle, CC_MqttsnAsyncOpStatus status, const CC_MqttsnSubscribeInfo *info)
Callback used to report completion of the subscribe operation.
Definition common.h:446
CC_MqttsnErrorCode cc_mqttsn_client_subscribe_send(CC_MqttsnSubscribeHandle handle, CC_MqttsnSubscribeCompleteCb cb, void *cbData)
Send the "subscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_subscribe_set_retry_count(CC_MqttsnSubscribeHandle handle, unsigned count)
Configure the retry count for the "subscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_subscribe_cancel(CC_MqttsnSubscribeHandle handle)
Cancel the allocated "subscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_subscribe_set_retry_period(CC_MqttsnSubscribeHandle handle, unsigned ms)
Configure the retry period for the "subscribe" operation.
void cc_mqttsn_client_subscribe_init_config(CC_MqttsnSubscribeConfig *config)
Intialize the CC_MqttsnSubscribeConfig configuration structure.
CC_MqttsnErrorCode cc_mqttsn_client_subscribe(CC_MqttsnClientHandle client, const CC_MqttsnSubscribeConfig *config, CC_MqttsnSubscribeCompleteCb cb, void *cbData)
Prepare and send "subscribe" request in one go.
unsigned cc_mqttsn_client_unsubscribe_get_retry_period(CC_MqttsnUnsubscribeHandle handle)
Retrieve the configured retry period for the "unsubscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_unsubscribe_set_retry_count(CC_MqttsnUnsubscribeHandle handle, unsigned count)
Configure the retry count for the "unsubscribe" operation.
CC_MqttsnUnsubscribeHandle cc_mqttsn_client_unsubscribe_prepare(CC_MqttsnClientHandle client, CC_MqttsnErrorCode *ec)
Prepare "unsubscribe" operation.
unsigned cc_mqttsn_client_unsubscribe_get_retry_count(CC_MqttsnUnsubscribeHandle handle)
Retrieve the configured retry count for the "unsubscribe" operation.
void cc_mqttsn_client_unsubscribe_init_config(CC_MqttsnUnsubscribeConfig *config)
Intialize the CC_MqttsnUnsubscribeConfig configuration structure.
CC_MqttsnErrorCode cc_mqttsn_client_unsubscribe_send(CC_MqttsnUnsubscribeHandle handle, CC_MqttsnUnsubscribeCompleteCb cb, void *cbData)
Send the "unsubscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_unsubscribe_config(CC_MqttsnUnsubscribeHandle handle, const CC_MqttsnUnsubscribeConfig *config)
Perform configuration of the "unsubscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_unsubscribe_cancel(CC_MqttsnUnsubscribeHandle handle)
Cancel the allocated "unsubscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_unsubscribe_set_retry_period(CC_MqttsnUnsubscribeHandle handle, unsigned ms)
Configure the retry period for the "unsubscribe" operation.
CC_MqttsnErrorCode cc_mqttsn_client_unsubscribe(CC_MqttsnClientHandle client, const CC_MqttsnUnsubscribeConfig *config, CC_MqttsnUnsubscribeCompleteCb cb, void *cbData)
Prepare and send "unsubscribe" request in one go.
void(* CC_MqttsnUnsubscribeCompleteCb)(void *data, CC_MqttsnUnsubscribeHandle handle, CC_MqttsnAsyncOpStatus status)
Callback used to report completion of the unsubscribe operation.
Definition common.h:458
unsigned cc_mqttsn_client_will_get_retry_period(CC_MqttsnWillHandle handle)
Retrieve the configured retry period for the "will" operation.
unsigned cc_mqttsn_client_will_get_retry_count(CC_MqttsnWillHandle handle)
Retrieve the configured retry count for the "will" operation.
CC_MqttsnErrorCode cc_mqttsn_client_will_set_retry_count(CC_MqttsnWillHandle handle, unsigned count)
Configure the retry count for the "will" operation.
CC_MqttsnErrorCode cc_mqttsn_client_will_set_retry_period(CC_MqttsnWillHandle handle, unsigned ms)
Configure the retry period for the "will" operation.
CC_MqttsnErrorCode cc_mqttsn_client_will_cancel(CC_MqttsnWillHandle handle)
Cancel the allocated "will" operation.
void cc_mqttsn_client_will_init_config(CC_MqttsnWillConfig *config)
Intialize the CC_MqttsnWillConfig configuration structure.
CC_MqttsnWillHandle cc_mqttsn_client_will_prepare(CC_MqttsnClientHandle client, CC_MqttsnErrorCode *ec)
Prepare "will" operation.
struct CC_MqttsnWill * CC_MqttsnWillHandle
Handle for "will" operation.
Definition common.h:210
CC_MqttsnErrorCode cc_mqttsn_client_will_send(CC_MqttsnWillHandle handle, CC_MqttsnWillCompleteCb cb, void *cbData)
Send the "will" operation.
void(* CC_MqttsnWillCompleteCb)(void *data, CC_MqttsnAsyncOpStatus status, const CC_MqttsnWillInfo *info)
Callback used to report completion of the publish operation.
Definition common.h:483
CC_MqttsnErrorCode cc_mqttsn_client_will(CC_MqttsnClientHandle client, const CC_MqttsnWillConfig *config, CC_MqttsnWillCompleteCb cb, void *cbData)
Prepare and send "will" request in one go.
CC_MqttsnErrorCode cc_mqttsn_client_will_config(CC_MqttsnWillHandle handle, const CC_MqttsnWillConfig *config)
Perform configuration of the "will" operation.
Configuration the "connect" operation.
Definition common.h:249
Gateway information.
Definition common.h:240
Configuration the will for "publish" operations.
Definition common.h:301
Configuration the "sleep" operation.
Definition common.h:328
Configuration the "subscribe" operation.
Definition common.h:276
Configuration the "unsubscribe" operation.
Definition common.h:293
Configuration the will for "connect" and "will" operations.
Definition common.h:265