Diff between c2555c31491191be0e860e9726555eb2bd881104 and ac57ca0008a61906318034df7837b9ac11b950c5

Changed Files

File Additions Deletions Status
tools/btmgmt.c +8 -8 modified

Full Patch

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index e24dcf8..b239ec8 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -211,18 +211,18 @@ static void controller_error(uint16_t index, uint16_t len,
 		printf("hci%u error 0x%02x\n", index, ev->error_code);
 }
 
-static int mgmt_index_added(int mgmt_sk, uint16_t index)
+static void index_added(uint16_t index, uint16_t len,
+				const void *param, void *user_data)
 {
 	if (monitor)
 		printf("hci%u added\n", index);
-	return 0;
 }
 
-static int mgmt_index_removed(int mgmt_sk, uint16_t index)
+static void index_removed(uint16_t index, uint16_t len,
+				const void *param, void *user_data)
 {
 	if (monitor)
 		printf("hci%u removed\n", index);
-	return 0;
 }
 
 static const char *settings_str[] = {
@@ -714,10 +714,6 @@ static int mgmt_handle_event(int mgmt_sk, uint16_t ev, uint16_t index,
 		return mgmt_cmd_complete(mgmt_sk, index, data, len);
 	case MGMT_EV_CMD_STATUS:
 		return mgmt_cmd_status(mgmt_sk, index, data, len);
-	case MGMT_EV_INDEX_ADDED:
-		return mgmt_index_added(mgmt_sk, index);
-	case MGMT_EV_INDEX_REMOVED:
-		return mgmt_index_removed(mgmt_sk, index);
 	case MGMT_EV_NEW_SETTINGS:
 		return mgmt_new_settings(mgmt_sk, index, data, len);
 	case MGMT_EV_DISCOVERING:
@@ -2032,6 +2028,10 @@ int main(int argc, char *argv[])
 
 	mgmt_register(mgmt, MGMT_EV_CONTROLLER_ERROR, index, controller_error,
 								NULL, NULL);
+	mgmt_register(mgmt, MGMT_EV_INDEX_ADDED, index, index_added,
+								NULL, NULL);
+	mgmt_register(mgmt, MGMT_EV_INDEX_REMOVED, index, index_removed,
+								NULL, NULL);
 
 	pollfd.fd = mgmt_sk;
 	pollfd.events = POLLIN;