2 * Bluetooth-httpproxy-service
4 * Copyright (c) 2015 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: C S Bhargava <cs.bhargava@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __BT_HTTPPROXY_H__
23 #define __BT_HTTPPROXY_H__
27 #define BT_HPS_LE_ADAPTER_INTERFACE "org.bluez.Adapter1"
28 #define BT_HPS_LE_ADAPTER_PATH "/org/projectx/bt/le/adapter"
30 #define BT_HPS_SERVICE_NAME "org.projectx.httpproxy"
31 #define BT_HPS_OBJECT_PATH "/org/projectx/httpproxy"
32 #define BT_HPS_INTERFACE_NAME "org.projectx.httpproxy_service"
34 #define BT_HPS_CHAR_INTERFACE "org.bluez.GattCharacteristic1"
35 #define BT_HPS_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
37 #define BLE_ENABLED "LeEnabled"
38 #define BLE_DISABLED "LeDisabled"
39 #define PROPERTIES_CHANGED "PropertiesChanged"
41 /* 512 is the max uri supported by http spec */
42 #define MAX_URI_LENGTH 512
43 /* 512 is the max Header length supported by http spec */
44 #define MAX_HEADER_LENGTH 512
45 /* 512 is the max entity body length supported by http spec */
46 #define MAX_ENTITY_LENGTH 512
49 /* HTTP Control Point Commands
50 OPTIONS, TRACE, CONNECT are not supported
53 HTTP_REQUEST_NONE = 0x00,
54 HTTP_GET_REQUEST = 0x01,
55 HTTP_HEAD_REQUEST = 0x02,
56 HTTP_POST_REQUEST = 0x03,
57 HTTP_PUT_REQUEST = 0x04,
58 HTTP_DELETE_REQUEST = 0x05,
59 HTTPS_GET_REQUEST = 0x06,
60 HTTPS_HEAD_REQUEST = 0x07,
61 HTTPS_POST_REQUEST = 0x08,
62 HTTPS_PUT_REQUEST = 0x09,
63 HTTPS_DELETE_REQUEST = 0x0A,
64 HTTP_REQUEST_CANCEL = 0x0B,
65 HTTP_REQUEST_MAX = HTTP_REQUEST_CANCEL
70 DS_HEADER_RECEIVED = 0x01,
71 DS_HEADER_TRUNCATED = 0x02,
72 DS_BODY_RECEIVED = 0x03,
73 DS_BODY_TRUNCATED = 0x04,
74 DS_MAX = DS_BODY_TRUNCATED
77 typedef enum http_request_state_tag {
78 HTTP_REQ_STATE_IDLE = 0x00,
79 HTTP_REQ_STATE_EXECUTED = HTTP_REQ_STATE_IDLE,
80 HTTP_REQ_STATE_INPROGRESS = 0x01,
84 // Temporary UUIDs. SIG has to define the UUIDs yet.
85 #define HPS_UUID "00001900-0000-1000-8000-00805f9b34fb"
86 #define HTTP_URI_UUID "00001901-0000-1000-8000-00805f9b34fb"
87 #define HTTP_HDR_UUID "00001902-0000-1000-8000-00805f9b34fb"
88 #define HTTP_ENTITY_UUID "00001903-0000-1000-8000-00805f9b34fb"
89 #define HTTP_CP_UUID "00001904-0000-1000-8000-00805f9b34fb"
90 #define HTTP_STATUS_UUID "00001905-0000-1000-8000-00805f9b34fb"
91 /* CCC descriptor UUID is predefined by SIG */
92 #define HTTP_STATUS_CCC_DESC_UUID "2902"
93 #define HTTP_SECURITY_UUID "00001906-0000-1000-8000-00805f9b34fb"
95 void _bt_hps_exit(void);
96 int _bt_hps_prepare_httpproxy(void);
97 int _bt_hps_set_advertising_data(void);