return &user_info[type];
}
-int _bt_common_send_rfcomm_rx_details(int len)
+int _bt_common_send_rfcomm_rx_details(unsigned int len)
{
uid_t uid = getuid();
pid_t pid = getpid();
- int size = len;
+ unsigned int size = len;
int ret = BLUETOOTH_ERROR_NONE;
BT_INFO("+");
g_array_append_vals(in_param1, &uid, sizeof(uid_t));
g_array_append_vals(in_param2, &pid, sizeof(pid_t));
- g_array_append_vals(in_param3, &size, sizeof(int));
+ g_array_append_vals(in_param3, &size, sizeof(unsigned int));
ret = _bt_send_request(BT_BLUEZ_SERVICE, BT_RFCOMM_SEND_RX_DETAILS,
in_param1, in_param2, in_param3, in_param4, &out_param);
return ret;
}
-int _bt_common_send_rfcomm_tx_details(int len)
+int _bt_common_send_rfcomm_tx_details(unsigned int len)
{
uid_t uid = getuid();
pid_t pid = getpid();
- int size = len;
+ unsigned int size = len;
int ret = BLUETOOTH_ERROR_NONE;
BT_INFO("+");
g_array_append_vals(in_param1, &uid, sizeof(uid_t));
g_array_append_vals(in_param2, &pid, sizeof(pid_t));
- g_array_append_vals(in_param3, &size, sizeof(int));
+ g_array_append_vals(in_param3, &size, sizeof(unsigned int));
ret = _bt_send_request(BT_BLUEZ_SERVICE, BT_RFCOMM_SEND_TX_DETAILS,
in_param1, in_param2, in_param3, in_param4, &out_param);
BT_INFO("Adding rfcomm tx timeout function for battery monitor");
tx_tag = g_timeout_add_seconds(BATTERY_MONITOR_RFCOMM_INTERVAL, (GSourceFunc)__rfcomm_record_tx_data, NULL);
}
- tx_data += length;
+ tx_data += written;
}
return written;
#else
BT_INFO("Adding rfcomm tx timeout function for battery monitor");
tx_tag = g_timeout_add_seconds(BATTERY_MONITOR_RFCOMM_INTERVAL, (GSourceFunc)__rfcomm_record_tx_data, NULL);
}
- tx_data += length;
+ tx_data += written;
}
return result;
#endif
void _bt_convert_addr_type_to_secure_string(char *address, unsigned char *addr);
-int _bt_common_send_rfcomm_rx_details(int len);
+int _bt_common_send_rfcomm_rx_details(unsigned int len);
-int _bt_common_send_rfcomm_tx_details(int len);
+int _bt_common_send_rfcomm_tx_details(unsigned int len);
int _bt_common_send_rfcomm_conn_info(int role, gboolean connected, int client_fd);
int size;
__bt_service_get_parameters(in_param1, &uid, sizeof(uid_t));
__bt_service_get_parameters(in_param2, &pid, sizeof(pid_t));
- __bt_service_get_parameters(in_param3, &size, sizeof(int));
+ __bt_service_get_parameters(in_param3, &size, sizeof(unsigned int));
BT_DBG("Sending details to bluetooth battery monitor: %ld, %ld, %d", (long int)uid, (long int)pid, size);
_bt_bm_add_transaction_details(uid, pid, size, RX_DATA);
break;
int size;
__bt_service_get_parameters(in_param1, &uid, sizeof(uid_t));
__bt_service_get_parameters(in_param2, &pid, sizeof(pid_t));
- __bt_service_get_parameters(in_param3, &size, sizeof(int));
+ __bt_service_get_parameters(in_param3, &size, sizeof(unsigned int));
BT_DBG("Sending details to bluetooth battery monitor: %ld, %ld, %d", (long int)uid, (long int)pid, size);
_bt_bm_add_transaction_details(uid, pid, size, TX_DATA);
break;
uint32_t rx_time = 0;
uint32_t idle_time = 0;
uint32_t energy_used = 0;
- uint16_t scan_time_per_app = 0;
+ uint32_t scan_time_per_app = 0;
int scan_app_cnt = 0;
BT_DBG("");
data->session_scan_time = current_session_data->session_scan_time;
if (scan_cnt) {
- data->session_scan_time += (uint16_t)__bt_dm_time_diff_msec(scan_start, cur_time);
+ data->session_scan_time += (uint32_t)__bt_dm_time_diff_msec(scan_start, cur_time);
gettimeofday(&scan_start, 0);
}
current_session_data->session_scan_time = 0;
data->session_connected_time = current_session_data->session_connected_time;
if (connect_cnt) {
- data->session_connected_time += (uint16_t)__bt_dm_time_diff_msec(connect_start, cur_time);
+ data->session_connected_time += (uint32_t)__bt_dm_time_diff_msec(connect_start, cur_time);
gettimeofday(&connect_start, 0);
}
current_session_data->session_connected_time = 0;
return NULL;
}
-void _bt_bm_add_transaction_details(uid_t uid, pid_t pid, int value, data_transaction_type_e type)
+void _bt_bm_add_transaction_details(uid_t uid, pid_t pid, unsigned int value, data_transaction_type_e type)
{
if (is_session_started == FALSE)
__bt_start_session_time();
struct timeval cur_time;
gettimeofday(&cur_time, 0);
- current_session_data->session_scan_time += (uint16_t)(__bt_dm_time_diff_msec(scan_start, cur_time));
+ current_session_data->session_scan_time += (uint32_t)(__bt_dm_time_diff_msec(scan_start, cur_time));
gettimeofday(&scan_start, 0);
gettimeofday(&app_scan_base, 0);
}
struct timeval cur_time;
gettimeofday(&cur_time, 0);
- current_session_data->session_connected_time += (uint16_t)(__bt_dm_time_diff_msec(connect_start, cur_time));
+ current_session_data->session_connected_time += (uint32_t)(__bt_dm_time_diff_msec(connect_start, cur_time));
}
}
}
typedef struct {
uid_t uid;
pid_t pid;
- uint16_t rx_bytes;
- uint16_t tx_bytes;
+ uint32_t rx_bytes;
+ uint32_t tx_bytes;
uint time;
} _bt_battery_app_data_t;
uint32_t tx_time;
uint32_t rx_time;
uint32_t idle_time;
- uint16_t session_connected_time;
- uint16_t session_scan_time;
+ uint32_t session_connected_time;
+ uint32_t session_scan_time;
GSList *atm_list;
} _bt_battery_data_t;
int _bt_bm_read_data(_bt_battery_data_t *data);
-void _bt_bm_add_transaction_details(uid_t uid, pid_t pid, int size, data_transaction_type_e type);
+void _bt_bm_add_transaction_details(uid_t uid, pid_t pid, unsigned int size, data_transaction_type_e type);
void _bt_bm_add_scan_app(bt_bm_scan_type_e type, uid_t uid, pid_t pid);
uint32_t tx_time;
uint32_t rx_time;
uint32_t idle_time;
- uint16_t session_connected_time;
- uint16_t session_scan_time;
+ uint32_t session_connected_time;
+ uint32_t session_scan_time;
GSList *atm_list;
} bt_battery_data;
typedef struct {
uid_t uid;
pid_t pid;
- uint16_t rx_bytes;
- uint16_t tx_bytes;
+ uint32_t rx_bytes;
+ uint32_t tx_bytes;
uint time;
} bt_battery_app_data;