2 * Copyright (c) 2021-2022 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #define API __attribute__((visibility("default")))
20 typedef void* AittSubscribeID;
23 AITT_TYPE_UNKNOWN = 0,
24 AITT_TYPE_MQTT = (0x1 << 0), // Publish message through the MQTT
25 AITT_TYPE_TCP = (0x1 << 1), // Publish message to peers using the TCP
26 AITT_TYPE_WEBRTC = (0x1 << 2), // Publish message to peers using the WEBRTC
29 // AittQoS only works with the AITT_TYPE_MQTT
31 AITT_QOS_AT_MOST_ONCE = 0, // Fire and forget
32 AITT_QOS_AT_LEAST_ONCE = 1, // Receiver is able to receive multiple times
33 AITT_QOS_EXACTLY_ONCE = 2, // Receiver only receives exactly once
36 enum AittConnectionState {
37 AITT_DISCONNECTED = 0, // The connection is disconnected.
38 AITT_CONNECTED = 1, // A connection was successfully established to the mqtt broker.
43 #define TIZEN_ERROR_AITT -0x04020000
47 #define TIZEN_ERROR_NONE 0
48 #define TIZEN_ERROR_INVALID_PARAMETER -EINVAL
49 #define TIZEN_ERROR_PERMISSION_DENIED -EACCES
50 #define TIZEN_ERROR_OUT_OF_MEMORY -ENOMEM
51 #define TIZEN_ERROR_TIMED_OUT (-1073741824LL + 1)
52 #define TIZEN_ERROR_NOT_SUPPORTED (-1073741824LL + 2)
53 #define TIZEN_ERROR_AITT -0x04020000
57 AITT_ERROR_NONE = TIZEN_ERROR_NONE, /**< On Success */
58 AITT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
59 AITT_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
60 AITT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
61 AITT_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Time out */
62 AITT_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
63 AITT_ERROR_UNKNOWN = TIZEN_ERROR_AITT | 0x01, /**< Unknown Error */
64 AITT_ERROR_SYSTEM = TIZEN_ERROR_AITT | 0x02, /**< System errors */
65 AITT_ERROR_NOT_READY = TIZEN_ERROR_AITT | 0x03, /**< System errors */