PAHO MQTT framework

The Eclipse Paho project provides open-source client implementations of MQTT for embedded systems. More...

Detailed Description

The Eclipse Paho project provides open-source client implementations of MQTT for embedded systems.

See also
https://github.com/eclipse/paho.mqtt.embedded-c

The Eclipse Paho project provides open-source client implementations of MQTT.

Files

file  paho_mqtt.h
 Network MQTT interface definitions.
 

Data Structures

struct  Timer
 struct to get time references within mqtt paho More...
 
struct  Network
 Network struct within mqtt paho. More...
 
struct  Mutex
 Mutex struct within mqtt paho. More...
 
struct  Thread
 Thread struct within mqtt paho. More...
 

Macros

#define MQTT_THREAD_PRIORITY   (THREAD_PRIORITY_MAIN - 1)
 RIOT's mqtt paho thread priority.
 
#define MQTT_THREAD_STACKSIZE   (THREAD_STACKSIZE_LARGE)
 RIOT's mqtt paho thread stack size.
 
#define MQTT_YIELD_POLLING_MS   (30)
 MQTT thread YIELD polling time in msecs.
 

Typedefs

typedef struct Network Network
 Network struct within mqtt paho.
 

Functions

void TimerInit (Timer *timer)
 Initialize timer struct. More...
 
char TimerIsExpired (Timer *timer)
 is timer expired? More...
 
void TimerCountdownMS (Timer *timer, unsigned int msecs)
 start timer set to milli seconds More...
 
void TimerCountdown (Timer *timer, unsigned int secs)
 start timer set to seconds More...
 
int TimerLeftMS (Timer *timer)
 Returns millisecs left in timer. More...
 
void NetworkInit (Network *n)
 Initialize network struct. More...
 
int NetworkConnect (Network *n, char *address_ip, int port_number)
 Connect network to host. More...
 
void NetworkDisconnect (Network *n)
 Disconnect network. More...
 
void MutexInit (Mutex *mutex)
 Initialize mutex struct. More...
 
int MutexLock (Mutex *mutex)
 Locks mutex struct. More...
 
int MutexUnlock (Mutex *mutex)
 Unlocks mutex struct. More...
 
int ThreadStart (Thread *thread, void(*fn)(void *), void *arg)
 Start new thread. More...
 

Function Documentation

◆ MutexInit()

void MutexInit ( Mutex mutex)

Initialize mutex struct.

Parameters
mutexpointer

◆ MutexLock()

int MutexLock ( Mutex mutex)

Locks mutex struct.

Parameters
mutexpointer
Returns
0 if success, !=0 otherwise

◆ MutexUnlock()

int MutexUnlock ( Mutex mutex)

Unlocks mutex struct.

Parameters
mutexpointer
Returns
0 if success, !=0 otherwise

◆ NetworkConnect()

int NetworkConnect ( Network n,
char *  address_ip,
int  port_number 
)

Connect network to host.

Parameters
nnetwork struct
address_ipIP address to connect to
port_numberport to connect to
Returns
0 if success, !=0 otherwise

◆ NetworkDisconnect()

void NetworkDisconnect ( Network n)

Disconnect network.

Parameters
nnetwork struct

◆ NetworkInit()

void NetworkInit ( Network n)

Initialize network struct.

Parameters
nnetwork struct

◆ ThreadStart()

int ThreadStart ( Thread thread,
void(*)(void *)  fn,
void *  arg 
)

Start new thread.

Parameters
threadto start
fnpointer function to execute
argarguments to pass to that fn
Returns
0 if success, !=0 otherwise

◆ TimerCountdown()

void TimerCountdown ( Timer timer,
unsigned int  secs 
)

start timer set to seconds

Parameters
timertimer to start
secstime to set in secs

◆ TimerCountdownMS()

void TimerCountdownMS ( Timer timer,
unsigned int  msecs 
)

start timer set to milli seconds

Parameters
timertimer to start
msecstime to set in msecs

◆ TimerInit()

void TimerInit ( Timer timer)

Initialize timer struct.

Parameters
timertimer to init

◆ TimerIsExpired()

char TimerIsExpired ( Timer timer)

is timer expired?

Parameters
timertimer to check
Returns
1 if timer expired, 0 otherwise

◆ TimerLeftMS()

int TimerLeftMS ( Timer timer)

Returns millisecs left in timer.

Parameters
timertimer to check
Returns
msecs left