/* * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __TIZEN_NETWORK_BLUETOOTH_PRIVATE_H__ #define __TIZEN_NETWORK_BLUETOOTH_PRIVATE_H__ #include #include #include #include #include #include #include #include "bluetooth.h" #include "bluetooth_internal.h" #ifdef __cplusplus extern "C" { #endif #undef LOG_TAG #define LOG_TAG "CAPI_NETWORK_BLUETOOTH" #define BT_INFO(fmt, args...) SLOGI(fmt, ##args) #define BT_DBG(fmt, args...) SLOGD(fmt, ##args) #define BT_ERR(fmt, args...) SLOGE(fmt, ##args) #define OPP_UUID "00001105-0000-1000-8000-00805f9b34fb" /** * @internal * @brief Bluetooth callback. */ typedef enum { BT_EVENT_STATE_CHANGED = 0x00, /**< Adapter state is changed */ BT_EVENT_LE_STATE_CHANGED, /**< Adapter le state is changed */ BT_EVENT_NAME_CHANGED, /**< Adapter name is changed */ BT_EVENT_VISIBILITY_MODE_CHANGED, /**< Adapter visibility mode is changed */ BT_EVENT_VISIBILITY_DURATION_CHANGED, /**< Adapter visibility duration is changed */ BT_EVENT_DEVICE_DISCOVERY_STATE_CHANGED, /**< Device discovery state is changed */ BT_EVENT_LE_DEVICE_DISCOVERY_STATE_CHANGED, /**< LE Device discovery state is changed */ BT_EVENT_LE_SCAN_RESULT_UPDATED, /**< LE Scan result is updated */ BT_EVENT_BOND_CREATED, /**< A bond is created */ BT_EVENT_BOND_DESTROYED, /**< A bond is destroyed */ BT_EVENT_AUTHORIZATION_CHANGED, /**< Authorization is changed */ BT_EVENT_SERVICE_SEARCHED, /**< Service search finish */ BT_EVENT_DATA_RECEIVED, /**< Data is received */ BT_EVENT_CONNECTION_STATE_CHANGED, /**< Connection state is changed */ BT_EVENT_RFCOMM_CONNECTION_REQUESTED, /**< RFCOMM connection is requested */ BT_EVENT_OPP_CONNECTION_REQUESTED, /**< OPP connection is requested */ BT_EVENT_OPP_PUSH_REQUESTED, /**< OPP push is requested */ BT_EVENT_OPP_SERVER_TRANSFER_PROGRESS, /**< OPP transfer progress */ BT_EVENT_OPP_SERVER_TRANSFER_FINISHED, /**< OPP transfer is completed */ BT_EVENT_OPP_CLIENT_PUSH_RESPONSED, /**< OPP client connection is reponsed */ BT_EVENT_OPP_CLIENT_PUSH_PROGRESS, /**< OPP client push progress */ BT_EVENT_OPP_CLIENT_PUSH_FINISHED, /**< OPP client push is finished */ BT_EVENT_PAN_CONNECTION_STATE_CHANGED, /**< PAN connection change */ BT_EVENT_NAP_CONNECTION_STATE_CHANGED, /**< NAP connection change */ BT_EVENT_HDP_CONNECTED, /**< HDP connection change */ BT_EVENT_HDP_DISCONNECTED, /**< HDP disconnection change */ BT_EVENT_HDP_DATA_RECEIVED, /**< HDP Data receive Callabck */ BT_EVENT_AUDIO_CONNECTION_STATUS, /**< Audio Connection change callback */ BT_EVENT_A2DP_SOURCE_CONNECTION_STATUS, /**< A2dp Source Connection Change */ BT_EVENT_AG_SCO_CONNECTION_STATUS, /**< Audio - AG SCO Connection state change callback */ BT_EVENT_AG_CALL_HANDLING_EVENT, /**< Audio - AG call event callback */ BT_EVENT_AG_MULTI_CALL_HANDLING_EVENT, /**< Audio - AG 3-way call event callback */ BT_EVENT_AG_DTMF_TRANSMITTED, /**< Audio - DTMF tone sending request */ BT_EVENT_AG_MICROPHONE_GAIN_CHANGE, /**< Audio Microphone change callback */ BT_EVENT_AG_SPEAKER_GAIN_CHANGE, /**< Audio Speaker gain change callback */ BT_EVENT_AG_VENDOR_CMD, /**< Audio - XSAT Vendor cmd */ BT_EVENT_AVRCP_CONNECTION_STATUS, /**< AVRCP connection change callback */ BT_EVENT_AVRCP_EQUALIZER_STATE_CHANGED, /**< AVRCP equalizer state change callback */ BT_EVENT_AVRCP_REPEAT_MODE_CHANGED, /**< AVRCP repeat mode change callback */ BT_EVENT_AVRCP_SHUFFLE_MODE_CHANGED, /**< AVRCP equalizer mode change callback */ BT_EVENT_AVRCP_SCAN_MODE_CHANGED, /**< AVRCP scan mode change callback */ BT_EVENT_AVRCP_PLAY_STATUS_CHANGED, /**< AVRCP scan mode change callback */ BT_EVENT_AVRCP_SONG_POSITION_CHANGED, /**< AVRCP scan mode change callback */ BT_EVENT_AVRCP_TRACK_INFO_CHANGED, /**< AVRCP scan mode change callback */ BT_EVENT_HID_CONNECTION_STATUS, /**< HID connection status callback */ BT_EVENT_DEVICE_CONNECTION_STATUS, /**< Device connection status callback */ BT_EVENT_GATT_CONNECTION_STATUS, /** < GATT connection status callback */ BT_EVENT_GATT_CLIENT_SERVICE_DISCOVERED, /** GATT services discovered callback */ BT_EVENT_GATT_CLIENT_VALUE_CHANGED, /**< GATT characteristic value changed callback */ BT_EVENT_GATT_CLIENT_READ_CHARACTERISTIC, /**< GATT characteristic value read callback */ BT_EVENT_GATT_CLIENT_WRITE_CHARACTERISTIC, /**< GATT characteristic value write callback */ BT_EVENT_GATT_CLIENT_READ_DESCRIPTOR, /**< GATT descriptor value read callback */ BT_EVENT_GATT_CLIENT_WRITE_DESCRIPTOR, /**< GATT descriptor value write callback */ BT_EVENT_GATT_SERVER_READ_REQUESTED, /**< GATT Characteristic/Descriptor Read Requested callback*/ #ifdef BT_ENABLE_LEGACY_GATT_CLIENT BT_EVENT_GATT_CLIENT_CHARACTERISTIC_DISCOVERED_LEGACY, /**< GATT characteristic discovered callback */ BT_EVENT_GATT_CLIENT_CHARACTERISTIC_DESCRIPTOR_DISCOVERED_LEGACY, /**< GATT characteristic descriptor discovered callback */ BT_EVENT_GATT_CLIENT_VALUE_CHANGED_LEGACY, /**< GATT characteristic value changed callback */ BT_EVENT_GATT_CLIENT_READ_CHARACTERISTIC_LEGACY, /**< GATT characteristic value read callback */ BT_EVENT_GATT_CLIENT_WRITE_CHARACTERISTIC_LEGACY, /**< GATT characteristic value write callback */ #endif BT_EVENT_ADVERTISING_STATE_CHANGED, /**< Advertising state changed callback */ BT_EVENT_MANUFACTURER_DATA_CHANGED, /**< Manufacturer data changed callback */ BT_EVENT_CONNECTABLE_CHANGED_EVENT, /**< Adapter connectable changed callback */ BT_EVENT_RSSI_ENABLED_EVENT, /**< RSSI Enabled callback */ BT_EVENT_RSSI_ALERT_EVENT, /**< RSSI Alert callback */ BT_EVENT_GET_RSSI_EVENT, /**< Get RSSI Strength callback */ #ifdef TIZEN_WEARABLE BT_EVENT_PBAP_CONNECTION_STATUS, /**< PBAP connection status callback */ BT_EVENT_PBAP_PHONEBOOK_SIZE, /**< PBAP Phonebook Size status callback */ BT_EVENT_PBAP_PHONEBOOK_PULL, /**< PBAP Phonebook Pull status callback */ BT_EVENT_PBAP_VCARD_LIST, /**< PBAP vCard List status callback */ BT_EVENT_PBAP_VCARD_PULL, /**< PBAP vCard Pull status callback */ BT_EVENT_PBAP_PHONEBOOK_SEARCH, /**< PBAP Phonebook Search status callback */ BT_EVENT_HF_SCO_CONNECTION_STATUS, /**< Audio - HF SCO Connection state change callback */ BT_EVENT_HF_SPEAKER_GAIN_CHANGE, /**< Audio - HF Speaker gain change callback */ BT_EVENT_HF_CALL_HANDLING_EVENT, /**< Audio - HF call event callback */ BT_EVENT_HF_VENDOR_DEP_CMD_EVENT, /**< Audio - HF Vendor Command callback */ BT_EVENT_HF_MULTI_CALL_HANDLING_EVENT, /**< Audio - HF 3-way call event callback */ BT_EVENT_HF_CALL_STATUS_UPDATED_EVENT, /**< Audio - HF call status updated callback */ #endif BT_EVENT_MAX } bt_event_e; typedef enum { BT_GATT_ROLE_SERVER = 0x01, BT_GATT_ROLE_CLIENT = 0x02, } bt_gatt_role_e; #ifdef TIZEN_WEARABLE /** * @internal */ typedef enum { BT_ADAPTER_LE_ADVERTISING_CONNECTABLE = 0x00, /**< Connectable undirected advertising (ADV_IND) */ BT_ADAPTER_LE_ADVERTISING_CONNECTABLE_DIRECT_HIGH = 0x01, /* @Deprecated since Tizen 2.4 */ BT_ADAPTER_LE_ADVERTISING_SCANNABLE = 0x02, /**< Scannable undirected advertising (ADV_SCAN_IND) */ BT_ADAPTER_LE_ADVERTISING_NON_CONNECTABLE = 0x03, /**< Non connectable undirected advertising (ADV_NONCOND_IND) */ BT_ADAPTER_LE_ADVERTISING_CONNECTABLE_DIRECT_LOW = 0x04, /* @Deprecated since Tizen 2.4 */ } bt_adapter_le_advertising_type_e; /** * @internal */ typedef enum { BT_ADAPTER_LE_PACKET_DATA_INCOMP_LIST_16_BIT_SERVICE_CLASS_UUIDS = 0x02, /**