An API for using MQTT over multiple transports

Dependencies:   FP MQTTPacket

Dependents:   Cellular_HelloMQTT IoTStarterKit GSwifiInterface_HelloMQTT IBMIoTClientEthernetExample ... more

This library is part of the EclipseTM Paho project; specifically the embedded client.

The goals of this API are:

  1. to be independent of any system library: hence templates parameters for networking, timer and threading classes
  2. not to rely on heap storage, only automatic (I think this is a good thing)
  3. to limit memory use, for instance by defining the size of the buffers and arrays used at object creation time
Committer:
Ian Craggs
Date:
Fri Apr 11 22:31:55 2014 +0100
Revision:
12:cc7f2d62a393
Parent:
9:01b8cc7d94cc
Child:
13:fd82db992024
Unsubscribe, publish

Who changed what in which revision?

UserRevisionLine numberNew contents of line
icraggs 6:4d312a49200b 1 /*******************************************************************************
icraggs 6:4d312a49200b 2 * Copyright (c) 2014 IBM Corp.
sam_grove 0:fe461e4d7afe 3 *
icraggs 6:4d312a49200b 4 * All rights reserved. This program and the accompanying materials
icraggs 6:4d312a49200b 5 * are made available under the terms of the Eclipse Public License v1.0
icraggs 6:4d312a49200b 6 * and Eclipse Distribution License v1.0 which accompany this distribution.
sam_grove 0:fe461e4d7afe 7 *
icraggs 6:4d312a49200b 8 * The Eclipse Public License is available at
icraggs 6:4d312a49200b 9 * http://www.eclipse.org/legal/epl-v10.html
icraggs 6:4d312a49200b 10 * and the Eclipse Distribution License is available at
icraggs 6:4d312a49200b 11 * http://www.eclipse.org/org/documents/edl-v10.php.
sam_grove 0:fe461e4d7afe 12 *
icraggs 6:4d312a49200b 13 * Contributors:
icraggs 6:4d312a49200b 14 * Ian Craggs - initial API and implementation and/or initial documentation
icraggs 6:4d312a49200b 15 *******************************************************************************/
sam_grove 0:fe461e4d7afe 16
icraggs 2:dcfdd2abfe71 17 #include "MQTTClient.h"
icraggs 2:dcfdd2abfe71 18 #include "MQTTPacket.h"
icraggs 2:dcfdd2abfe71 19
icraggs 9:01b8cc7d94cc 20 MQTT::PacketId::PacketId()
icraggs 9:01b8cc7d94cc 21 {
icraggs 9:01b8cc7d94cc 22 next = 0;
icraggs 9:01b8cc7d94cc 23 }
icraggs 9:01b8cc7d94cc 24
icraggs 9:01b8cc7d94cc 25 int MQTT::PacketId::getNext()
icraggs 9:01b8cc7d94cc 26 {
icraggs 9:01b8cc7d94cc 27 return next = (next == MAX_PACKET_ID) ? 1 : ++next;
Ian Craggs 12:cc7f2d62a393 28 }
Ian Craggs 12:cc7f2d62a393 29