diff mbox series

[BlueZ,v3,1/4] mgmt:adding load default system configuration definitions

Message ID 20200529153814.213125-2-alainm@chromium.org (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series Load default system configuration from file. | expand

Commit Message

Alain Michaud May 29, 2020, 3:38 p.m. UTC
This change adds the load default system configuration definitions

---

Changes in v3: None
Changes in v2: None

 lib/mgmt.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Luiz Augusto von Dentz June 4, 2020, 10:58 p.m. UTC | #1
Hi Alain,

On Fri, May 29, 2020 at 8:42 AM Alain Michaud <alainm@chromium.org> wrote:
>
> This change adds the load default system configuration definitions
>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  lib/mgmt.h | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/lib/mgmt.h b/lib/mgmt.h
> index b4fc72069..ea89c46b1 100644
> --- a/lib/mgmt.h
> +++ b/lib/mgmt.h
> @@ -628,6 +628,24 @@ struct mgmt_rp_set_exp_feature {
>         uint32_t flags;
>  } __packed;
>
> +#define MGMT_OP_READ_DEFAULT_SYSTEM_PARAMETERS 0x004b
> +
> +struct mgmt_system_parameter_tlv {
> +       uint16_t parameter_type;
> +       uint8_t length;
> +       uint8_t value[];
> +} __packed;
> +
> +struct mgmt_rp_read_default_system_parameters {
> +       uint8_t parameters[0]; // mgmt_system_parameter_tlv
> +} __packed;
> +
> +#define MGMT_OP_SET_DEFAULT_SYSTEM_PARAMETERS  0x004c
> +
> +struct mgmt_cp_set_default_system_parameters {
> +       uint8_t parameters[0]; // mgmt_system_parameter_tlv
> +} __packed;
> +
>  #define MGMT_EV_CMD_COMPLETE           0x0001
>  struct mgmt_ev_cmd_complete {
>         uint16_t opcode;
> @@ -933,6 +951,8 @@ static const char *mgmt_op[] = {
>         "Read Security Information",                    /* 0x0048 */
>         "Read Experimental Features Information",
>         "Set Experimental Feature",
> +       "Read Default System Configuration",
> +       "Set Default System Configuration",
>  };
>
>  static const char *mgmt_ev[] = {
> --
> 2.27.0.rc0.183.gde8f92d652-goog

Applied 1-3, thanks. I could not make up my mind regarding 4/4, while
it seems correct it doesn't seem to be a common practice on C projects
(e.g: linux, zephyr, etc.), most likely because it would not save much
in practice since it just making const pointer while the string
literal is already marked as const.
Alain Michaud June 5, 2020, 2:03 p.m. UTC | #2
Thanks Luiz.


On Thu, Jun 4, 2020 at 6:58 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Alain,
>
> On Fri, May 29, 2020 at 8:42 AM Alain Michaud <alainm@chromium.org> wrote:
> >
> > This change adds the load default system configuration definitions
> >
> > ---
> >
> > Changes in v3: None
> > Changes in v2: None
> >
> >  lib/mgmt.h | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/lib/mgmt.h b/lib/mgmt.h
> > index b4fc72069..ea89c46b1 100644
> > --- a/lib/mgmt.h
> > +++ b/lib/mgmt.h
> > @@ -628,6 +628,24 @@ struct mgmt_rp_set_exp_feature {
> >         uint32_t flags;
> >  } __packed;
> >
> > +#define MGMT_OP_READ_DEFAULT_SYSTEM_PARAMETERS 0x004b
> > +
> > +struct mgmt_system_parameter_tlv {
> > +       uint16_t parameter_type;
> > +       uint8_t length;
> > +       uint8_t value[];
> > +} __packed;
> > +
> > +struct mgmt_rp_read_default_system_parameters {
> > +       uint8_t parameters[0]; // mgmt_system_parameter_tlv
> > +} __packed;
> > +
> > +#define MGMT_OP_SET_DEFAULT_SYSTEM_PARAMETERS  0x004c
> > +
> > +struct mgmt_cp_set_default_system_parameters {
> > +       uint8_t parameters[0]; // mgmt_system_parameter_tlv
> > +} __packed;
> > +
> >  #define MGMT_EV_CMD_COMPLETE           0x0001
> >  struct mgmt_ev_cmd_complete {
> >         uint16_t opcode;
> > @@ -933,6 +951,8 @@ static const char *mgmt_op[] = {
> >         "Read Security Information",                    /* 0x0048 */
> >         "Read Experimental Features Information",
> >         "Set Experimental Feature",
> > +       "Read Default System Configuration",
> > +       "Set Default System Configuration",
> >  };
> >
> >  static const char *mgmt_ev[] = {
> > --
> > 2.27.0.rc0.183.gde8f92d652-goog
>
> Applied 1-3, thanks. I could not make up my mind regarding 4/4, while
> it seems correct it doesn't seem to be a common practice on C projects
> (e.g: linux, zephyr, etc.), most likely because it would not save much
> in practice since it just making const pointer while the string
> literal is already marked as const.
>
> --
> Luiz Augusto von Dentz
diff mbox series

Patch

diff --git a/lib/mgmt.h b/lib/mgmt.h
index b4fc72069..ea89c46b1 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -628,6 +628,24 @@  struct mgmt_rp_set_exp_feature {
 	uint32_t flags;
 } __packed;
 
+#define MGMT_OP_READ_DEFAULT_SYSTEM_PARAMETERS	0x004b
+
+struct mgmt_system_parameter_tlv {
+	uint16_t parameter_type;
+	uint8_t length;
+	uint8_t value[];
+} __packed;
+
+struct mgmt_rp_read_default_system_parameters {
+	uint8_t parameters[0]; // mgmt_system_parameter_tlv
+} __packed;
+
+#define MGMT_OP_SET_DEFAULT_SYSTEM_PARAMETERS	0x004c
+
+struct mgmt_cp_set_default_system_parameters {
+	uint8_t parameters[0]; // mgmt_system_parameter_tlv
+} __packed;
+
 #define MGMT_EV_CMD_COMPLETE		0x0001
 struct mgmt_ev_cmd_complete {
 	uint16_t opcode;
@@ -933,6 +951,8 @@  static const char *mgmt_op[] = {
 	"Read Security Information",			/* 0x0048 */
 	"Read Experimental Features Information",
 	"Set Experimental Feature",
+	"Read Default System Configuration",
+	"Set Default System Configuration",
 };
 
 static const char *mgmt_ev[] = {