Low level MQTTSN packet library, part of the Eclipse Paho project: http://eclipse.org/paho

Dependents:   MQTTSN sara-n200-hello-mqtt-sn MQTTSN_2

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MQTTSNPublish.h Source File

MQTTSNPublish.h

00001 /*******************************************************************************
00002  * Copyright (c) 2014 IBM Corp.
00003  *
00004  * All rights reserved. This program and the accompanying materials
00005  * are made available under the terms of the Eclipse Public License v1.0
00006  * and Eclipse Distribution License v1.0 which accompany this distribution.
00007  *
00008  * The Eclipse Public License is available at
00009  *    http://www.eclipse.org/legal/epl-v10.html
00010  * and the Eclipse Distribution License is available at
00011  *   http://www.eclipse.org/org/documents/edl-v10.php.
00012  *
00013  * Contributors:
00014  *    Ian Craggs - initial API and implementation and/or initial documentation
00015  *******************************************************************************/
00016 
00017 #if !defined(MQTTSNPUBLISH_H_)
00018 #define MQTTSNPUBLISH_H_
00019 
00020 int MQTTSNSerialize_publish(unsigned char* buf, int buflen, unsigned char dup, int qos, unsigned char retained, unsigned short packetid,
00021         MQTTSN_topicid topic, unsigned char* payload, int payloadlen);
00022 int MQTTSNDeserialize_publish(unsigned char* dup, int* qos, unsigned char* retained, unsigned short* packetid,
00023         MQTTSN_topicid* topic, unsigned char** payload, int* payloadlen, unsigned char* buf, int len);
00024 
00025 int MQTTSNSerialize_puback(unsigned char* buf, int buflen, unsigned short topicid, unsigned short packetid,
00026         unsigned char returncode);
00027 int MQTTSNDeserialize_puback(unsigned short* topicid, unsigned short* packetid,
00028         unsigned char* returncode, unsigned char* buf, int buflen);
00029 
00030 int MQTTSNSerialize_pubrec(unsigned char* buf, int buflen, unsigned short packetid);
00031 int MQTTSNSerialize_pubrel(unsigned char* buf, int buflen, unsigned short packetid);
00032 int MQTTSNSerialize_pubcomp(unsigned char* buf, int buflen, unsigned short packetid);
00033 
00034 int MQTTSNDeserialize_ack(unsigned char* packettype, unsigned short* packetid, unsigned char* buf, int buflen);
00035 
00036 int MQTTSNSerialize_register(unsigned char* buf, int buflen, unsigned short topicid, unsigned short packetid,
00037         MQTTSNString* topicname);
00038 int MQTTSNDeserialize_register(unsigned short* topicid, unsigned short* packetid, MQTTSNString* topicname,
00039         unsigned char* buf, int buflen);
00040 
00041 int MQTTSNSerialize_regack(unsigned char* buf, int buflen, unsigned short topicid, unsigned short packetid,
00042         unsigned char return_code);
00043 int MQTTSNDeserialize_regack(unsigned short* topicid, unsigned short* packetid, unsigned char* return_code,
00044         unsigned char* buf, int buflen);
00045 
00046 #endif /* MQTTSNPUBLISH_H_ */
00047