diff mbox series

[BlueZ,4/6] tools/mesh-gatt: Add subscription delete message to config client model

Message ID 20211207225604.35156-5-daniele.biagetti@cblelectronics.com (mailing list archive)
State Changes Requested
Headers show
Series tools/mesh-gatt meshctl tool improvements | expand

Checks

Context Check Description
tedd_an/checkpatch fail [BlueZ,4/6] tools/mesh-gatt: Add subscription delete message to config client model ERROR:CODE_INDENT: code indent should use tabs where possible #96: FILE: tools/mesh-gatt/config-client.c:1042: + uint16_t n;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #96: FILE: tools/mesh-gatt/config-client.c:1042: + uint16_t n;$ ERROR:CODE_INDENT: code indent should use tabs where possible #97: FILE: tools/mesh-gatt/config-client.c:1043: + uint8_t msg[32];$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #97: FILE: tools/mesh-gatt/config-client.c:1043: + uint8_t msg[32];$ ERROR:CODE_INDENT: code indent should use tabs where possible #98: FILE: tools/mesh-gatt/config-client.c:1044: + int parm_cnt;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #98: FILE: tools/mesh-gatt/config-client.c:1044: + int parm_cnt;$ ERROR:CODE_INDENT: code indent should use tabs where possible #100: FILE: tools/mesh-gatt/config-client.c:1046: + if (IS_UNASSIGNED(target)) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #100: FILE: tools/mesh-gatt/config-client.c:1046: + if (IS_UNASSIGNED(target)) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #101: FILE: tools/mesh-gatt/config-client.c:1047: + bt_shell_printf("Destination not set\n");$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #101: FILE: tools/mesh-gatt/config-client.c:1047: + bt_shell_printf("Destination not set\n");$ ERROR:CODE_INDENT: code indent should use tabs where possible #102: FILE: tools/mesh-gatt/config-client.c:1048: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #102: FILE: tools/mesh-gatt/config-client.c:1048: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #103: FILE: tools/mesh-gatt/config-client.c:1049: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #103: FILE: tools/mesh-gatt/config-client.c:1049: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #105: FILE: tools/mesh-gatt/config-client.c:1051: + n = mesh_opcode_set(OP_CONFIG_MODEL_SUB_DELETE, msg);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #105: FILE: tools/mesh-gatt/config-client.c:1051: + n = mesh_opcode_set(OP_CONFIG_MODEL_SUB_DELETE, msg);$ ERROR:CODE_INDENT: code indent should use tabs where possible #107: FILE: tools/mesh-gatt/config-client.c:1053: + parm_cnt = read_input_parameters(argc, argv);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #107: FILE: tools/mesh-gatt/config-client.c:1053: + parm_cnt = read_input_parameters(argc, argv);$ ERROR:CODE_INDENT: code indent should use tabs where possible #108: FILE: tools/mesh-gatt/config-client.c:1054: + if (parm_cnt != 3) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #108: FILE: tools/mesh-gatt/config-client.c:1054: + if (parm_cnt != 3) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #109: FILE: tools/mesh-gatt/config-client.c:1055: + bt_shell_printf("Bad arguments: %s\n", argv[1]);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #109: FILE: tools/mesh-gatt/config-client.c:1055: + bt_shell_printf("Bad arguments: %s\n", argv[1]);$ ERROR:CODE_INDENT: code indent should use tabs where possible #110: FILE: tools/mesh-gatt/config-client.c:1056: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #110: FILE: tools/mesh-gatt/config-client.c:1056: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #111: FILE: tools/mesh-gatt/config-client.c:1057: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #111: FILE: tools/mesh-gatt/config-client.c:1057: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #113: FILE: tools/mesh-gatt/config-client.c:1059: + /* Per Mesh Profile 4.3.2.19 */$ ERROR:CODE_INDENT: code indent should use tabs where possible #114: FILE: tools/mesh-gatt/config-client.c:1060: + /* Element Address */$ ERROR:CODE_INDENT: code indent should use tabs where possible #115: FILE: tools/mesh-gatt/config-client.c:1061: + put_le16(parms[0], msg + n);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #115: FILE: tools/mesh-gatt/config-client.c:1061: + put_le16(parms[0], msg + n);$ ERROR:CODE_INDENT: code indent should use tabs where possible #116: FILE: tools/mesh-gatt/config-client.c:1062: + n += 2;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #116: FILE: tools/mesh-gatt/config-client.c:1062: + n += 2;$ ERROR:CODE_INDENT: code indent should use tabs where possible #117: FILE: tools/mesh-gatt/config-client.c:1063: + /* Subscription Address */$ ERROR:CODE_INDENT: code indent should use tabs where possible #118: FILE: tools/mesh-gatt/config-client.c:1064: + put_le16(parms[1], msg + n);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #118: FILE: tools/mesh-gatt/config-client.c:1064: + put_le16(parms[1], msg + n);$ ERROR:CODE_INDENT: code indent should use tabs where possible #119: FILE: tools/mesh-gatt/config-client.c:1065: + n += 2;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #119: FILE: tools/mesh-gatt/config-client.c:1065: + n += 2;$ ERROR:CODE_INDENT: code indent should use tabs where possible #120: FILE: tools/mesh-gatt/config-client.c:1066: + /* SIG Model ID */$ ERROR:CODE_INDENT: code indent should use tabs where possible #121: FILE: tools/mesh-gatt/config-client.c:1067: + put_le16(parms[2], msg + n);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #121: FILE: tools/mesh-gatt/config-client.c:1067: + put_le16(parms[2], msg + n);$ ERROR:CODE_INDENT: code indent should use tabs where possible #122: FILE: tools/mesh-gatt/config-client.c:1068: + n += 2;$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #122: FILE: tools/mesh-gatt/config-client.c:1068: + n += 2;$ ERROR:CODE_INDENT: code indent should use tabs where possible #124: FILE: tools/mesh-gatt/config-client.c:1070: + if (!config_send(msg, n)) {$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #124: FILE: tools/mesh-gatt/config-client.c:1070: + if (!config_send(msg, n)) {$ ERROR:CODE_INDENT: code indent should use tabs where possible #125: FILE: tools/mesh-gatt/config-client.c:1071: + bt_shell_printf("Failed to send \"DELETE SUBSCRIPTION\"\n");$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #125: FILE: tools/mesh-gatt/config-client.c:1071: + bt_shell_printf("Failed to send \"DELETE SUBSCRIPTION\"\n");$ ERROR:CODE_INDENT: code indent should use tabs where possible #126: FILE: tools/mesh-gatt/config-client.c:1072: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #126: FILE: tools/mesh-gatt/config-client.c:1072: + return bt_shell_noninteractive_quit(EXIT_FAILURE);$ ERROR:CODE_INDENT: code indent should use tabs where possible #127: FILE: tools/mesh-gatt/config-client.c:1073: + }$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #127: FILE: tools/mesh-gatt/config-client.c:1073: + }$ ERROR:CODE_INDENT: code indent should use tabs where possible #129: FILE: tools/mesh-gatt/config-client.c:1075: + return bt_shell_noninteractive_quit(EXIT_SUCCESS);$ WARNING:LEADING_SPACE: please, no spaces at the start of a line #129: FILE: tools/mesh-gatt/config-client.c:1075: + return bt_shell_noninteractive_quit(EXIT_SUCCESS);$ /github/workspace/src/12662889.patch total: 28 errors, 24 warnings, 52 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. NOTE: Whitespace errors detected. You may wish to use scripts/cleanpatch or scripts/cleanfile /github/workspace/src/12662889.patch has style problems, please review. NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
tedd_an/gitlint fail [BlueZ,4/6] tools/mesh-gatt: Add subscription delete message to config client model 1: T1 Title exceeds max length (83>80): "[BlueZ,4/6] tools/mesh-gatt: Add subscription delete message to config client model"

