Return-Path: MIME-Version: 1.0 In-Reply-To: <82d16f33-c657-49b5-8eea-570b8f082adc@silvair.com> References: <20180402192920.19111-1-robert.lubas@silvair.com> <82d16f33-c657-49b5-8eea-570b8f082adc@silvair.com> From: Luiz Augusto von Dentz Date: Fri, 6 Apr 2018 09:09:47 +0300 Message-ID: Subject: Re: [PATCH BlueZ 1/2] Mesh: Add Config Beacon to Configuration Model To: Robert Lubas Cc: "Stotland, Inga" , "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Robert, On Thu, Apr 5, 2018 at 10:42 AM, Robert Lubas wr= ote: > Hi Inga, Luiz, > > > On 04/03/2018 06:27 PM, Stotland, Inga wrote: >> >> Hi Robert, Luiz, >> >> -----Original Message----- >> From: linux-bluetooth-owner@vger.kernel.org >> [mailto:linux-bluetooth-owner@vger.kernel.org] On Behalf Of Robert Lubas >> Sent: Tuesday, April 3, 2018 5:09 AM >> To: Luiz Augusto von Dentz >> Cc: linux-bluetooth@vger.kernel.org >> Subject: Re: [PATCH BlueZ 1/2] Mesh: Add Config Beacon to Configuration >> Model >> >> Hi Luiz, >> >> On 04/03/2018 10:18 AM, Luiz Augusto von Dentz wrote: >>> >>> Hi Robert, >>> >>> On Mon, Apr 2, 2018 at 10:29 PM, Robert Luba=C5=9B >>> wrote: >>>> >>>> This patch adds two commands (set and get) to menu config and handles >>>> the incomming status message. >>>> --- >>>> mesh/config-client.c | 42 +++++++++++++++++++++++++++++++++++++++++= + >>>> 1 file changed, 42 insertions(+) >>>> >>>> diff --git a/mesh/config-client.c b/mesh/config-client.c index >>>> 95297bfee..4e5e06258 100644 >>>> --- a/mesh/config-client.c >>>> +++ b/mesh/config-client.c >>>> @@ -179,6 +179,13 @@ static bool client_msg_recvd(uint16_t src, uint8_= t >>>> *data, >>>> mesh_status_str(data[0])); >>>> break; >>>> >>>> + case OP_CONFIG_BEACON_STATUS: >>>> + if (len !=3D 1) >>>> + return true; >>>> + bt_shell_printf("Node %4.4x Config Beacon Status >>>> 0x%02x\n", >>>> + src, data[0]); >>>> + break; >>>> + >>>> case OP_CONFIG_RELAY_STATUS: >>>> if (len !=3D 2) >>>> return true; @@ -689,6 +696,37 @@ static >>>> void cmd_bind(int argc, char *argv[]) >>>> return bt_shell_noninteractive_quit(EXIT_SUCCESS); >>>> } >>>> >>>> +static void cmd_beacon_set(int argc, char *argv[]) { >>>> + uint16_t n; >>>> + uint8_t msg[2 + 1]; >>>> + int parm_cnt; >>>> + >>>> + if (!verify_config_target(target)) >>>> + return bt_shell_noninteractive_quit(EXIT_FAILURE); >>>> + >>>> + n =3D mesh_opcode_set(OP_CONFIG_BEACON_SET, msg); >>>> + >>>> + parm_cnt =3D read_input_parameters(argc, argv); >>>> + if (parm_cnt !=3D 1) { >>>> + bt_shell_printf("bad arguments\n"); >>>> + return bt_shell_noninteractive_quit(EXIT_FAILURE); >>>> + } >>>> + >>>> + msg[n++] =3D parms[0]; >>>> + >>>> + if (!config_send(msg, n)) { >>>> + bt_shell_printf("Failed to send \"SET BEACON\"\n"); >>>> + return; >>>> + } >>>> + >>>> + return bt_shell_noninteractive_quit(EXIT_SUCCESS);} >>> >>> >>> You should have a like break before } >>> >>>> + >>>> +static void cmd_beacon_get(int argc, char *argv[]) { >>>> + cmd_default(OP_CONFIG_BEACON_GET); >>>> +} >>>> + >>>> static void cmd_ident_set(int argc, char *argv[]) >>>> { >>>> uint16_t n; >>>> @@ -1178,6 +1216,10 @@ static const struct bt_shell_menu cfg_menu =3D = { >>>> "Set node identity >>>> state"}, >>>> {"ident-get", "", cmd_ident_ge= t, >>>> "Get node identity >>>> state"}, >>>> + {"beacon-set", "", cmd_beacon_set= , >>>> + "Set node identity >>>> state"}, >>>> + {"beacon-get", NULL, cmd_beacon_get= , >>>> + "Get node beacon >>>> + state"}, >>>> {"relay-set", " = ", >>>> cmd_relay_set, >>>> "Set relay"}, >>>> -- >>>> 2.11.0 >>> >>> >>> Other than this looks good, lets see if Inga has anything to comment. >>> >> The broken line goes to V2. >> >> Thanks >> -- >> >> The patches look fine. >> Thanks, >> Inga >> >> > > I include small fix (broken line) after Luiz review. There is a separate > dangling e-mail with patch. Applied, thanks. --=20 Luiz Augusto von Dentz