The difference between Failure and Success

本篇引用了本杰明·富兰克林的话强调了成功与失败之间的细微差别:几乎正确与完全正确的不同。成功往往取决于是否能在关键时刻做到尽善尽美。

The difference between failure and sucess is the difference between doing something almost right and doing something right.

--Benjamin Frnaklin

翻译如下文档 Add Advertising Command ======================= Command Code: 0x003e Controller Index: <controller id> Command Parameters: Instance (1 Octet) Flags (4 Octets) Duration (2 Octets) Timeout (2 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 is used to configure an advertising instance that can be used to switch a Bluetooth Low Energy controller into advertising mode. Added advertising information with this command will not be visible immediately if advertising is enabled via the Set Advertising command. The usage of the Set Advertising command takes precedence over this command. Instance information is stored and will be advertised once advertising via Set Advertising has been disabled. The Instance identifier is a value between 1 and the number of supported instances. The value 0 is reserved. With the Flags value the type of advertising is controlled and the following flags are defined: 0 Switch into Connectable mode 1 Advertise as Discoverable 2 Advertise as Limited Discoverable 3 Add Flags field to Adv_Data 4 Add TX Power field to Adv_Data 5 Add Appearance field to Scan_Rsp 6 Add Local Name in Scan_Rsp When the connectable flag is set, then the controller will use undirected connectable advertising. The value of the connectable setting can be overwritten this way. This is useful to switch a controller into connectable mode only for LE operation. This is similar to the mode 0x02 from the Set Advertising command. When the connectable flag is not set, then the controller will use advertising based on the connectable setting. When using non-connectable or scannable advertising, the controller will be programmed with a non-resolvable random address. When the system is connectable, then the identity address or resolvable private address will be used. Using the connectable flag is useful for peripheral mode support where BR/EDR (and/or LE) is controlled by Add Device. This allows making the peripheral connectable without having to interfere with the global connectable setting. If Scan_Rsp_Len is zero and connectable flag is not set and the global connectable setting is off, then non-connectable advertising is used. If Scan_Rsp_Len is larger than zero and connectable flag is not set and the global advertising is off, then scannable advertising is used. This small difference is supported to provide less air traffic for devices implementing broadcaster role. The Duration parameter configures the length of an Instance. The value is in seconds. A value of 0 indicates a default value is chosen for the Duration. The default is 2 seconds. If only one advertising Instance has been added, then the Duration value will be ignored. It only applies for the case where multiple Instances are configured. In that case every Instance will be available for the Duration time and after that it switches to the next one. This is a simple round-robin based approach. The Timeout parameter configures the life-time of an Instance. In case the value 0 is used it indicates no expiration time. If a timeout value is provided, then the advertising Instance will be automatically removed when the timeout passes. The value for the timeout is in seconds. Powering down a controller will invalidate all advertising Instances and it is not possible to add a new Instance with a timeout when the controller is powered down. When a Timeout is provided, then the Duration subtracts from the actual Timeout value of that Instance. For example an Instance with Timeout of 5 and Duration of 2 will be scheduled exactly 3 times, twice with 2 seconds and once with one second. Other Instances have no influence on the Timeout. Re-adding an already existing instance (i.e. issuing the Add Advertising command with an Instance identifier of an existing instance) will update that instance's configuration. An instance being added or changed while another instance is being advertised will not be visible immediately but only when the new/changed instance is being scheduled by the round robin advertising algorithm. Changes to an instance that is currently being advertised will cancel that instance and switch to the next instance. The changes will be visible the next time the instance is scheduled for advertising. In case a single instance is active, this means that changes will be visible right away. A pre-requisite is that LE is already enabled, otherwise this command will return a "rejected" response. This command can be used when the controller is not powered and all settings will be programmed once powered. This command generates a Command Complete event on success or a Command Status event on failure. Possible errors: Failed Rejected Not Supported Invalid Parameters Invalid Index
11-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值