Return-Path: From: "Stotland, Inga" To: "a.rai@samsung.com" , "linux-bluetooth@vger.kernel.org" CC: "anupam.r@samsung.com" , "sachin.dev@samsung.com" Subject: Re: [PATCH v3] Mesh: add 'node-reset' command Date: Tue, 20 Mar 2018 15:11:48 +0000 Message-ID: <1521558707.3681.6.camel@intel.com> References: <1521445336-15582-1-git-send-email-a.rai@samsung.com> In-Reply-To: <1521445336-15582-1-git-send-email-a.rai@samsung.com> Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-T3JQlNjC0+07tdGLVpva" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --=-T3JQlNjC0+07tdGLVpva Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Atul, On Mon, 2018-03-19 at 13:12 +0530, Atul Rai wrote: > This patch adds 'node-reset' command which can be used to reset a > node (other than a Provisioner) and remove it from the network. > --- > mesh/config-client.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) >=20 > diff --git a/mesh/config-client.c b/mesh/config-client.c > index 19e617d..a6cd87e 100644 > --- a/mesh/config-client.c > +++ b/mesh/config-client.c > @@ -342,6 +342,17 @@ static bool client_msg_recvd(uint16_t src, > uint8_t *data, > bt_shell_printf("Min Hops\t%2.2x\n", data[7]); > bt_shell_printf("Max Hops\t%2.2x\n", data[8]); > break; > + > + /* Per Mesh Profile 4.3.2.54 */ > + case OP_NODE_RESET_STATUS: > + bt_shell_printf("Node %4.4x reset status %s\n", > + src, mesh_status_str(data[0])); > + > + net_release_address(node_get_primary(node), > + (node_get_num_elements(node))); > + /* TODO: Remove node info from database */ > + node_free(node); > + break; > } > =20 > return true; > @@ -1124,6 +1135,11 @@ static void cmd_ttl_get(int argc, char > *argv[]) > cmd_default(OP_CONFIG_DEFAULT_TTL_GET); > } > =20 > +static void cmd_node_reset(int argc, char *argv[]) > +{ > + cmd_default(OP_NODE_RESET); > +} > + > static const struct bt_shell_menu cfg_menu =3D { > .name =3D "config", > .desc =3D "Configuration Model Submenu", > @@ -1179,6 +1195,8 @@ static const struct bt_shell_menu cfg_menu =3D { > cmd_sub_add, "Add subscription"}, > {"sub-get", " ", > cmd_sub_get, "Get subscription"}, > + {"node-reset", NULL, cmd_n > ode_reset, > + "Reset a node and remove it from > network"}, > {} }, > }; > =20 This looks fine. Thanks, Inga --=-T3JQlNjC0+07tdGLVpva Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKbTCCBOsw ggPToAMCAQICEDabxALowUBS+21KC0JI8fcwDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0 d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9vdDAeFw0xMzEyMTEwMDAwMDBa Fw0yMDA1MzAxMDQ4MzhaMHkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEUMBIGA1UEBxMLU2Fu dGEgQ2xhcmExGjAYBgNVBAoTEUludGVsIENvcnBvcmF0aW9uMSswKQYDVQQDEyJJbnRlbCBFeHRl cm5hbCBCYXNpYyBJc3N1aW5nIENBIDRCMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA yzuW/y/g0bznz8BD48M94luFzqHaqY9yGN9H/W0J7hOVBpl0rTQJ6kZ7z7hyDb9kf2UW4ZU25alC i+q5m6NwHg+z9pcN7bQ84SSBueaYF7cXlAg7z3XyZbzSEYP7raeuWRf5fYvYzq8/uI7VNR8o/43w PtDP10YDdO/0J5xrHxnC/9/aU+wTFSVsPqxsd7C58mnu7G4VRJ0n9PG4SfmYNC0h/5fLWuOWhxAv 6MuiK7M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