2 * Copyright (c) 2015 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 #ifndef __BT_HTTPPROXY_H__
19 #define __BT_HTTPPROXY_H__
23 #define BT_HPS_LE_ADAPTER_INTERFACE "org.bluez.Adapter1"
24 #define BT_HPS_LE_ADAPTER_PATH "/org/projectx/bt/le/adapter"
26 #define BT_HPS_SERVICE_NAME "org.projectx.httpproxy"
27 #define BT_HPS_OBJECT_PATH "/org/projectx/httpproxy"
28 #define BT_HPS_INTERFACE_NAME "org.projectx.httpproxy_service"
30 #define BT_HPS_CHAR_INTERFACE "org.bluez.GattCharacteristic1"
31 #define BT_HPS_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
33 #define BLE_ENABLED "LeEnabled"
34 #define BLE_DISABLED "LeDisabled"
35 #define PROPERTIES_CHANGED "PropertiesChanged"
37 /* 512 is the max uri supported by http spec */
38 #define MAX_URI_LENGTH 512
39 /* 512 is the max Header length supported by http spec */
40 #define MAX_HEADER_LENGTH 512
41 /* 512 is the max entity body length supported by http spec */
42 #define MAX_ENTITY_LENGTH 512
45 /* HTTP Control Point Commands
46 OPTIONS, TRACE, CONNECT are not supported
49 HTTP_REQUEST_NONE = 0x00,
50 HTTP_GET_REQUEST = 0x01,
51 HTTP_HEAD_REQUEST = 0x02,
52 HTTP_POST_REQUEST = 0x03,
53 HTTP_PUT_REQUEST = 0x04,
54 HTTP_DELETE_REQUEST = 0x05,
55 HTTPS_GET_REQUEST = 0x06,
56 HTTPS_HEAD_REQUEST = 0x07,
57 HTTPS_POST_REQUEST = 0x08,
58 HTTPS_PUT_REQUEST = 0x09,
59 HTTPS_DELETE_REQUEST = 0x0A,
60 HTTP_REQUEST_CANCEL = 0x0B,
61 HTTP_REQUEST_MAX = HTTP_REQUEST_CANCEL
66 DS_HEADER_RECEIVED = 0x01,
67 DS_HEADER_TRUNCATED = 0x02,
68 DS_BODY_RECEIVED = 0x03,
69 DS_BODY_TRUNCATED = 0x04,
70 DS_MAX = DS_BODY_TRUNCATED
73 typedef enum http_request_state_tag {
74 HTTP_REQ_STATE_IDLE = 0x00,
75 HTTP_REQ_STATE_EXECUTED = HTTP_REQ_STATE_IDLE,
76 HTTP_REQ_STATE_INPROGRESS = 0x01,
80 // Temporary UUIDs. SIG has to define the UUIDs yet.
81 #define HPS_UUID "00001900-0000-1000-8000-00805f9b34fb"
82 #define HTTP_URI_UUID "00001901-0000-1000-8000-00805f9b34fb"
83 #define HTTP_HDR_UUID "00001902-0000-1000-8000-00805f9b34fb"
84 #define HTTP_ENTITY_UUID "00001903-0000-1000-8000-00805f9b34fb"
85 #define HTTP_CP_UUID "00001904-0000-1000-8000-00805f9b34fb"
86 #define HTTP_STATUS_UUID "00001905-0000-1000-8000-00805f9b34fb"
87 /* CCC descriptor UUID is predefined by SIG */
88 #define HTTP_STATUS_CCC_DESC_UUID "2902"
89 #define HTTP_SECURITY_UUID "00001906-0000-1000-8000-00805f9b34fb"
91 void _bt_hps_exit(void);
92 int _bt_hps_prepare_httpproxy(void);
93 int _bt_hps_set_advertising_data(void);