Re: Requested feedback for new advertising MGMT command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daniel,

> We are working on a feature to allow advertising clients to customize
> both advertising intervals and requested tx power for each registered
> advertising set. It is clear that the existing "add advertising" MGMT
> command is not sufficient for these new features, so we have narrowed
> it down to two options for the new interface, and hope for your
> feedback:
> 
> Option 1 replicates existing MGMT command, and in addition provides
> new interval and tx_power members.
> 
> #define MGMT_OP_ADD_EXT_ADVERTISING 0x00??
> struct mgmt_cp_add_ext_advertising {
>    uint8_t  instance;
>    uint32_t flags;
>    uint16_t timeout;
>    uint16_t min_interval;
>    uint16_t max_interval;
>    int8_t tx_power;
>    uint8_t  adv_data_len;
>    uint8_t  scan_rsp_len;
>    uint8_t  data[];
> } __packed;
> 
> Option 2 packs the data into a flexible TLV data member. This allows
> unused/unnecessary parameters to be omitted, and also allows for
> future addition of functionality without redefining the MGMT
> interface, for instance when more of the extended advertising features
> are enabled in userspace.
> 
> #define MGMT_OP_ADD_EXT_ADVERTISING 0x00??
> struct mgmt_cp_add_ext_advertising {
>    uint8_t  instance;
>    uint32_t flags;
>    uint8_t  tlv_data[];
> } __packed;
> 
> Feedback/comments/concerns are highly welcome, thanks in advance!

I am leaning towards option 1 since it is a lot easier to read and also handle inside the code. We can add extra flags if default values should be applied.

The one thing that is rather more problematic is that fact that we want to provide tx_power and then we need to know what the tx_power level has been chosen by the controller. In HCI there is no combined command and thus setting the parameters first and then the data is possible.

So maybe one proposal could also be this:

Add Extended Advertising Command
================================

        Command Code:           0x00xx
        Controller Index:       <controller id>
        Command Parameters:     Instance (1 Octet)
                                Flags (4 Octets)
                                Duration (2 Octets)
                                Timeout (2 Octets)
				TX_Power (1 Octet)
				Min_Interval (2 Octets)
				Max_Interval (2 Octets)
        Return Parameters:      Instance (1 Octet)
				TX_Power (1 Octet)


We can implement this command in way that extension with new fields is possible. Not all commands need to be strict in length. Such a created instance is of course off by default.

And then you need to provide the AD with a separate command to activate the instance.

Set Advertising Data Command
============================

	Command Code:		0x00xx
	Controller Index:	<controller id>
	Command Parameters:	Instance (1 Octet)
				Flags (4 Octets)
                                Adv_Data_Len (1 Octet)
                                Scan_Rsp_Len (1 Octet)
                                Adv_Data (0-255 Octets)
                                Scan_Rsp (0-255 Octets)
	Return Parameters:      Instance (1 Octet)

This command should only be allowed if Add Extended Advertising is used and most likely also Advertising Data Changed event needs to be added to complete this.

The Flags might share a namespace if that makes sense, but not all are available for both commands.

Regards

Marcel




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux