2 * Copyright (c) 2017 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 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"
22 #define BLE_DISABLED "LeDisabled"
23 #define PROPERTIES_CHANGED "PropertiesChanged"
24 #define OTC_DISCONNECTED "OtcDisconnected"
26 #define BT_MANAGER_PATH "/"
27 #define BT_MANAGER_INTERFACE "org.freedesktop.DBus.ObjectManager"
28 #define BT_BLUEZ_NAME "org.bluez"
29 #define BT_DEVICE_INTERFACE "org.bluez.Device1"
31 #define BT_OTC_INTERFACE_NAME "org.projectx.otc_channel"
33 #define HEADED_PLUGIN_FILEPATH "/usr/lib/bt-plugin-headed.so"
34 #define HEADED_PLUGIN_FILEPATH64 "/usr/lib64/bt-plugin-headed.so"
35 #define FILEPATH_ARCH_64 "/usr/lib64"
37 #define BT_FILE_PATH_MAX_LEN 262
38 #define BT_L2CAP_BUFFER_LEN 672
40 #define BT_ADDRESS_STRING_SIZE 18
42 #define BT_OTP_BASE_DIR_PATH "/home/owner/media/otp/"
44 #define BT_OACP_MAX_TIMEOUT 10000 /* Timeout for OACP operation in msec */
46 /* OTP Service and Chanracteristics UUID */
47 #define OTP_UUID "1825"
48 #define OTP_FEATURE_UUID "2abd"
49 #define OTP_OBJECT_NAME_UUID "2abe"
50 #define OTP_OBJECT_TYPE_UUID "2abf"
51 #define OTP_OBJECT_SIZE_UUID "2ac0"
52 #define OTP_OBJECT_FIRST_CREATED_UUID "2ac1"
53 #define OTP_OBJECT_LAST_MODIFIED_UUID "2ac2"
54 #define OTP_OBJECT_ID_UUID "2ac3"
55 #define OTP_OBJECT_PROP_UUID "2ac4"
56 #define OTP_OACP_UUID "2ac5"
57 #define OTP_OLCP_UUID "2ac6"
58 #define OTP_OBJECT_LIST_FILTER_UUID "2ac7"
59 #define OTP_OBJECT_CHANGED_UUID "2ac8"
61 #define OTP_CP_CCC_DESC_UUID "2902"
64 #define WRITE_REQUEST_REJECTED 0X80
65 #define OBJECT_NOT_SELECTED 0X81
66 #define CONCURRENCY_LIMIT_EXCEEDED 0X82
67 #define OBJECT_NAME_ALREADY_EXISTS 0X83
69 /* OTP Object Type Custom UUIDs */
70 /* In SIG Assigned numbers not available */
71 #define UNSUPPORTED_OBJECT_TYPE_UUID "000019aa-0000-1001-8000-00805f9b34fb"
72 #define FIRMWARE_UUID "000019ab-0000-1001-8000-00805f9b34fb"
73 #define ROUTE_GPX_UUID "000019ac-0000-1001-8000-00805f9b34fb"
74 #define TRACK_GPX_UUID "000019ad-0000-1001-8000-00805f9b34fb"
76 /* Object Metadata Length */
77 #define OTP_FEATURE_LENGTH 8
79 /* Object ID range defined by SIG. */
80 #define OBJECT_START_ID 256
81 #define OBJECT_END_ID 281474976710655
83 /* Object Properties */
84 #define OBJECT_DELETE 0x00000001
85 #define OBJECT_EXECUTE 0x00000002
86 #define OBJECT_READ 0x00000004
87 #define OBJECT_WRITE 0x00000008
88 #define OBJECT_APPEND 0x00000010
89 #define OBJECT_TRUNCATE 0x00000020
90 #define OBJECT_PATCH 0x00000040
91 #define OBJECT_MARK 0x00000080
94 #define OACP_CREATE 0x01
95 #define OACP_DELETE 0x02
96 #define OACP_CALC_CHECKSUM 0x03
97 #define OACP_EXECUTE 0x04
98 #define OACP_READ 0x05
99 #define OACP_WRITE 0x06
100 #define OACP_ABORT 0x07
101 #define OACP_RESPONSE 0x60
103 /* OACP error codes */
104 #define OACP_SUCCESS 0x01
105 #define OACP_OPCODE_NOT_SUPPORTED 0x02
106 #define OACP_INVALID_PARAM 0x03
107 #define OACP_INSUFFICIENT_RESOURCES 0x04
108 #define OACP_INVALID_OBJ 0x05
109 #define OACP_CHANNEL_UNAVAILABLE 0x06
110 #define OACP_UNSUPPORTED_TYPE 0x07
111 #define OACP_PROCEDURE_NOT_SUPPORTED 0x08
112 #define OACP_OBJECT_LOCKED 0x09
113 #define OACP_OPERATION_FAILED 0x0A
116 #define OLCP_FIRST 0x01
117 #define OLCP_LAST 0x02
118 #define OLCP_PREVIOUS 0x03
119 #define OLCP_NEXT 0x04
120 #define OLCP_GOTO 0x05
121 #define OLCP_ORDER 0x06
122 #define OLCP_REQ_NO_OBJ 0x07
123 #define OLCP_CLEAR_MARKING 0x08
124 #define OLCP_RESPONSE 0x70
126 /* OLCP order param values */
127 #define ORDER_BY_NAME_ASCENDING 0x01
128 #define ORDER_BY_TYPE_ASCENDING 0x02
129 #define ORDER_BY_CURR_SIZE_ASCENDING 0x03
130 #define ORDER_BY_FIRST_CREATED_ASCENDING 0x04
131 #define ORDER_BY_LAST_MODIFIED_ASCENDING 0x05
132 #define ORDER_BY_NAME_DESCENDING 0x11
133 #define ORDER_BY_TYPE_DESCENDING 0x12
134 #define ORDER_BY_CURR_SIZE_DESCENDING 0x13
135 #define ORDER_BY_FIRST_CREATED_DESCENDING 0x14
136 #define ORDER_BY_LAST_MODIFIED_DESCENDING 0x15
138 /* OLCP error codes */
139 #define OLCP_SUCCESS 0x01
140 #define OLCP_OPCODE_NOT_SUPPORTED 0x02
141 #define OLCP_INVALID_PARAM 0x03
142 #define OLCP_OPERATION_FAILED 0x04
143 #define OLCP_OUT_OF_BOUNDS 0x05
144 #define OLCP_TOO_MANY_OBJ 0x06
145 #define OLCP_NO_OBJ 0x07
146 #define OLCP_OJECT_ID_NOT_FOUND 0x08