axl_bool myqtt_storage_retain_msg_set ( MyQttCtx ctx,
const char *  topic_name,
MyQttQos  qos,
const unsigned char *  app_msg,
int  app_msg_size 
)

Allows to store retain message for the provided topic name so every new subscription on that topic will receive that message.

The function will replace the previous retained message. If you want to remove an existing message call to myqtt_storage_retain_msg_release

Parameters
ctxThe context where the operation takes place.
topic_nameThe topic name for the message and at the same time the subscription for which the message will be stored as retained.
qosThe app message qos.
app_msgThe application message to store.
app_msg_sizeApplication message size.
Returns
axl_true in the case retain message was configured without errors, otherwise axl_false is returned.

References FILE_EXISTS, FILE_IS_DIR, myqtt_mkdir(), myqtt_support_build_filename(), and myqtt_support_file_test().