|
SharkSSL™ Embedded SSL/TLS Stack
|
A secure SimpleMQ client designed for SharkSSL.
SimpleMQ is an easy to use IoT Message Queues architecture solution that follows the publish subscribe broadcast design pattern.
SharkMQ is a secure SimpleMQ client implementation delivered with SharkSSL standalone.
The SharkMQ C library comes with a C++ wrapper API, which includes a brief description of the API. See the C API for the full documentation.
Modules | |
| Error codes returned by function SharkMQ_getMessage | |
| Error codes returned by function SharkMQ_getMessage | |
| Response codes returned by function SharkMQ_getMessage | |
| Response codes returned by function SharkMQ_getMessage | |
| C API | |
Data Structures | |
| struct | SharkMQ |
| SharkMQ structure. More... | |
Typedefs | |
| typedef struct SharkMQ | SharkMQ |
| SharkMQ structure. | |
Functions | |
| SharkMQ::SharkMQ (U8 *buf, U16 bufLen) | |
| Create a secure SMQ client instance. More... | |
| int | SharkMQ::init (SharkSslCon *scon, const char *url, U32 *rnd) |
| Initiate the SMQ server connection. More... | |
| int | SharkMQ::connect (const char *uid, int uidLen, const char *credentials, U8 credLen, const char *info, int infoLen, U16 maxTlsFrameSize) |
| Connect/establish a persistent SMQ connection. More... | |
| void | SharkMQ::disconnect () |
| Gracefully close the connection. More... | |
| SharkMQ::~SharkMQ () | |
| Terminate an SMQ instance. More... | |
| int | SharkMQ::create (const char *topic) |
| Create a topic an fetch the topic ID (tid). More... | |
| int | SharkMQ::createsub (const char *subtopic) |
| Create a sub-topic and fetch the subtopic ID. More... | |
| int | SharkMQ::subscribe (const char *topic) |
| The response to SharkMQ_subscribe is asynchronous and returned as status SMQ_SUBACK via SharkMQ_getMessage. More... | |
| int | SharkMQ::unsubscribe (U32 tid) |
| Requests the broker to unsubscribe the server from a topic. More... | |
| int | SharkMQ::publish (const void *data, int len, U32 tid, U32 subtid) |
| Publish messages to a topic and optionally to a sub-topic. More... | |
| int | SharkMQ::wrtstr (const char *str) |
| Publish a message in chunks and request the broker to assemble the message before publishing to the subscriber(s). More... | |
| int | SharkMQ::write (const void *data, int len) |
| Publish a message in chunks and request the broker to assemble the message before publishing to the subscriber(s). More... | |
| int | SharkMQ::pubflush (U32 tid, U32 subtid) |
| Flush the internal buffer and request the broker to assemble all stored fragments as one message. More... | |
| int | SharkMQ::observe (U32 tid) |
| Request the broker to provide change notification events when the number of subscribers to a specific topic changes. More... | |
| int | SharkMQ::unobserve (U32 tid) |
| Stop receiving change notifications for a topic ID or ephemeral topic ID. More... | |
| int | SharkMQ::getMessage (U8 **msg) |
| Wait for messages sent from the broker. More... | |
| int | SharkMQ::getMsgSize () |
| Returns the message size, which is SMQ::frameLen - 15. More... | |
| int SharkMQ::connect | ( | const char * | uid, |
| int | uidLen, | ||
| const char * | credentials, | ||
| U8 | credLen, | ||
| const char * | info, | ||
| int | infoLen, | ||
| U16 | maxTlsFrameSize | ||
| ) |
Connect/establish a persistent SMQ connection.
| int SharkMQ::create | ( | const char * | topic | ) |
Create a topic an fetch the topic ID (tid).
| int SharkMQ::createsub | ( | const char * | subtopic | ) |
Create a sub-topic and fetch the subtopic ID.
| void SharkMQ::disconnect | ( | ) |
Gracefully close the connection.
| int SharkMQ::getMessage | ( | U8 ** | msg | ) |
Wait for messages sent from the broker.
| int SharkMQ::getMsgSize | ( | ) |
Returns the message size, which is SMQ::frameLen - 15.
| int SharkMQ::init | ( | SharkSslCon * | scon, |
| const char * | url, | ||
| U32 * | rnd | ||
| ) |
Initiate the SMQ server connection.
| int SharkMQ::observe | ( | U32 | tid | ) |
Request the broker to provide change notification events when the number of subscribers to a specific topic changes.
Ephemeral topic IDs can also be observed.
| int SharkMQ::pubflush | ( | U32 | tid, |
| U32 | subtid | ||
| ) |
Flush the internal buffer and request the broker to assemble all stored fragments as one message.
| int SharkMQ::publish | ( | const void * | data, |
| int | len, | ||
| U32 | tid, | ||
| U32 | subtid | ||
| ) |
Publish messages to a topic and optionally to a sub-topic.
Topic name must have previosly been been resolved by SharkMQ_create and sub-topic should preferably have been created by SharkMQ_createsub.
| SharkMQ::SharkMQ | ( | U8 * | buf, |
| U16 | bufLen | ||
| ) |
Create a secure SMQ client instance.
| int SharkMQ::subscribe | ( | const char * | topic | ) |
The response to SharkMQ_subscribe is asynchronous and returned as status SMQ_SUBACK via SharkMQ_getMessage.
| int SharkMQ::unobserve | ( | U32 | tid | ) |
Stop receiving change notifications for a topic ID or ephemeral topic ID.
| int SharkMQ::unsubscribe | ( | U32 | tid | ) |
Requests the broker to unsubscribe the server from a topic.
| int SharkMQ::write | ( | const void * | data, |
| int | len | ||
| ) |
Publish a message in chunks and request the broker to assemble the message before publishing to the subscriber(s).
| int SharkMQ::wrtstr | ( | const char * | str | ) |
Publish a message in chunks and request the broker to assemble the message before publishing to the subscriber(s).
| SharkMQ::~SharkMQ | ( | ) |
Terminate an SMQ instance.