Message correctness is verified upon reception and handling functions can simply make assumption that data in buffer is correct. --- android/main.c | 3 +-- android/socket.c | 3 +-- android/socket.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/android/main.c b/android/main.c index 08bba4e..9cc3e1d 100644 --- a/android/main.c +++ b/android/main.c @@ -255,8 +255,7 @@ static gboolean cmd_watch_cb(GIOChannel *io, GIOCondition cond, bt_hid_handle_cmd(hal_cmd_io, msg->opcode, msg->payload); break; case HAL_SERVICE_ID_SOCK: - bt_sock_handle_cmd(hal_cmd_io, msg->opcode, msg->payload, - msg->len); + bt_sock_handle_cmd(hal_cmd_io, msg->opcode, msg->payload); break; case HAL_SERVICE_ID_A2DP: bt_a2dp_handle_cmd(hal_cmd_io, msg->opcode, msg->payload, diff --git a/android/socket.c b/android/socket.c index e32be46..b9c556f 100644 --- a/android/socket.c +++ b/android/socket.c @@ -50,8 +50,7 @@ static int handle_connect(void *buf) return -1; } -void bt_sock_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, - uint16_t len) +void bt_sock_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf) { int fd; diff --git a/android/socket.h b/android/socket.h index 2b3b940..69cfc58 100644 --- a/android/socket.h +++ b/android/socket.h @@ -21,8 +21,7 @@ * */ -void bt_sock_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, - uint16_t len); +void bt_sock_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf); bool bt_socket_register(GIOChannel *io, const bdaddr_t *addr); void bt_socket_unregister(void); -- 1.8.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html