Jack Hansdampf / mbed-mqtt-GSOE1

Dependents:   ESP8266MQTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MQTTSerializePublish_stub.cpp Source File

MQTTSerializePublish_stub.cpp

00001 /*
00002  * Copyright (c) 2019, Arm Limited and affiliates
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #include "MQTTPacket.h"
00019 
00020 int MQTTSerialize_publishLength(int qos, MQTTString topicName, int payloadlen)
00021 {
00022     return payloadlen;
00023 }
00024 
00025 int MQTTSerialize_publish(unsigned char* buf, int buflen, unsigned char dup, int qos, unsigned char retained, unsigned short packetid,
00026         MQTTString topicName, unsigned char* payload, int payloadlen)
00027 {
00028     return payloadlen;
00029 }
00030 
00031 int MQTTSerialize_ack(unsigned char* buf, int buflen, unsigned char packettype, unsigned char dup, unsigned short packetid)
00032 {
00033     return buflen;
00034 }
00035 
00036 int MQTTSerialize_puback(unsigned char* buf, int buflen, unsigned short packetid)
00037 {
00038     return MQTTSerialize_ack(buf, buflen, PUBACK, 0, packetid);
00039 }
00040 
00041 int MQTTSerialize_pubrel(unsigned char* buf, int buflen, unsigned char dup, unsigned short packetid)
00042 {
00043     return MQTTSerialize_ack(buf, buflen, PUBREL, dup, packetid);
00044 }
00045 
00046 int MQTTSerialize_pubcomp(unsigned char* buf, int buflen, unsigned short packetid)
00047 {
00048     return MQTTSerialize_ack(buf, buflen, PUBCOMP, 0, packetid);
00049 }
00050 
00051