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

Macro Definition Documentation

◆ MQTT_THREAD_PRIORITY

#define MQTT_THREAD_PRIORITY   (THREAD_PRIORITY_MAIN - 1)

RIOT's mqtt paho thread priority.

Definition at line 34 of file paho_mqtt.h.

◆ MQTT_THREAD_STACKSIZE

#define MQTT_THREAD_STACKSIZE   (THREAD_STACKSIZE_LARGE)

RIOT's mqtt paho thread stack size.

Definition at line 42 of file paho_mqtt.h.

◆ MQTT_YIELD_POLLING_MS

#define MQTT_YIELD_POLLING_MS   (30)

MQTT thread YIELD polling time in msecs.

Definition at line 48 of file paho_mqtt.h.

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