SharkSSL™ Embedded SSL/TLS Stack
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

A secure SimpleMQ client designed for SharkSSL. More...

Modules

 Error 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 SimpleMQ 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)
 Connect/establish a persistent SimpleMQ connection. More...
 
void SharkMQ::disconnect ()
 Gracefully close the connection. More...
 
 SharkMQ::~SharkMQ ()
 Terminate a SimpleMQ 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...
 

Detailed Description

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.

Function Documentation

int SharkMQ::connect ( const char *  uid,
int  uidLen,
const char *  credentials,
U8  credLen,
const char *  info,
int  infoLen 
)

Connect/establish a persistent SimpleMQ connection.

See also
SharkMQ_connect
int SharkMQ::create ( const char *  topic)

Create a topic an fetch the topic ID (tid).

See also
SharkMQ_create
int SharkMQ::createsub ( const char *  subtopic)

Create a sub-topic and fetch the subtopic ID.

See also
SMQ:createsub
void SharkMQ::disconnect ( )

Gracefully close the connection.

See also
SharkMQ_disconnect
int SharkMQ::getMessage ( U8 **  msg)

Wait for messages sent from the broker.

See also
SharkMQ_getMessage
int SharkMQ::getMsgSize ( )

Returns the message size, which is SMQ::frameLen - 15.

See also
SharkMQ_getMsgSize
int SharkMQ::init ( SharkSslCon scon,
const char *  url,
U32 *  rnd 
)

Initiate the SMQ server connection.

See also
SharkMQ_init
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.

See also
SharkMQ_observe
int SharkMQ::pubflush ( U32  tid,
U32  subtid 
)

Flush the internal buffer and request the broker to assemble all stored fragments as one message.

See also
SharkMQ_pubflush
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.

See also
SharkMQ_publish
SharkMQ::SharkMQ ( U8 *  buf,
U16  bufLen 
)

Create a SimpleMQ client instance.

See also
SharkMQ_constructor
int SharkMQ::subscribe ( const char *  topic)

The response to SharkMQ_subscribe is asynchronous and returned as status SMQ_SUBACK via SharkMQ_getMessage.

See also
SharkMQ_subscribe
int SharkMQ::unobserve ( U32  tid)

Stop receiving change notifications for a topic ID or ephemeral topic ID.

See also
SharkMQ_unobserve
int SharkMQ::unsubscribe ( U32  tid)

Requests the broker to unsubscribe the server from a topic.

See also
SharkMQ_unsubscribe
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).

See also
SharkMQ_write
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).

See also
SharkMQ_wrtstr
SharkMQ::~SharkMQ ( )

Terminate a SimpleMQ instance.

See also
SharkMQ_destructor