Diff between f60a1b5fee8e539637596adb29b8add6651dd836 and e7f5c5175b70788f04261201d2994033c8b888cc

Changed Files

File Additions Deletions Status
doc/mgmt-api.txt +29 -28 modified
lib/mgmt.h +20 -20 modified

Full Patch

diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt
index df77845..cb84f4e 100644
--- a/doc/mgmt-api.txt
+++ b/doc/mgmt-api.txt
@@ -192,10 +192,25 @@ Set Device Class
 	This command will also implicitly disable caching of pending CoD
 	and EIR updates.
 
+
+Set Local Name Command
+======================
+
+	Command Code:		0x000F
+	Controller Index:	<controller id>
+	Command Parameters:	Name (249 Octets)
+				Short_Name (11 Octets)
+	Return Parameters:	Name (249 Octets)
+				Short_Name (11 Octets)
+
+	The name parameters need to always end with a nul byte (failure
+	to do so will cause the command to fail).
+
+
 Add UUID Command
 ================
 
-	Command Code:		0x000F
+	Command Code:		0x0010
 	Controller Index:	<controller id>
 	Command Parameters:	UUID (16 Octets)
 				SVC_Hint (1 Octet)
@@ -205,7 +220,7 @@ Add UUID Command
 Remove UUID Command
 ===================
 
-	Command Code:		0x0010
+	Command Code:		0x0011
 	Controller Index:	<controller id>
 	Command Parameters:	UUID (16 Octets)
 	Return Parameters:	Class_Of_Device (3 Octets)
@@ -214,7 +229,7 @@ Remove UUID Command
 Load Link Keys Command
 ======================
 
-	Command Code:		0x0011
+	Command Code:		0x0012
 	Controller Index:	<controller id>
 	Command Parameters:	Debug_Keys (1 Octet)
 				Key_Count (2 Octets)
@@ -232,7 +247,7 @@ Load Link Keys Command
 Remove Keys Command
 ===================
 
-	Command Code:		0x0012
+	Command Code:		0x0013
 	Controller Index:	<controller id>
 	Command Parameters:	Address (6 Octets)
 				Disconnect (1 Octet)
@@ -245,7 +260,7 @@ Remove Keys Command
 Disconnect Command
 ==================
 
-	Command Code:		0x0013
+	Command Code:		0x0014
 	Controller Index:	<controller id>
 	Command Parameters:	Address (6 Octets)
 	Return Parameters:	Address (6 Octets)
@@ -255,7 +270,7 @@ Disconnect Command
 Get Connections Command
 =======================
 
-	Command Code:		0x0014
+	Command Code:		0x0015
 	Controller Index:	<controller id>
 	Command Parameters:
 	Return Parameters:	Connection_Count (2 Octets)
@@ -275,7 +290,7 @@ Get Connections Command
 PIN Code Reply Command
 =======================
 
-	Command Code:		0x0015
+	Command Code:		0x0016
 	Controller Index:	<controller id>
 	Command Parameters:
 	Return Parameters:	Address (6 Octets)
@@ -286,7 +301,7 @@ PIN Code Reply Command
 PIN Code Negative Reply Command
 ===============================
 
-	Command Code:		0x0016
+	Command Code:		0x0017
 	Controller Index:	<controller id>
 	Command Parameters:
 	Return Parameters:	Address (6 Octets)
@@ -295,7 +310,7 @@ PIN Code Negative Reply Command
 Set IO Capability Command
 =========================
 
-	Command Code:		0x0017
+	Command Code:		0x0018
 	Controller Index:	<controller id>
 	Command Parameters:	IO_Capability (1 Octet)
 	Return Parameters:
@@ -304,7 +319,7 @@ Set IO Capability Command
 Pair Device Command
 ===================
 
-	Command Code:		0x0018
+	Command Code:		0x0019
 	Controller Index:	<controller id>
 	Command Parameters:	Address (6 Octets)
 				Address_Type (1 Octet)
@@ -322,7 +337,7 @@ Pair Device Command
 User Confirmation Reply Command
 ===============================
 
-	Command Code:		0x0019
+	Command Code:		0x001A
 	Controller Index:	<controller id>
 	Command Parameters:	Address (6 Octets)
 	Return Parameters:	Address (6 Octets)
@@ -332,7 +347,7 @@ User Confirmation Reply Command
 User Confirmation Negative Reply Command
 ========================================
 
-	Command Code:		0x001A
+	Command Code:		0x001B
 	Controller Index:	<controller id>
 	Command Parameters:	Address (6 Octets)
 	Return Parameters:	Address (6 Octets)
@@ -342,7 +357,7 @@ User Confirmation Negative Reply Command
 User Passkey Reply Command
 ==========================
 
-	Command Code:		0x001B
+	Command Code:		0x001C
 	Controller Index:	<controller id>
 	Command Parameters:	Address (6 Octets)
 				Passkey (4 Octets)
@@ -353,27 +368,13 @@ User Passkey Reply Command
 User Passkey Negative Reply Command
 ===================================
 
-	Command Code:		0x001C
+	Command Code:		0x001D
 	Controller Index:	<controller id>
 	Command Parameters:	Address (6 Octets)
 	Return Parameters:	Address (6 Octets)
 				Status (1 Octet)
 
 
-Set Local Name Command
-======================
-
-	Command Code:		0x001D
-	Controller Index:	<controller id>
-	Command Parameters:	Name (249 Octets)
-				Short_Name (11 Octets)
-	Return Parameters:	Name (249 Octets)
-				Short_Name (11 Octets)
-
-	The name parameters need to always end with a nul byte (failure
-	to do so will cause the command to fail).
-
-
 Read Local Out Of Band Data Command
 ===================================
 
