pub trait HalCommands {
    // Required methods
    async fn get_firmware_revision(&mut self);
    async fn write_config_data(&mut self, config: &ConfigData);
    async fn read_config_data(&mut self, param: ConfigParameter);
    async fn set_tx_power_level(&mut self, level: PowerLevel);
    async fn get_tx_test_packet_count(&mut self);
    async fn start_tone(
        &mut self,
        channel: u8,
        freq_offset: u8
    ) -> Result<(), Error>;
    async fn stop_tone(&mut self);
    async fn get_link_status(&mut self);
    async fn get_anchor_period(&mut self);
}
Expand description

Vendor-specific HCI commands for the ActiveBlueNRG.

Required Methods§

source

async fn get_firmware_revision(&mut self)

This command is intended to retrieve the firmware revision number.

Errors

Only underlying communication errors are reported.

Generated events

The controller will generate a command complete event.

source

async fn write_config_data(&mut self, config: &ConfigData)

This command writes a value to a low level configure data structure. It is useful to setup directly some low level parameters for the system in the runtime.

Errors

Only underlying communication errors are reported.

Generated events

The controller will generate a command complete event.

source

async fn read_config_data(&mut self, param: ConfigParameter)

This command requests the value in the low level configure data structure.

Errors

Only underlying communication errors are reported.

Generated events

The controller will generate a command complete event.

source

async fn set_tx_power_level(&mut self, level: PowerLevel)

This command sets the TX power level of the BlueNRG-MS.

When the system starts up or reboots, the default TX power level will be used, which is the maximum value of 8 dBm. Once this command is given, the output power will be changed instantly, regardless if there is Bluetooth communication going on or not. For example, for debugging purpose, the BlueNRG-MS can be set to advertise all the time. And use this command to observe the signal strength changing.

The system will keep the last received TX power level from the command, i.e. the 2nd command overwrites the previous TX power level. The new TX power level remains until another Set TX Power command, or the system reboots.

Errors

Only underlying communication errors are reported.

Generated events

The controller will generate a command complete event.

source

async fn get_tx_test_packet_count(&mut self)

Retrieve the number of packets sent in the last TX direct test.

During the Direct Test mode, in the TX tests, the number of packets sent in the test is not returned when executing the Direct Test End command. This command implements this feature.

If the Direct TX test is started, a 32-bit counter will be used to count how many packets have been transmitted. After the Direct Test End, this command can be used to check how many packets were sent during the Direct TX test.

The counter starts from 0 and counts upwards. As would be the case if 32-bits are all used, the counter wraps back and starts from 0 again. The counter is not cleared until the next Direct TX test starts.

Errors

Only underlying communication errors are reported.

Generated events

The controller will generate a command complete event.

source

async fn start_tone( &mut self, channel: u8, freq_offset: u8 ) -> Result<(), Error>

This command starts a carrier frequency, i.e. a tone, on a specific channel.

The frequency sine wave at the specific channel may be used for debugging purpose only. The channel ID is a parameter from 0 to 39 for the 40 BLE channels, e.g. 0 for 2.402 GHz, 1 for 2.404 GHz etc.

This command should not be used when normal Bluetooth activities are ongoing. The tone should be stopped by stop_tone command.

Errors
  • InvalidChannel if the channel is greater than 39.
  • Underlying communication errors
Generated events

The controller will generate a command complete event.

source

async fn stop_tone(&mut self)

Stops the previously started by the start_tone command.

Errors

Only underlying communication errors are reported.

Generated events

The controller will generate a command complete event.

This command is intended to return the Link Layer Status and Connection Handles.

Errors

Only underlying communication errors are reported.

Generated events

The controller will generate a command complete event.

source

async fn get_anchor_period(&mut self)

This command is intended to retrieve information about the current Anchor Interval and allocable timing slots.

Errors

Only underlying communication errors are reported.

Generated events

The controller will generate a command complete event.

Implementors§