added k60d100m project
[adk-bluetooth-test.git] / adk-stack / btSDP.h
blob74dbfa2cf88ce30f525797b85455a54e7fe5b0f3
1 /*
2 * Copyright (C) 2012 The Android Open Source Project
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.
16 #ifndef _BT_SDP_H_
17 #define _BT_SDP_H_
19 #include <stdint.h>
21 //advised reading: https://www.bluetooth.org/Technical/AssignedNumbers/service_discovery.htm
23 #define SDP_TYPE_NIL 0
24 #define SDP_TYPE_UINT 1
25 #define SDP_TYPE_SINT 2
26 #define SDP_TYPE_UUID 3
27 #define SDP_TYPE_TEXT 4
28 #define SDP_TYPE_BOOL 5
29 #define SDP_TYPE_ARRAY 6 //"data element sequence"
30 #define SDP_TYPE_OR_LIST 7 //"data element alternative" - pick one of these
31 #define SDP_TYPE_URL 8
33 #define SDP_SZ_NIL 0
34 #define SDP_SZ_1 0
35 #define SDP_SZ_2 1
36 #define SDP_SZ_4 2
37 #define SDP_SZ_8 3
38 #define SDP_SZ_16 4
39 #define SDP_SZ_u8 5
40 #define SDP_SZ_u16 6
41 #define SDP_SZ_u32 7
43 #define SDP_ITEM_DESC(type, sz) (((type << 3) & 0xF8) | (sz & 7))
46 #define SDP_ATTR_HANDLE 0x0000
47 #define SDP_ATTR_SVC_CLS_ID_LIST 0x0001
48 #define SDP_ATTR_SVC_ID 0x0003
49 #define SDP_ATTR_PROTOCOL_DESCR_LIST 0x0004
50 #define SDP_ATTR_BROWSE_GRP_LIST 0x0005
52 #define SDP_FIRST_USER_HANDLE 0x00010000
55 #ifdef ADK_INTERNAL
57 #include "sgBuf.h"
59 void btSdpServiceDescriptorAdd(const uint8_t* descriptor, uint16_t descrLen); //a copy will NOT be made
60 void btSdpServiceDescriptorDel(const uint8_t* descriptor);
63 void btSdpRegisterL2capService(void);
65 void btSdpUnregisterL2capService(char sendDiscPacket);
68 #endif
69 #endif