unsigned char addr_type;
bt_connection_info_t conn_info;
bluetooth_device_address_t dev_address = { {0} };
+ int rssi;
BT_DBG("BT_DEVICE_DISCONNECTED");
- g_variant_get(parameters, "(i&sy)", &result, &address, &addr_type);
+ g_variant_get(parameters, "(i&syi)", &result, &address, &addr_type, &rssi);
_bt_convert_addr_string_to_type(dev_address.addr,
address);
conn_info.addr_type = addr_type;
conn_info.disc_reason = result;
+ conn_info.rssi = rssi;
BT_DBG("Sending Event to Framework, disconnect reason [0x%x]", result);
_bt_common_event_cb(BLUETOOTH_EVENT_DEVICE_DISCONNECTED,
result, &conn_info,
#include "oal-device-mgr.h"
static const bt_interface_t * blued_api;
+#ifdef TIZEN_BT_HAL
+static int dbfw_rssi;
+#endif
void device_mgr_init(const bt_interface_t * stack_if)
{
#ifdef TIZEN_BT_HAL
conn_status->status = convert_to_oal_status(status);
+ conn_status->rssi = dbfw_rssi;
#else
if (BT_STATUS_SUCCESS != status) {
/* At present only timeout will cause non-success status, later we can add more */
BT_DBG("LE conn status:%d, state: %d", status, state);
memcpy(conn_status->address.addr, bd_addr->address, 6);
conn_status->status = convert_to_oal_status(status);
+ conn_status->rssi = dbfw_rssi;
switch (state) {
case BT_LE_CONN_STATE_CONNECTED:
BT_DBG("-");
}
+static gboolean __device_init_dbfw_rssi_cb(gpointer user_data)
+{
+ dbfw_rssi = 0;
+ return FALSE;
+}
+
+static void __device_parse_dbfw_set_rssi(unsigned char *data, uint32_t length)
+{
+ ret_if(length < 5);
+ dbfw_rssi = 0xFFFFFF00 | data[4];
+ BT_INFO("dbfw_rssi = %d", dbfw_rssi);
+ g_timeout_add(1000, __device_init_dbfw_rssi_cb, NULL);
+}
+
void cb_dbfw_plus_info_received(unsigned char *data, uint32_t length, uint8_t event_code)
{
char evt_str[18];
case BT_DBFW_PLUS_EVENT_CODE_LINK_LOSS_INFO:
BT_DBG("## Event Code: Linkloss Debug Info");
snprintf(evt_str, 18, "[DBFW]Linkloss(D)");
+ __device_parse_dbfw_set_rssi(data, length);
break;
case BT_DBFW_PLUS_EVENT_CODE_LINK_LOSS_CLOCK_INFO:
BT_DBG("## Event Code: Linkloss Clock Info");
BLUETOOTH_EVENT_DEVICE_CONNECTED,
param);
} else {
- param = g_variant_new("(isy)", result, address, type);
+ param = g_variant_new("(isyi)", result, address, type, acl_event->rssi);
_bt_send_event(BT_DEVICE_EVENT,
BLUETOOTH_EVENT_DEVICE_DISCONNECTED,
param);