X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-api%2Fbt-rfcomm-client.c;h=3a168911f658ea20dd5b4fbb0086fe8f04fa79fe;hb=0bffd0dc57188e9d53863475c1112711b8e73367;hp=888f5622c3d16e5a8f732c06325c02bafa45dd60;hpb=50a3b13cddb36b9d64eb185be0309f9f30eb310f;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-api/bt-rfcomm-client.c b/bt-api/bt-rfcomm-client.c index 888f562..3a16891 100644 --- a/bt-api/bt-rfcomm-client.c +++ b/bt-api/bt-rfcomm-client.c @@ -323,7 +323,7 @@ static gboolean __client_data_received_cb(GIOChannel *chan, GIOCondition cond, GIOStatus status = G_IO_STATUS_NORMAL; GError *err = NULL; int fd; - BT_DBG(""); + BT_DBG("+"); retv_if(info == NULL, FALSE); fd = g_io_channel_unix_get_fd(chan); @@ -391,7 +391,14 @@ static gboolean __client_data_received_cb(GIOChannel *chan, GIOCondition cond, result, &data_r, event_info->cb, event_info->user_data); + if (bluetooth_get_battery_monitor_state()) { + int ret = _bt_common_send_rfcomm_rx_details(&data_r); + if (ret != BLUETOOTH_ERROR_NONE) + BT_ERR("RFCOMM received data details not sent to battery monitor frwk"); + } + g_free(buffer); + BT_DBG("-"); return TRUE; } @@ -1334,8 +1341,6 @@ BT_EXPORT_API int bluetooth_rfcomm_write(int fd, const char *buf, int length) return BLUETOOTH_ERROR_INVALID_PARAM; } - BT_DBG("FD : %d", fd); - retv_if(length <= 0, BLUETOOTH_ERROR_INVALID_PARAM); switch (privilege_token) { @@ -1362,6 +1367,12 @@ BT_EXPORT_API int bluetooth_rfcomm_write(int fd, const char *buf, int length) return BLUETOOTH_ERROR_INTERNAL; } + if (bluetooth_get_battery_monitor_state()) { + int ret = _bt_common_send_rfcomm_tx_details(length); + if (ret != BLUETOOTH_ERROR_NONE) + BT_ERR("RFCOMM tx data could not be sent"); + } + #ifdef TIZEN_FEATURE_BT_RFCOMM_DIRECT written = write(fd, buf, length); /*BT_DBG("Length %d, written = %d, balance(%d)",