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.
17 #ifndef ANDROID_INCLUDE_BT_SOCK_H
18 #define ANDROID_INCLUDE_BT_SOCK_H
22 #define BTSOCK_FLAG_ENCRYPT 1
23 #define BTSOCK_FLAG_AUTH (1 << 1)
31 /** Represents the standard BT SOCKET interface. */
37 } __attribute__((packed)) sock_connect_signal_t;
41 /** set to size of this struct*/
44 * listen to a rfcomm uuid or channel. It returns the socket fd from which
45 * btsock_connect_signal can be read out when a remote device connected
47 bt_status_t (*listen)(btsock_type_t type, const char* service_name, const uint8_t* service_uuid, int channel, int* sock_fd, int flags);
49 * connect to a rfcomm uuid channel of remote device, It returns the socket fd from which
50 * the btsock_connect_signal and a new socket fd to be accepted can be read out when connected
52 bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, btsock_type_t type, const uint8_t* uuid, int channel, int* sock_fd, int flags);
58 #endif /* ANDROID_INCLUDE_BT_SOCK_H */