Commit Message

Daniele Biagetti Dec. 7, 2021, 10:56 p.m. UTC
---
 tools/mesh-gatt/config-client.c | 40 +++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
diff mbox series

Patch

diff --git a/tools/mesh-gatt/config-client.c b/tools/mesh-gatt/config-client.c
index 7bdd028d2..c61908b4e 100644
--- a/tools/mesh-gatt/config-client.c
+++ b/tools/mesh-gatt/config-client.c
@@ -1037,6 +1037,44 @@  static void cmd_sub_get(int argc, char *argv[])
 	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
+static void cmd_sub_del(int argc, char *argv[])
+{
+        uint16_t n;
+        uint8_t msg[32];
+        int parm_cnt;
+
+        if (IS_UNASSIGNED(target)) {
+                bt_shell_printf("Destination not set\n");
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        }
+
+        n = mesh_opcode_set(OP_CONFIG_MODEL_SUB_DELETE, msg);
+
+        parm_cnt = read_input_parameters(argc, argv);
+        if (parm_cnt != 3) {
+                bt_shell_printf("Bad arguments: %s\n", argv[1]);
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        }
+
+        /* Per Mesh Profile 4.3.2.19 */
+        /* Element Address */
+        put_le16(parms[0], msg + n);
+        n += 2;
+        /* Subscription Address */
+        put_le16(parms[1], msg + n);
+        n += 2;
+        /* SIG Model ID */
+        put_le16(parms[2], msg + n);
+        n += 2;
+
+        if (!config_send(msg, n)) {
+                bt_shell_printf("Failed to send \"DELETE SUBSCRIPTION\"\n");
+                return bt_shell_noninteractive_quit(EXIT_FAILURE);
+        }
+
+        return bt_shell_noninteractive_quit(EXIT_SUCCESS);
+}
+
 static void cmd_mod_appidx_get(int argc, char *argv[])
 {
 	uint16_t n;
@@ -1232,6 +1270,8 @@  static const struct bt_shell_menu cfg_menu = {
 				cmd_sub_add,    "Add subscription"},
 	{"sub-get", "<ele_addr> <model id>",
 				cmd_sub_get,    "Get subscription"},
+	{"sub-del", "<ele_addr> <sub_addr> <model id>",
+				cmd_sub_del,    "Delete subscription"},
 	{"node-reset",		NULL,                    cmd_node_reset,
 				"Reset a node and remove it from network"},
 	{} },