LwIP MQTT client library

Working prototype of MQTT client lib

Similar projects worth following
  • Description
  • Details
  • Files 0
  • Components 0
  • Logs 0
  • Instructions 0
  • Discussion 0
Some time ago I needed simple plain C MQTT library for my TIVA LM3S6965 board (former Stellaris, former LuminaryMicro). I started rewriting library from Fan Yilun who written nice C++ library for MBed.

So I've created simple library on top of lwIP TCP stack. I've added some cleaning when you disconnect, also periodic keep-alive messages are handled "in background". You can also register your callback routine.

mqtt.c API:

void mqttInit(Mqtt *mqtt, struct ip_addr serverIp, int port, msgReceived fn, char *devId);
uint8_t mqttConnect(Mqtt *this);
uint8_t mqttPublish(Mqtt *this,char* pub_topic, char* msg);
uint8_t mqttDisconnect(Mqtt *this);
uint8_t mqttSubscribe(Mqtt *this, char* topic);
uint8_t mqttLive(Mqtt *this);
void mqttDisconnectForced(Mqtt *this);

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates