498419faac83adc2d8c46a82ff54a3347c80911d
[platform/core/connectivity/bluetooth-frwk.git] / bt-otp / bt-otpserver.h
1 /*
2  * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *              http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 #define BT_OTP_SERVICE_NAME     "org.projectx.otp"
19 #define BT_OTP_OBJECT_PATH      "/org/projectx/otp"
20 #define BT_OTP_INTERFACE_NAME   "org.projectx.otp_service"
21
22 #define BLE_DISABLED            "LeDisabled"
23 #define PROPERTIES_CHANGED      "PropertiesChanged"
24
25 #define BT_BLUEZ_NAME "org.bluez"
26
27 #define BT_ADDRESS_STRING_SIZE 18
28
29 /* OTP Service and Chanracteristics UUID */
30 #define OTP_UUID                        "1825"
31 #define OTP_FEATURE_UUID                "2abd"
32 #define OTP_OBJECT_NAME_UUID            "2abe"
33 #define OTP_OBJECT_TYPE_UUID            "2abf"
34 #define OTP_OBJECT_SIZE_UUID            "2ac0"
35 #define OTP_OBJECT_FIRST_CREATED_UUID   "2ac1"
36 #define OTP_OBJECT_LAST_MODIFIED_UUID   "2ac2"
37 #define OTP_OBJECT_ID_UUID              "2ac3"
38 #define OTP_OBJECT_PROP_UUID            "2ac4"
39 #define OTP_OACP_UUID                   "2ac5"
40 #define OTP_OLCP_UUID                   "2ac6"
41 #define OTP_OBJECT_LIST_FILTER_UUID     "2ac7"
42 #define OTP_OBJECT_CHANGED_UUID         "2ac8"
43
44 #define OTP_CP_CCC_DESC_UUID            "2902"
45
46 /* OTP Error codes */
47 #define WRITE_REQUEST_REJECTED          0X80
48 #define OBJECT_NOT_SELECTED             0X81
49 #define CONCURRENCY_LIMIT_EXCEEDED      0X82
50 #define OBJECT_NAME_ALREADY_EXISTS      0X83
51
52 /* OTP Object Type Custom UUIDs */
53 /* In SIG Assigned numbers not available */
54 #define UNSUPPORTED_OBJECT_TYPE_UUID    "000019aa-0000-1001-8000-00805f9b34fb"
55 #define FIRMWARE_UUID                   "000019ab-0000-1001-8000-00805f9b34fb"
56 #define ROUTE_GPX_UUID                  "000019ac-0000-1001-8000-00805f9b34fb"
57 #define TRACK_GPX_UUID                  "000019ad-0000-1001-8000-00805f9b34fb"
58
59 /* Object Metadata Length */
60 #define OTP_FEATURE_LENGTH              8
61 #define ABSOLUTE_PATH_MAX_LENGTH        200
62
63 /* Object ID range defined by SIG. */
64 #define OBJECT_START_ID 256
65 #define OBJECT_END_ID   281474976710655
66
67 /* Object Properties */
68 #define OBJECT_DELETE   0x00000001
69 #define OBJECT_EXECUTE  0x00000002
70 #define OBJECT_READ     0x00000004
71 #define OBJECT_WRITE    0x00000008
72 #define OBJECT_APPEND   0x00000010
73 #define OBJECT_TRUNCATE 0x00000020
74 #define OBJECT_PATCH    0x00000040
75 #define OBJECT_MARK     0x00000080
76
77 /* OACP opcodes */
78 #define OACP_CREATE             0x01
79 #define OACP_DELETE             0x02
80 #define OACP_CALC_CHECKSUM      0x03
81 #define OACP_EXECUTE            0x04
82 #define OACP_READ               0x05
83 #define OACP_WRITE              0x06
84 #define OACP_ABORT              0x07
85 #define OACP_RESPONSE           0x60
86
87 /* OACP error codes */
88 #define OACP_SUCCESS                    0x01
89 #define OACP_OPCODE_NOT_SUPPORTED       0x02
90 #define OACP_INVALID_PARAM              0x03
91 #define OACP_INSUFFICIENT_RESOURCES     0x04
92 #define OACP_INVALID_OBJ                0x05
93 #define OACP_CHANNEL_UNAVAILABLE        0x06
94 #define OACP_UNSUPPORTED_TYPE           0x07
95 #define OACP_PROCEDURE_NOT_SUPPORTED    0x08
96 #define OACP_OBJECT_LOCKED              0x09
97 #define OACP_OPERATION_FAILED           0x0A
98
99 /* OLCP opcodes */
100 #define OLCP_FIRST              0x01
101 #define OLCP_LAST               0x02
102 #define OLCP_PREVIOUS           0x03
103 #define OLCP_NEXT               0x04
104 #define OLCP_GOTO               0x05
105 #define OLCP_ORDER              0x06
106 #define OLCP_REQ_NO_OBJ         0x07
107 #define OLCP_CLEAR_MARKING      0x08
108 #define OLCP_RESPONSE           0x70
109
110 /* OLCP order param values */
111 #define ORDER_BY_NAME_ASCENDING                 0x01
112 #define ORDER_BY_TYPE_ASCENDING                 0x02
113 #define ORDER_BY_CURR_SIZE_ASCENDING            0x03
114 #define ORDER_BY_FIRST_CREATED_ASCENDING        0x04
115 #define ORDER_BY_LAST_MODIFIED_ASCENDING        0x05
116 #define ORDER_BY_NAME_DESCENDING                0x11
117 #define ORDER_BY_TYPE_DESCENDING                0x12
118 #define ORDER_BY_CURR_SIZE_DESCENDING           0x13
119 #define ORDER_BY_FIRST_CREATED_DESCENDING       0x14
120 #define ORDER_BY_LAST_MODIFIED_DESCENDING       0x15
121
122 /* OLCP error codes */
123 #define OLCP_SUCCESS                    0x01
124 #define OLCP_OPCODE_NOT_SUPPORTED       0x02
125 #define OLCP_INVALID_PARAM              0x03
126 #define OLCP_OPERATION_FAILED           0x04
127 #define OLCP_OUT_OF_BOUNDS              0x05
128 #define OLCP_TOO_MANY_OBJ               0x06
129 #define OLCP_NO_OBJ                     0x07
130 #define OLCP_OJECT_ID_NOT_FOUND         0x08