1 /*******************************************************************************
2  * Copyright (c) 2014 IBM Corp.
3  *
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * and Eclipse Distribution License v1.0 which accompany this distribution.
7  *
8  * The Eclipse Public License is available at
9  *    http://www.eclipse.org/legal/epl-v10.html
10  * and the Eclipse Distribution License is available at
11  *   http://www.eclipse.org/org/documents/edl-v10.php.
12  *
13  * Contributors:
14  *    Ian Craggs - initial API and implementation and/or initial documentation
15  *    Xiang Rong - 442039 Add makefile to Embedded C client
16  *******************************************************************************/
17 
18 #ifndef MQTTPUBLISH_H_
19 #define MQTTPUBLISH_H_
20 
21 #if !defined(DLLImport)
22 #define DLLImport
23 #endif
24 #if !defined(DLLExport)
25 #define DLLExport
26 #endif
27 
28 DLLExport int MQTTSerialize_publish(unsigned char *buf, int buflen,
29                                     unsigned char dup, int qos,
30                                     unsigned char retained,
31                                     unsigned short packetid,
32                                     MQTTString topicName,
33                                     unsigned char *payload, int payloadlen);
34 
35 DLLExport int MQTTDeserialize_publish(unsigned char *dup, int *qos,
36                                       unsigned char *retained,
37                                       unsigned short *packetid,
38                                       MQTTString *topicName,
39                                       unsigned char **payload, int *payloadlen,
40                                       unsigned char *buf, int len);
41 
42 /*  DLLExport int MQTTSerialize_puback(unsigned char* buf, int buflen, unsigned
43  * short packetid); */
44 DLLExport int MQTTSerialize_pubrel(unsigned char *buf, int buflen,
45                                    unsigned char dup, unsigned short packetid);
46 DLLExport int MQTTSerialize_pubcomp(unsigned char *buf, int buflen,
47                                     unsigned short packetid);
48 
49 #endif /* MQTTPUBLISH_H_ */
50