DBUS_TIMEOUT, NULL,
&err);
if (err) {
+ struct hal_ev_discovery_state_changed ev;
+
ERR("Dbus Error : %s", err->message);
+ if (g_strrstr(err->message, "No discovery started"))
+ continue;
+
/* This error is thrown by Bluez, as Discovery is already stopped.
Discovery is stopped if user cancels on going discovery.
In order to maintain correct state of Bluetooth Discovery state,
simply send Discovery stopped event to HAL user */
- struct hal_ev_discovery_state_changed ev;
ev.state = HAL_DISCOVERY_STATE_STOPPED;
event_cb(HAL_EV_DISCOVERY_STATE_CHANGED, &ev, sizeof(ev));
g_clear_error(&err);
g_free(address);
} else if (strcasecmp(member, BT_HAL_HARDWARE_ERROR) == 0) {
+#ifndef TIZEN_BT_HAL
DBG("BT Hardware Error: Unhandled");
+#else
+ struct hal_ev_controller_error_recieved info;
+
+ INFO("### BT Hardware Error");
+ info.code = HAL_CONTROLLER_ERROR_HW_ERROR;
+ event_cb(HAL_EV_CONTROLLER_ERROR_RECIEVED, &info, sizeof(info));
+#endif
} else if (strcasecmp(member, BT_HAL_TX_TIMEOUT_ERROR) == 0) {
- DBG("BT TX Timeout Error: Unhandled");
+#ifndef TIZEN_BT_HAL
+ DBG("BT Hardware Error: Unhandled");
+#else
+ struct hal_ev_controller_error_recieved info;
+
+ INFO("### BT TX Timeout Error");
+ info.code = HAL_CONTROLLER_ERROR_TX_TIMEOUT;
+ event_cb(HAL_EV_CONTROLLER_ERROR_RECIEVED, &info, sizeof(info));
+#endif
} else if (strcasecmp(member, BT_HAL_DBFW_PLUS_INFO) == 0) {
#ifdef TIZEN_BT_HAL
DBG("### DBFW+ info received from BLUEZ");
} else if (!g_strcmp0(key, "GattConnected")) {
gboolean gatt_connected = FALSE;
g_variant_get(value, "b", &gatt_connected);
- INFO("Device property changed : GattConnected [%d]", gatt_connected);
+ INFO_C("Device property changed : GattConnected [%d]", gatt_connected);
char *address = g_malloc0(BT_HAL_ADDRESS_STRING_SIZE);
_bt_hal_convert_device_path_to_address(path, address);
(BT_HAL_STACK_UUID_SIZE * uuid_count),
uuids);
ev->num_props = num_props_tmp + 1;
- g_free(uuid_value);
+ g_strfreev(uuid_value);
}
g_variant_unref(tmp_value);
static void __bt_hal_send_device_acl_connection_state_event(int status, gboolean connected, const char *address)
{
- DBG("+");
struct hal_ev_acl_state_changed ev;
ev.status = status;
disc_reason, _bt_hal_convert_disc_reason_to_string(disc_reason), address, name);
if (!addr_type)
- __bt_hal_send_device_acl_connection_state_event(_bt_hal_convert_disc_reason_to_status(disc_reason), FALSE, address);
+ __bt_hal_send_device_acl_connection_state_event(disc_reason, FALSE, address);
else
- __bt_hal_send_device_le_connection_state_event(_bt_hal_convert_disc_reason_to_status(disc_reason), FALSE, address);
+ __bt_hal_send_device_le_connection_state_event(disc_reason, FALSE, address);
g_free(address);
} else if (strcasecmp(member, "ProfileStateChanged") == 0) {
int state = 0;
/* Send event to application */
avrcp_tg_event_cb(HAL_EV_AVRCP_TG_DELAY_CHANGE, &ev, sizeof(ev));
+ } else if ((strcasecmp(property, "Volume") == 0)) {
+ struct hal_ev_avrcp_tg_volume_changed ev;
+ uint16_t val;
+
+ memset(&ev, 0, sizeof(ev));
+ _bt_hal_convert_addr_string_to_type(ev.bdaddr, address);
+
+ val = g_variant_get_uint16(value);
+ DBG("Value : %d", val);
+ ev.volume = val;
+
+ /* Send event to application */
+ avrcp_tg_event_cb(HAL_EV_AVRCP_TG_VOLUME_CHANGE, &ev, sizeof(ev));
} else {
DBG("Property not handled");
}