TizenRT Public API  v2.0 M2
bluetooth_type_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 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 #ifndef __TIZEN_NETWORK_BLUETOOTH_TYPE_INTERNAL_H__
18 #define __TIZEN_NETWORK_BLUETOOTH_TYPE_INTERNAL_H__
19 
20  #ifdef __cplusplus
21 extern "C"
22 {
23 #endif /* __cplusplus */
24 
25 #ifdef GLIB_SUPPORTED
26 #include <glib.h>
27 #endif
28 
29 /* This variable will be added into bt_service_class_t in tizen 4.0 */
30 #define BT_SC_MAP_SERVICE_MASK 0x00800000
36 #define BT_PROFILE_SERVICE_UUID_SPP "1101"
37 #define BT_PROFILE_SERVICE_UUID_HSP_HS "1108"
38 #define BT_PROFILE_SERVICE_UUID_HSP_AG "1112"
39 #define BT_PROFILE_SERVICE_UUID_OPP "1105"
40 #define BT_PROFILE_SERVICE_UUID_HFP_HF "111e"
41 #define BT_PROFILE_SERVICE_UUID_HFP_AG "111f"
42 #define BT_PROFILE_SERVICE_UUID_A2DP_SOURCE "110a"
43 #define BT_PROFILE_SERVICE_UUID_A2DP_SINK "110b"
44 #define BT_PROFILE_SERVICE_UUID_AVRCP_TARGET "110c"
45 #define BT_PROFILE_SERVICE_UUID_AVRCP_CONTROL "110f"
46 #define BT_PROFILE_SERVICE_UUID_PAN_PANU "1115"
47 #define BT_PROFILE_SERVICE_UUID_PAN_NAP "1116"
48 #define BT_PROFILE_SERVICE_UUID_PAN_GN "1117"
49 #define BT_PROFILE_SERVICE_UUID_HDP_SOURCE "1401"
50 #define BT_PROFILE_SERVICE_UUID_HDP_SINK "1402"
51 #define BT_PROFILE_SERVICE_UUID_HID "1124"
52 
58 typedef enum {
62 
68 typedef enum {
69  BT_ATT_ERROR_INTERNAL = -1,
70  BT_ATT_ERROR_NONE = 0x00,
71 
72  /* Attribute error codes */
73  BT_ATT_ERROR_INVALID_HANDLE = 0x01,
74  BT_ATT_ERROR_READ_NOT_PERMITTED = 0x02,
75  BT_ATT_ERROR_WRITE_NOT_PERMITTED = 0x03,
76  BT_ATT_ERROR_INVALID_PDU = 0x04,
77  BT_ATT_ERROR_AUTHENTICATION = 0x05,
78  BT_ATT_ERROR_REQUEST_NOT_SUPPORTED = 0x06,
79  BT_ATT_ERROR_INVALID_OFFSET = 0x07,
80  BT_ATT_ERROR_AUTHORIZATION = 0x08,
81  BT_ATT_ERROR_PREPARE_QUEUE_FULL = 0x09,
82  BT_ATT_ERROR_ATTRIBUTE_NOT_FOUND = 0x0A,
83  BT_ATT_ERROR_ATTRIBUTE_NOT_LONG = 0x0B,
84  BT_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE = 0x0C,
85  BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN = 0x0D,
86  BT_ATT_ERROR_UNLIKELY = 0x0E,
87  BT_ATT_ERROR_INSUFFICIENT_ENCRYPTION = 0x0F,
88  BT_ATT_ERROR_UNSUPPORTED_GROUP_TYPE = 0x10,
89  BT_ATT_ERROR_INSUFFICIENT_RESOURCES = 0x11,
90 
91  /* Common profile error codes */
92  BT_ATT_ERROR_WRITE_REQUEST_REJECTED = 0xFC,
93  BT_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED = 0xFD,
94  BT_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS = 0xFE,
95  BT_ATT_ERROR_OUT_OF_RANGE = 0xFF,
96 
98 
104 typedef enum {
105  /* Bluetooth OTP error codes */
106  BT_OTP_ERROR_WRITE_REQUEST_REJECTED = 0x80,
107  BT_OTP_ERROR_OBJECT_NOT_SELECTED = 0x81,
108  BT_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED = 0x82,
109  BT_OTP_ERROR_OBJECT_NAME_EXISTS = 0x83,
111 
126 typedef void (*bt_adapter_le_state_changed_cb)(int result, bt_adapter_le_state_e adapter_le_state, void *user_data);
127 
137 typedef void (*bt_avrcp_delay_changed_cb) (unsigned int delay, void *user_data);
138 
144 typedef enum {
153 
159 typedef enum {
168 
174 typedef enum {
189 
195 typedef enum {
199 
205 typedef enum {
206  BT_A2DP_SOURCE,
207  BT_A2DP_SINK,
209 
216 
217 typedef void* bt_map_client_message_object_h;
218 
219 typedef struct {
220  int16_t offset;
221  int16_t max_count;
223 
224 typedef struct {
225  int16_t offset;
226  int16_t max_count;
227  int8_t subject_length;
228  char *fields;
229  char *types;
230  char *period_begin;
231  char *period_end;
232  int is_read;
233  char *recipient;
234  char *sender;
235  int is_priority;
237 
238 typedef struct {
239  bt_map_client_message_object_h message_object;
240  char *folder;
241  char *subject;
242  char *timestamp;
243  char *sender;
244  char *sender_address;
245  char *reply_to;
246  char *recipient;
247  char *recipient_address;
248  char *type;
249  int64_t size;
250  int is_text;
251  char *status;
252  int64_t attachment_size;
253  int is_priority;
254  int is_read;
255  int is_sent;
256  int is_protected;
258 
259 typedef struct {
260  int is_transparent;
261  int is_retry;
262  char *charset;
264 
265 typedef struct {
266  char *file_path;
267 // TODO: maybe some additional fields could be supported
268 // char *folder;
269 // char *subject;
270 // char *timestamp;
271 // char *sender;
272 // char *sender_address;
273 // char *reply_to;
274 // char *recipient;
275 // char *recipient_address;
276 // char *type;
277 // int64_t size;
278 // char *status;
279 // int is_priority;
280 // int is_read;
281 // int is_deleted;
282 // int is_sent;
283 // int is_protected;
285 
287 
289 
291 
293 
295 
296 typedef void (*bt_map_client_list_folders_cb)(int result, char **folders, int count, void *user_data);
297 
298 typedef void (*bt_map_client_list_filter_fields_cb)(int result, char **filter_fields, int count, void *user_data);
299 
300 typedef void (*bt_map_client_list_messages_cb)(int result, bt_map_client_message_item_s *messages, int count, void *user_data);
301 
302 typedef void (*bt_map_client_push_message_cb)(int result, void *user_data);
303 
304 typedef void (*bt_map_client_get_message_cb)(int result, bt_map_client_message_h message, void *user_data);
305 
322 typedef void (*bt_adapter_connectable_changed_cb)
323  (int result, bool connectable, void *user_data);
324 
337 typedef void (*bt_opp_server_push_requested_cb)(const char *file, int size, void *user_data);
338 
344 typedef enum {
345  BT_ADAPTER_LE_PASSIVE_SCAN = 0x00,
346  BT_ADAPTER_LE_ACTIVE_SCAN
348 
354 typedef enum {
369 
370 
376 typedef enum {
383 
389 typedef enum {
403 
409 typedef struct {
410  char *number;
411  int direction;
412  int status;
414  int index;
416 
431 typedef void (*bt_adapter_manufacturer_data_changed_cb) (char *data,
432  int len, void *user_data);
433 
447 typedef bool (*bt_adapter_profile_connected_devices_cb)(const char *remote_address, void *user_data);
448 
464 typedef void (*bt_hf_sco_state_changed_cb) (int result, bool opened, void *user_data);
465 
477 typedef void (*bt_hf_call_handling_event_cb) (bt_hf_call_handling_event_e event, char *phone_number, void *user_data);
478 
490 
501 typedef void (*bt_hf_speaker_gain_changed_cb) (int gain, void *user_data);
502 
517 #ifdef GLIB_SUPPORTED
518 typedef void (*bt_hf_call_status_updated_event_cb) (GSList *call_info_list, void *user_data);
519 #endif
520 
526 typedef enum {
532 
538 typedef enum {
539  BT_DPM_STATUS_ERROR = -1,
540 
550 
556 typedef enum {
557  BT_DPM_POLICY_A2DP_PROFILE_STATE,
558  BT_DPM_POLICY_AVRCP_PROFILE_STATE,
559  BT_DPM_POLICY_BPP_PROFILE_STATE,
560  BT_DPM_POLICY_DUN_PROFILE_STATE,
561  BT_DPM_POLICY_FTP_PROFILE_STATE,
562  BT_DPM_POLICY_HFP_PROFILE_STATE,
563  BT_DPM_POLICY_HSP_PROFILE_STATE,
564  BT_DPM_POLICY_PBAP_PROFILE_STATE,
565  BT_DPM_POLICY_SAP_PROFILE_STATE,
566  BT_DPM_POLICY_SPP_PROFILE_STATE,
567  BT_DPM_PROFILE_NONE,
569 
575 typedef struct {
576  unsigned int interval_min;
577  unsigned int interval_max;
578  unsigned int latency;
579  unsigned int time_out;
581 
585 typedef struct {
586  int count;
587  char **devices;
589 
593 typedef struct {
594  int count;
595  char **uuids;
597 
604 typedef enum {
605  ADDRESS_NONE_TYPE = 0x00,
606  WI_FI_P2P_ADDRESS = 0x01,
607  BLUETOOTH_ADDRESS = 0x02,
608  INDICATION_ADDRESS = 0x04,
609  IPV4_ADDRESS = 0x08,
610  IPV6_ADDRESS = 0x10,
611  UNKNOWN_ADDRESS = 0xff
612 } connectivity_address_t;
613 
620 typedef enum {
621  NONE_TYPE = 0x00,
622  PROXIMITY = 0x01,
623  CO_PRESENCE = 0x02,
624  UNKNOWN_TYPE = 0xff
625 } bt_proximity_locality_t;
626 
633 typedef struct {
634  unsigned char version;
635  unsigned char service_id;
636  unsigned char discovery_version;
637  unsigned char associated_service_id;
638  bt_proximity_locality_t proximity_locality_type;
639  unsigned char proximity_locality_info;
640  unsigned char device_type;
641  unsigned char device_icon;
642  unsigned char auth_info[5];
643  connectivity_address_t addr_type;
644  unsigned char addr1[6];
645  unsigned char addr2[6];
646  unsigned char channel_info;
647  unsigned char associated_service_data_len;
648  unsigned char *associated_service_data_val;
649  char *name;
651 
660 typedef enum {
661  BT_TRUSTED_PROFILE_PBAP = 1,
662  BT_TRUSTED_PROFILE_MAP,
663  BT_TRUSTED_PROFILE_SAP,
664  BT_TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
666 
676 typedef enum {
677  BT_RESTRICTED_PROFILE_HFP_HS = 1,
678  BT_RESTRICTED_PROFILE_A2DP,
680 
687 typedef enum {
692 
698 typedef enum {
702 
708 typedef enum {
713 
726 typedef void (*bt_device_trusted_profiles_cb)
727  (int result, char *remote_address, int trusted_profile, bool supported, bool trusted, void *user_data);
728 
737 typedef struct {
739  unsigned int mtu;
740  unsigned int status;
742 
755 typedef void (*bt_device_att_mtu_changed_cb)(int result, bt_device_att_mtu_info_s *mtu_info, void *user_data);
756 
763 
770 
785  (int result, const char *remote_address, int service_type, int prop_value, void *user_data);
786 
802  (int result, const char *remote_address, bt_proximity_monitor_h monitor, bool connected, int supported_service, void *user_data);
803 
819  (int result, const char *remote_address, bt_proximity_reporter_h reporter, bool connected, int supported_service, void *user_data);
820 
821 
827 typedef enum {
832 
838 typedef enum {
839  BT_TDS_TRANSPORT_BT = 0x01, /* Transport BR-EDR */
840  BT_TDS_TRANSPORT_CUSTOM, /* Transport custom */
841  /* ... */
842  BT_TDS_TRANSPORT_INVALID
843 } bt_tds_transport_e;
844 
850 typedef struct {
851  bt_tds_transport_e transport;
853  bool is_data_complete;
854  char *data;
855  int length;
857 
863 typedef struct {
867 
895 typedef void (*bt_adapter_authentication_req_cb)(int result, bt_authentication_type_info_e auth_type,
896  char *device_name, char *remote_addr,
897  char *pass_key, void *user_data);
898 
904 typedef struct {
905  int app_id;
906  char *message;
908 
920 typedef void (*bt_hf_remote_call_event_cb) (bt_hf_remote_call_event_e event, char *phone_number, void *user_data);
921 
932 typedef void (*bt_ag_vendor_cmd_cb) (char *command, void *user_data);
933 
939 typedef void *bt_tds_provider_h;
940 
953 typedef void (*bt_tds_activation_requested_cb)(char *remote_bd_addr,
954  bt_tds_transport_e transport, unsigned char *buf, int len, void *user_data);
955 
961 typedef void *bt_tds_seeker_h;
962 
969 typedef void (*bt_tds_provider_scan_result_cb)(int result, const char *remote_address,
971  void *user_data);
972 
978 typedef void (*bt_tds_seeker_connection_state_changed_cb)
979  (int result, const char *remote_address, bt_tds_seeker_h seeker, bool connected, void *user_data);
980 
986 typedef void (*bt_tds_seeker_complete_transport_data_cb)
987  (int result, const char *remote_address, bt_tds_transport_block_list_s *info, void *user_data);
988 
994 typedef void (*bt_tds_control_point_activation_indication_cb)
995  (int result, const char *remote_address, unsigned char *data, int data_length, void *user_data);
996 
1002 typedef void (*bt_otp_server_state_changed_cb)(int result, bool connected);
1003 
1004 
1010 typedef void *bt_otp_client_h;
1011 
1017 typedef struct {
1018  unsigned long long id;
1019  char *name;
1021 
1027 typedef struct {
1031 
1037 typedef void (*bt_otp_client_state_changed_cb)
1038  (int result, const char *remote_address, bt_otp_client_h otp_client, bool connected, void *user_data);
1039 
1045 typedef void (*bt_otp_client_object_discovery_cb)
1046  (int result, const char *remote_address, bt_otp_object_list_s *obj_list, void *user_data);
1047 
1053 typedef void (*bt_otp_client_object_select_cb)
1054  (int result, const char *remote_address, unsigned long long obj_id, void *user_data);
1055 
1061 typedef void (*bt_otp_client_read_object_complete_cb)
1062  (int result, const char *remote_address, char *file_path, void *user_data);
1063 
1069 typedef void (*bt_otp_client_object_create_cb)
1070  (int result, const char *remote_address, unsigned long long obj_id, void *user_data);
1071 
1077 typedef void (*bt_otp_client_object_write_cb)
1078  (int result, const char *remote_address, unsigned int length, void *user_data);
1079 
1085 typedef void (*bt_otp_client_object_execute_cb)
1086  (int result, const char *remote_address, unsigned long long obj_id, void *user_data);
1087 
1093 typedef void (*bt_otp_client_object_delete_cb)
1094  (int result, const char *remote_address, unsigned long long obj_id, void *user_data);
1095 
1105 typedef enum {
1109 
1115 typedef void (*bt_hrp_sensor_advertising_state_changed_cb)(int result,
1116  bt_hrp_sensor_advertising_state_e adv_state, void *user_data);
1117 
1118 
1119 /* Body Sensor Enumeration
1120 */
1121 typedef enum {
1122  BT_BSL_NOTSUPPORTED = -1,
1123  BT_BSL_OTHER = 0,
1124  BT_BSL_CHEST,
1125  BT_BSL_WRIST,
1126  BT_BSL_FINGER,
1127  BT_BSL_HAND,
1128  BT_BSL_EARLOBE,
1129  BT_BSL_FOOT,
1130 } bt_body_sensor_location_e;
1131 
1137 typedef void *bt_hrp_collector_h;
1138 
1155  unsigned short hr_value, void *user_data);
1156 
1165 typedef enum {
1166  HEART_RATE = 1,
1167  BODY_SENSOR_LOCATION,
1168  HEART_CONTROL_POINT,
1170 
1182 typedef void (*bt_hrp_collector_scan_result_cb)(int result,
1183  bt_adapter_le_device_scan_result_info_s *info, void *user_data);
1184 
1197 typedef void (*bt_hrp_collector_bsl_read_completed_cb) (int result,
1198  bt_hrp_collector_h request_handle, bt_body_sensor_location_e location, void *user_data);
1199 
1206 typedef void (*bt_hrp_collector_connection_state_changed_cb)
1207  (int result, const char *remote_address, bt_hrp_collector_h collector,
1208  bool connected, void *user_data);
1209 
1210 #ifdef __cplusplus
1211 }
1212 #endif /* __cplusplus */
1213 
1214 #endif /* __TIZEN_NETWORK_BLUETOOTH_TYPE_INTERNAL_H__ */
void(* bt_hf_multi_call_handling_event_cb)(bt_hf_multi_call_handling_event_e event, void *user_data)
Called when a multi call handling event happened from Hands-Free. .
bt_adapter_le_state_e
Enumerations of the Bluetooth adapter le state. 2.3.
bt_dpm_allow_e
Called when a call status updated event happened from Hands-Free. .
void(* bt_adapter_manufacturer_data_changed_cb)(char *data, int len, void *user_data)
Called when the manufacturer dat changes. 2.3.
bt_hf_call_handling_event_e
Enumerations for the call handling event .
bt_audio_role_e
Enumerations of the Bluetooth A2DP role. 4.0.
bt_hf_call_event_e
Enumerations for the call state .
bt_hf_remote_call_event_e
Enumerations for the call event from Audio-Gateway device .
void * bt_proximity_reporter_h
The handle of a Proximity Reporter server. 4.0.
void(* bt_hrp_collector_heart_rate_value_changed_cb)(bt_gatt_client_h characteristic, unsigned short hr_value, void *user_data)
Called when a value of a watched characteristic&#39;s GATT handle has been changed in HRP...
otp_object_metadata_s ** data
void(* bt_hf_remote_call_event_cb)(bt_hf_remote_call_event_e event, char *phone_number, void *user_data)
Called when a call event happend from Audio-Gateway device .
void(* bt_avrcp_delay_changed_cb)(unsigned int delay, void *user_data)
Called when the delay is changed by the remote device. 5.0.
Attribute protocol MTU change information structure. 3.0.
HF Call status information. .
bt_authentication_type_info_e
Enumerations of the authentication event types. 3.0.
bt_hrp_sensor_advertising_state_e
Enumerations of the Bluetooth advertising state for HRP. 2.3.
bt_proximity_property_t
Proximity Profile Role 3.0.
bt_otp_error_e
Enumerations of the ATT error codes specific to OTP. 4.0.
bt_adapter_le_scan_type_e
Enumerations of the Bluetooth adapter le scan type. 2.3.
bt_dpm_profile_e
DPM Profile states 3.0.
void(* bt_adapter_le_state_changed_cb)(int result, bt_adapter_le_state_e adapter_le_state, void *user_data)
Called when the Bluetooth adapter le state changes. 2.3.
void * bt_tds_seeker_h
The handle of a TDS Seeker client which is associated with a remote TDS provider 3...
bt_hf_multi_call_handling_event_e
Enumerations for the multi call handling event .
Structure of le scan result information. 2.3.1.
void(* bt_hf_sco_state_changed_cb)(int result, bool opened, void *user_data)
Called when the SCO(Synchronous Connection Oriented link) state is changed. .
bt_tds_transport_state_e
void(* bt_proximity_monitor_connection_state_changed_cb)(int result, const char *remote_address, bt_proximity_monitor_h monitor, bool connected, int supported_service, void *user_data)
Called when the Proximity monitor profile connection state is changed. 4.0.
Device LE connection update structure. 2.3.
void(* bt_hrp_collector_scan_result_cb)(int result, bt_adapter_le_device_scan_result_info_s *info, void *user_data)
Called when the LE advertisement callback for HRP sensor has been found. 4.0.
void(* bt_hf_call_handling_event_cb)(bt_hf_call_handling_event_e event, char *phone_number, void *user_data)
Called when a call handling event happened from Hands-Free. .
void(* bt_adapter_connectable_changed_cb)(int result, bool connectable, void *user_data)
Called when the connectable state changes. 2.3.
bt_ag_call_event_e
Enumerations for the call state 2.3.
void(* bt_device_trusted_profiles_cb)(int result, char *remote_address, int trusted_profile, bool supported, bool trusted, void *user_data)
Called when Trusted Profiles is changed. 3.0.
void(* bt_device_att_mtu_changed_cb)(int result, bt_device_att_mtu_info_s *mtu_info, void *user_data)
Called when the connection state is changed. 3.0.
void * bt_proximity_monitor_h
The handle of a Proximity Monitor client handle which is associated with a remote device...
void * bt_gatt_client_h
The handle of a GATT client which is associated with a remote device. 2.3.1.
void(* bt_proximity_reporter_property_changed_cb)(int result, const char *remote_address, int service_type, int prop_value, void *user_data)
Called when the Proximity profile reporter property is changed. 4.0.
void(* bt_hrp_collector_bsl_read_completed_cb)(int result, bt_hrp_collector_h request_handle, bt_body_sensor_location_e location, void *user_data)
Called when the client request read operation on body sensor location has been completed. 4.
bt_opp_transfer_type_t
Enumerations for the transfer type 3.0.
bt_proximity_role_t
Proximity Profile Role 3.0.
void(* bt_hf_speaker_gain_changed_cb)(int gain, void *user_data)
Called when the speaker gain of the remote device is changed. .
bt_att_error_e
Enumerations of the ATT error codes. 4.0.
bt_restricted_profile_t
Restricted Profile enumeration. 3.0.
bt_ag_call_state_e
Enumerations for the call state 2.3.
void(* bt_ag_vendor_cmd_cb)(char *command, void *user_data)
Called when a XSAT vendor command is transmitted from Hands-Free. 2.3.
bt_serv_char_type_t
type information structure ,define what type of reequest is made. 4.0
void * bt_otp_client_h
The handle of a OTP client which is associated with a remote OTP Server 4.0.
void * bt_map_client_session_info_h
3.0
bt_dpm_status_e
DPM Policy status 3.0.
void(* bt_proximity_reporter_connection_state_changed_cb)(int result, const char *remote_address, bt_proximity_reporter_h reporter, bool connected, int supported_service, void *user_data)
Called when the Proximity reporter profile connection state is changed. 4.0.
bt_trusted_profile_t
Trusted Profile enumeration. 3.0.
Samsung XSAT Vendor dependent command. 2.3.2.
void(* bt_opp_server_push_requested_cb)(const char *file, int size, void *user_data)
Called when the push is requested. 2.3.