diff options
-rw-r--r--[-rwxr-xr-x] | lib/hci.c | 9 | ||||
-rw-r--r-- | profiles/audio/a2dp.c | 2 | ||||
-rw-r--r-- | profiles/audio/avdtp.c | 7 | ||||
-rw-r--r-- | profiles/audio/avrcp.c | 24 | ||||
-rw-r--r-- | profiles/network/bnep.c | 7 | ||||
-rw-r--r--[-rwxr-xr-x] | src/adapter.c | 13 | ||||
-rw-r--r--[-rwxr-xr-x] | src/adapter.h | 6 | ||||
-rw-r--r--[-rwxr-xr-x] | src/device.c | 4 | ||||
-rw-r--r-- | src/device.h | 3 | ||||
-rw-r--r-- | src/gatt-client.c | 2 | ||||
-rw-r--r-- | src/gatt-database.c | 7 | ||||
-rw-r--r-- | src/shared/gatt-db.c | 4 |
12 files changed, 59 insertions, 29 deletions
diff --git a/lib/hci.c b/lib/hci.c index 7fd251f8..c6cc7fc3 100755..100644 --- a/lib/hci.c +++ b/lib/hci.c @@ -3161,8 +3161,8 @@ int hci_le_write_host_suggested_data_length( uint8_t status; memset(&cp, 0, sizeof(cp)); - cp.def_tx_octets = def_tx_octets; - cp.def_tx_time = def_tx_time; + cp.def_tx_octets = *def_tx_octets; + cp.def_tx_time = *def_tx_time; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LE_CTL; @@ -3219,14 +3219,13 @@ int hci_le_set_data_length( le_set_data_length_cp cp; le_set_data_length_rp rp; struct hci_request rq; - uint8_t status; memset(&cp, 0, sizeof(cp)); memset(&rp, 0, sizeof(rp)); bacpy(&cp.bdaddr, bdaddr); - cp.max_tx_octets = max_tx_octets; - cp.max_tx_time = max_tx_time; + cp.max_tx_octets = *max_tx_octets; + cp.max_tx_time = *max_tx_time; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LE_CTL; diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index ef816144..84786dec 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -1759,6 +1759,7 @@ done: finalize_select(setup); } +#ifndef __TIZEN_PATCH__ static gboolean check_vendor_codec(struct a2dp_sep *sep, uint8_t *cap, size_t len) { @@ -1794,6 +1795,7 @@ static gboolean check_vendor_codec(struct a2dp_sep *sep, uint8_t *cap, return TRUE; } +#endif static struct a2dp_sep *a2dp_find_sep(struct avdtp *session, GSList *list, const char *sender) diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index 92bd5612..0ba00b3d 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -1074,11 +1074,12 @@ static void avdtp_sep_set_state(struct avdtp *session, avdtp_state_t state) { struct avdtp_stream *stream = sep->stream; - bdaddr_t *dst; #ifdef __TIZEN_PATCH__ +#if defined(__BROADCOM_QOS_PATCH__) || defined(TIZEN_WEARABLE) + bdaddr_t *dst; + dst = (bdaddr_t*)device_get_address(session->device); -#else - dst = device_get_address(session->device); +#endif #endif avdtp_state_t old_state; struct avdtp_error err, *err_ptr = NULL; diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 911a8895..a1e14114 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -255,11 +255,21 @@ struct control_pdu_handler { }; static GSList *servers = NULL; +#if defined(SUPPORT_AVRCP_TARGET) || defined(SUPPORT_AVRCP_CONTROL) static unsigned int avctp_id = 0; +#endif + +#ifdef SUPPORT_AVRCP_TARGET #ifdef __TIZEN_PATCH__ static uint16_t adapter_avrcp_tg_ver = 0; +#endif +#endif + +#ifdef SUPPORT_AVRCP_CONTROL +#ifdef __TIZEN_PATCH__ static uint16_t adapter_avrcp_ct_ver = 0; #endif +#endif /* Company IDs supported by this device */ static uint32_t company_ids[] = { @@ -1523,6 +1533,7 @@ static const struct passthrough_handler passthrough_handlers[] = { { }, }; +#if defined(SUPPORT_AVRCP_TARGET) || defined(SUPPORT_AVRCP_CONTROL) static bool handle_passthrough(struct avctp *conn, uint8_t op, bool pressed, void *user_data) { @@ -1544,6 +1555,7 @@ static bool handle_passthrough(struct avctp *conn, uint8_t op, bool pressed, return handler->func(session); } +#endif #ifdef __TIZEN_PATCH__ void avrcp_stop_position_timer(void) @@ -1830,6 +1842,7 @@ static const struct control_pdu_handler control_handlers[] = { { }, }; +#if defined(SUPPORT_AVRCP_TARGET) || defined(SUPPORT_AVRCP_CONTROL) /* handle vendordep pdu inside an avctp packet */ static size_t handle_vendordep_pdu(struct avctp *conn, uint8_t transaction, uint8_t *code, uint8_t *subunit, @@ -1896,6 +1909,7 @@ static struct browsing_pdu_handler { } browsing_handlers[] = { { }, }; +#endif size_t avrcp_browsing_general_reject(uint8_t *operands) { @@ -1910,6 +1924,7 @@ size_t avrcp_browsing_general_reject(uint8_t *operands) return AVRCP_BROWSING_HEADER_LENGTH + sizeof(status); } +#if defined(SUPPORT_AVRCP_TARGET) || defined(SUPPORT_AVRCP_CONTROL) static size_t handle_browsing_pdu(struct avctp *conn, uint8_t transaction, uint8_t *operands, size_t operand_count, void *user_data) @@ -1933,6 +1948,7 @@ done: handler->func(session, pdu, transaction); return AVRCP_BROWSING_HEADER_LENGTH + ntohs(pdu->param_len); } +#endif size_t avrcp_handle_vendor_reject(uint8_t *code, uint8_t *operands) { @@ -2091,6 +2107,7 @@ static gboolean avrcp_player_value_rsp(struct avctp *conn, return FALSE; } +#if defined(SUPPORT_AVRCP_TARGET) || defined(SUPPORT_AVRCP_CONTROL) static void avrcp_get_current_player_value(struct avrcp *session, uint8_t *attrs, uint8_t count) { @@ -2164,6 +2181,7 @@ static void avrcp_list_player_attributes(struct avrcp *session) avrcp_list_player_attributes_rsp, session); } +#endif static void avrcp_parse_attribute_list(struct avrcp_player *player, uint8_t *operands, uint8_t count) @@ -3407,6 +3425,7 @@ static void avrcp_register_notification(struct avrcp *session, uint8_t event) avrcp_handle_event, session); } +#if defined(SUPPORT_AVRCP_TARGET) || defined(SUPPORT_AVRCP_CONTROL) static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, uint8_t subunit, uint8_t *operands, size_t operand_count, @@ -3489,6 +3508,7 @@ static void avrcp_get_capabilities(struct avrcp *session) avrcp_get_capabilities_resp, session); } +#endif static struct avrcp *find_session(GSList *list, struct btd_device *dev) { @@ -3502,6 +3522,7 @@ static struct avrcp *find_session(GSList *list, struct btd_device *dev) return NULL; } +#if defined(SUPPORT_AVRCP_TARGET) || defined(SUPPORT_AVRCP_CONTROL) static void destroy_browsing(void *data) { struct avrcp *session = data; @@ -3575,6 +3596,7 @@ static void avrcp_connect_browsing(struct avrcp *session) connect_browsing, session); } +#endif #ifdef SUPPORT_AVRCP_TARGET static void target_init(struct avrcp *session) @@ -3692,6 +3714,7 @@ static void controller_init(struct avrcp *session) } #endif +#if defined(SUPPORT_AVRCP_TARGET) || defined(SUPPORT_AVRCP_CONTROL) static void session_init_control(struct avrcp *session) { session->passthrough_id = avctp_register_passthrough_handler( @@ -3884,6 +3907,7 @@ static void avrcp_server_unregister(struct avrcp_server *server) avctp_id = 0; } } +#endif struct avrcp_player *avrcp_register_player(struct btd_adapter *adapter, struct avrcp_player_cb *cb, diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c index 1a1e1a6f..a4cc00b6 100644 --- a/profiles/network/bnep.c +++ b/profiles/network/bnep.c @@ -780,8 +780,10 @@ int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr, #ifndef __TIZEN_PATCH__ err = bnep_add_to_bridge(iface, bridge); - if (err < 0) - goto failed_conn; + if (err < 0) { + bnep_conndel(addr); + return err; + } #endif err = bnep_if_up(iface); @@ -798,7 +800,6 @@ int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr, failed_bridge: bnep_del_from_bridge(iface, bridge); -failed_conn: bnep_conndel(addr); return err; diff --git a/src/adapter.c b/src/adapter.c index 829581cd..9342c67e 100755..100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -6123,13 +6123,6 @@ const char *btd_adapter_get_name(struct btd_adapter *adapter) return NULL; } -#ifdef __TIZEN_PATCH__ -uint8_t btd_adapter_get_rpa_res_support_value(struct btd_adapter *adapter) -{ - return adapter->central_rpa_res_support; -} -#endif - int adapter_connect_list_add(struct btd_adapter *adapter, struct btd_device *device) { @@ -10553,6 +10546,12 @@ int btd_adapter_disconnect_ipsp(struct btd_adapter *adapter, return -EIO; } +uint8_t btd_adapter_get_rpa_res_support_value( + struct btd_adapter *adapter) +{ + return adapter->central_rpa_res_support; +} + static void set_dev_rpa_res_support_complete(uint8_t status, uint16_t length, const void *param, void *user_data) diff --git a/src/adapter.h b/src/adapter.h index aed1c0b3..e081604d 100755..100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -274,6 +274,9 @@ int btd_adapter_disconnect_ipsp(struct btd_adapter *adapter, const bdaddr_t *bdaddr, uint8_t bdaddr_type); +uint8_t btd_adapter_get_rpa_res_support_value( + struct btd_adapter *adapter); + int btd_adapter_set_dev_rpa_res_support(struct btd_adapter *adapter, struct btd_device *device); @@ -298,4 +301,7 @@ struct le_data_length_read_default_data_length_handler { read_host_suggested_default_data_length_cb_t read_callback; void *user_data; }; + +int btd_adapter_le_set_data_length(struct btd_adapter *adapter, bdaddr_t *bdaddr, + uint16_t max_tx_octets, uint16_t max_tx_time); #endif diff --git a/src/device.c b/src/device.c index 7188ecde..8ebbcc7e 100755..100644 --- a/src/device.c +++ b/src/device.c @@ -3043,8 +3043,6 @@ static DBusMessage *le_set_data_length( { dbus_uint16_t max_tx_octets; dbus_uint16_t max_tx_time; - const gchar *address; - bdaddr_t bdaddr; struct btd_device *device = user_data; int status; char addr[BT_ADDRESS_STRING_SIZE]; @@ -5820,7 +5818,7 @@ void device_set_ipsp_connected(struct btd_device *device, gboolean connected) DEVICE_INTERFACE, "IpspConnected"); } void device_le_data_length_changed(struct btd_device *device, uint16_t max_tx_octets, - uint16_t max_tx_time, uint16_t max_rx_octets, uint16_t max_rx_time) + uint16_t max_tx_time, uint16_t max_rx_octets,uint16_t max_rx_time) { if (device == NULL) { error("device is NULL"); diff --git a/src/device.h b/src/device.h index 92624d07..65e5f5f2 100644 --- a/src/device.h +++ b/src/device.h @@ -160,6 +160,9 @@ gboolean device_is_ipsp_connected(struct btd_device * device); void device_set_ipsp_connected(struct btd_device *device, gboolean connected); int device_get_rpa_res_char_value(struct btd_device *device); void device_set_rpa_res_char_value(struct btd_device *device, uint8_t value); +void device_le_data_length_changed(struct btd_device *device, uint16_t max_tx_octets, + uint16_t max_tx_time, uint16_t max_rx_octets, + uint16_t max_rx_time); #endif struct btd_device *btd_device_ref(struct btd_device *device); diff --git a/src/gatt-client.c b/src/gatt-client.c index 08e50220..d248cb0d 100644 --- a/src/gatt-client.c +++ b/src/gatt-client.c @@ -1299,7 +1299,7 @@ static void notify_cb(uint16_t value_handle, const uint8_t *value, gatt_db_attribute_write(chrc->attr, 0, value, length, 0, NULL, notify_characteristic_cb, chrc); - gatt_characteristic_value_changed(value, length, chrc); + gatt_characteristic_value_changed((void *)value, length, chrc); #else gatt_db_attribute_write(chrc->attr, 0, value, length, 0, NULL, write_characteristic_cb, chrc); diff --git a/src/gatt-database.c b/src/gatt-database.c index 8beb8c3f..e360cde1 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -1775,7 +1775,6 @@ static struct pending_op *pending_read_new(struct queue *owner_queue, #ifdef __TIZEN_PATCH__ bdaddr_t bdaddr; uint8_t bdaddr_type; - char address[18]; #endif op = new0(struct pending_op, 1); @@ -1947,7 +1946,6 @@ static struct pending_op *pending_write_new(struct queue *owner_queue, #ifdef __TIZEN_PATCH__ bdaddr_t bdaddr; uint8_t bdaddr_type; - char address[18]; #endif op = new0(struct pending_op, 1); @@ -2371,7 +2369,6 @@ static void chrc_write_cb(struct gatt_db_attribute *attrib, static bool database_check_ccc_desc(struct external_desc *desc) { bt_uuid_t uuid, uuid_ccc; - char uuidstr[MAX_LEN_UUID_STR]; if (!parse_uuid(desc->proxy, &uuid)) { error("Failed to read \"UUID\" property of descriptor"); @@ -2722,8 +2719,8 @@ fail: error("Fail to add profile"); if (p) { - g_free(p->name); - g_free(p->remote_uuid); + g_free((char *)p->name); + g_free((char *)p->remote_uuid); free(p); } diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c index fd5c95ef..ea0d2c32 100644 --- a/src/shared/gatt-db.c +++ b/src/shared/gatt-db.c @@ -1746,13 +1746,13 @@ void set_ccc_unicast_address(const struct gatt_db_attribute *ccc, const char *address) { if (ccc) - str2ba(address, &ccc->unicast_addr); + str2ba(address, (bdaddr_t *)&ccc->unicast_addr); } bdaddr_t *get_ccc_unicast_address(const struct gatt_db_attribute *ccc) { if (ccc) - return &ccc->unicast_addr; + return (bdaddr_t *)&ccc->unicast_addr; return NULL; } #endif |