source: azure_iot_hub/trunk/azure_iohub/umqtt/inc/azure_umqtt_c/mqtt_message.h@ 388

Last change on this file since 388 was 388, checked in by coas-nagasima, 5 years ago

Azure IoT Hub Device C SDK を使ったサンプルの追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 2.3 KB
Line 
1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#ifndef MQTT_MESSAGE_H
5#define MQTT_MESSAGE_H
6
7#include "azure_umqtt_c/mqttconst.h"
8#include "azure_c_shared_utility/umock_c_prod.h"
9
10#ifdef __cplusplus
11#include <cstdint>
12#include <cstddef>
13extern "C" {
14#else
15#include <stdint.h>
16#include <stdbool.h>
17#include <stddef.h>
18#endif // __cplusplus
19
20typedef struct MQTT_MESSAGE_TAG* MQTT_MESSAGE_HANDLE;
21
22MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create_in_place, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
23MOCKABLE_FUNCTION(, MQTT_MESSAGE_HANDLE, mqttmessage_create, uint16_t, packetId, const char*, topicName, QOS_VALUE, qosValue, const uint8_t*, appMsg, size_t, appMsgLength);
24MOCKABLE_FUNCTION(,void, mqttmessage_destroy, MQTT_MESSAGE_HANDLE, handle);
25MOCKABLE_FUNCTION(,MQTT_MESSAGE_HANDLE, mqttmessage_clone, MQTT_MESSAGE_HANDLE, handle);
26
27MOCKABLE_FUNCTION(, uint16_t, mqttmessage_getPacketId, MQTT_MESSAGE_HANDLE, handle);
28MOCKABLE_FUNCTION(, const char*, mqttmessage_getTopicName, MQTT_MESSAGE_HANDLE, handle);
29
30/*
31* @brief Gets the individual names of the MQTT topic levels, in the original order.
32* @param handle Handle to the MQTT message.
33* @param levels Pointer the variable where to store the level names.
34* @param count Number of levels in the topic name.
35* @return return Zero if no failures occur, or non-zero otherwise.
36*/
37MOCKABLE_FUNCTION(, int, mqttmessage_getTopicLevels, MQTT_MESSAGE_HANDLE, handle, char***, levels, size_t*, count);
38
39MOCKABLE_FUNCTION(, QOS_VALUE, mqttmessage_getQosType, MQTT_MESSAGE_HANDLE, handle);
40MOCKABLE_FUNCTION(, bool, mqttmessage_getIsDuplicateMsg, MQTT_MESSAGE_HANDLE, handle);
41MOCKABLE_FUNCTION(, bool, mqttmessage_getIsRetained, MQTT_MESSAGE_HANDLE, handle);
42MOCKABLE_FUNCTION(, int, mqttmessage_setIsDuplicateMsg, MQTT_MESSAGE_HANDLE, handle, bool, duplicateMsg);
43MOCKABLE_FUNCTION(, int, mqttmessage_setIsRetained, MQTT_MESSAGE_HANDLE, handle, bool, retainMsg);
44MOCKABLE_FUNCTION(, const APP_PAYLOAD*, mqttmessage_getApplicationMsg, MQTT_MESSAGE_HANDLE, handle);
45
46#ifdef __cplusplus
47}
48#endif // __cplusplus
49
50#endif // MQTT_MESSAGE_H
Note: See TracBrowser for help on using the repository browser.