Fix the issue that can not send device event
[platform/core/connectivity/bluetooth-frwk.git] / bt-httpproxy / bt-httpproxy.h
1 /*
2  * Copyright (c) 2015 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 #ifndef __BT_HTTPPROXY_H__
19 #define __BT_HTTPPROXY_H__
20
21 #ifdef TIZEN_FEATURE_BT_HPS
22
23 #define BT_HPS_LE_ADAPTER_INTERFACE     "org.bluez.Adapter1"
24 #define BT_HPS_LE_ADAPTER_PATH "/org/projectx/bt/le/adapter"
25
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"
29
30 #define BT_HPS_CHAR_INTERFACE "org.bluez.GattCharacteristic1"
31 #define BT_HPS_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
32
33 #define BLE_ENABLED "LeEnabled"
34 #define BLE_DISABLED "LeDisabled"
35 #define PROPERTIES_CHANGED "PropertiesChanged"
36
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
43
44
45 /* HTTP Control Point Commands
46    OPTIONS, TRACE, CONNECT are not supported
47 */
48 enum {
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
62 };
63
64 enum {
65         DS_NONE = 0x00,
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
71 };
72
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,
77 } http_request_state;
78
79
80 /* HPS UUIDs. defined by SIG */
81 #define HPS_UUID "1823"
82 #define HTTP_URI_UUID "2ab6"
83 #define HTTP_HDR_UUID "2ab7"
84 #define HTTP_ENTITY_UUID "2ab9"
85 #define HTTP_CP_UUID "2aba"
86 #define HTTP_STATUS_UUID "2ab8"
87 #define HTTP_SECURITY_UUID "2abb"
88 /* CCC descriptor UUID is predefined by SIG */
89 #define HTTP_STATUS_CCC_DESC_UUID "2902"
90
91 void _bt_hps_exit(void);
92 int _bt_hps_prepare_httpproxy(void);
93 int _bt_hps_set_advertising_data(void);
94
95
96 #endif
97
98 #endif