diff --git a/lib/mgmt.h b/lib/mgmt.h
index 5f653c0..b77970f 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -111,13 +111,19 @@ struct mgmt_cp_set_dev_class {
 	uint8_t minor;
 } __packed;
 
-#define MGMT_OP_ADD_UUID		0x000F
+#define MGMT_OP_SET_LOCAL_NAME		0x000F
+struct mgmt_cp_set_local_name {
+	uint8_t name[MGMT_MAX_NAME_LENGTH];
+	uint8_t short_name[MGMT_MAX_SHORT_NAME_LENGTH];
+} __packed;
+
+#define MGMT_OP_ADD_UUID		0x0010
 struct mgmt_cp_add_uuid {
 	uint8_t uuid[16];
 	uint8_t svc_hint;
 } __packed;
 
-#define MGMT_OP_REMOVE_UUID		0x0010
+#define MGMT_OP_REMOVE_UUID		0x0011
 struct mgmt_cp_remove_uuid {
 	uint8_t uuid[16];
 } __packed;
@@ -129,14 +135,14 @@ struct mgmt_link_key_info {
 	uint8_t pin_len;
 } __packed;
 
-#define MGMT_OP_LOAD_LINK_KEYS		0x0011
+#define MGMT_OP_LOAD_LINK_KEYS		0x0012
 struct mgmt_cp_load_link_keys {
 	uint8_t debug_keys;
 	uint16_t key_count;
 	struct mgmt_link_key_info keys[0];
 } __packed;
 
-#define MGMT_OP_REMOVE_KEYS		0x0012
+#define MGMT_OP_REMOVE_KEYS		0x0013
 struct mgmt_cp_remove_keys {
 	bdaddr_t bdaddr;
 	uint8_t disconnect;
@@ -146,7 +152,7 @@ struct mgmt_rp_remove_keys {
 	uint8_t status;
 } __packed;
 
-#define MGMT_OP_DISCONNECT		0x0013
+#define MGMT_OP_DISCONNECT		0x0014
 struct mgmt_cp_disconnect {
 	bdaddr_t bdaddr;
 } __packed;
@@ -165,30 +171,30 @@ struct mgmt_addr_info {
 	uint8_t type;
 } __packed;
 
-#define MGMT_OP_GET_CONNECTIONS		0x0014
+#define MGMT_OP_GET_CONNECTIONS		0x0015
 struct mgmt_rp_get_connections {
 	uint16_t conn_count;
 	struct mgmt_addr_info addr[0];
 } __packed;
 
-#define MGMT_OP_PIN_CODE_REPLY		0x0015
+#define MGMT_OP_PIN_CODE_REPLY		0x0016
 struct mgmt_cp_pin_code_reply {
 	bdaddr_t bdaddr;
 	uint8_t pin_len;
 	uint8_t pin_code[16];
 } __packed;
 
-#define MGMT_OP_PIN_CODE_NEG_REPLY	0x0016
+#define MGMT_OP_PIN_CODE_NEG_REPLY	0x0017
 struct mgmt_cp_pin_code_neg_reply {
 	bdaddr_t bdaddr;
 } __packed;
 
-#define MGMT_OP_SET_IO_CAPABILITY	0x0017
+#define MGMT_OP_SET_IO_CAPABILITY	0x0018
 struct mgmt_cp_set_io_capability {
 	uint8_t io_capability;
 } __packed;
 
-#define MGMT_OP_PAIR_DEVICE		0x0018
+#define MGMT_OP_PAIR_DEVICE		0x0019
 struct mgmt_cp_pair_device {
 	struct mgmt_addr_info addr;
 	uint8_t io_cap;
@@ -198,7 +204,7 @@ struct mgmt_rp_pair_device {
 	uint8_t status;
 } __packed;
 
-#define MGMT_OP_USER_CONFIRM_REPLY	0x0019
+#define MGMT_OP_USER_CONFIRM_REPLY	0x001A
 struct mgmt_cp_user_confirm_reply {
 	bdaddr_t bdaddr;
 } __packed;
@@ -207,9 +213,9 @@ struct mgmt_rp_user_confirm_reply {
 	uint8_t status;
 } __packed;
 
-#define MGMT_OP_USER_CONFIRM_NEG_REPLY	0x001A
+#define MGMT_OP_USER_CONFIRM_NEG_REPLY	0x001B
 
-#define MGMT_OP_USER_PASSKEY_REPLY	0x001B
+#define MGMT_OP_USER_PASSKEY_REPLY	0x001C
 struct mgmt_cp_user_passkey_reply {
 	bdaddr_t bdaddr;
 	uint32_t passkey;
@@ -219,13 +225,7 @@ struct mgmt_rp_user_passkey_reply {
 	uint8_t status;
 } __packed;
 
-#define MGMT_OP_USER_PASSKEY_NEG_REPLY	0x001C
-
-#define MGMT_OP_SET_LOCAL_NAME		0x001D
-struct mgmt_cp_set_local_name {
-	uint8_t name[MGMT_MAX_NAME_LENGTH];
-	uint8_t short_name[MGMT_MAX_SHORT_NAME_LENGTH];
-} __packed;
+#define MGMT_OP_USER_PASSKEY_NEG_REPLY	0x001D
 
 #define MGMT_OP_READ_LOCAL_OOB_DATA	0x001E
 struct mgmt_rp_read_local_oob_data {