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);
BT_ERR("IO Channel read is failed with %d", status);
g_free(buffer);
- if (err) {
- BT_ERR("IO Channel read error [%s]", err->message);
- if (status == G_IO_STATUS_ERROR &&
- __is_error_by_disconnect(err)) {
+ if (err || status == G_IO_STATUS_EOF) {
+ if (err)
+ BT_ERR("IO Channel read error [%s]", err->message);
+ if ((status == G_IO_STATUS_EOF) ||
+ (status == G_IO_STATUS_ERROR &&
+ __is_error_by_disconnect(err))) {
+
BT_ERR("cond : %d", cond);
- g_error_free(err);
+ if (err)
+ g_error_free(err);
conn_info = __get_conn_info_from_fd(info, fd);
if (conn_info == NULL) {
__rfcomm_client_disconnect(info);
return FALSE;
}
- g_error_free(err);
+ if (err)
+ g_error_free(err);
}
return TRUE;
}
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;
}
return BLUETOOTH_ERROR_INVALID_PARAM;
}
- BT_DBG("FD : %d", fd);
-
retv_if(length <= 0, BLUETOOTH_ERROR_INVALID_PARAM);
switch (privilege_token) {
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)",