pub struct Ble { /* private fields */ }
Expand description
A guard that, once constructed, may be used to send BLE commands to CPU2.
It is the responsibility of the caller to ensure that they have awaited an event via crate::sub::sys::Sys::read before sending any of these commands, and to call crate::sub::sys::Sys::shci_c2_ble_init and await the HCI_COMMAND_COMPLETE_EVENT before sending any other commands.
§Example
Implementations§
Trait Implementations§
Source§impl Controller for Ble
impl Controller for Ble
Source§async fn controller_write(&mut self, opcode: Opcode, payload: &[u8])
async fn controller_write(&mut self, opcode: Opcode, payload: &[u8])
Writes the bytes to the controller, in a single transaction if possible. All of
header
shall be written, followed by all of payload
.Source§async fn controller_read_into(&self, buf: &mut [u8])
async fn controller_read_into(&self, buf: &mut [u8])
Reads data from the controller into the provided
buffer
. The length of the buffer
indicates the number of bytes to read. The implementor must not return bytes in an order
different from that in which they were received from the controller. For example, the
implementor may read all available bytes from the controller and maintain them in an
internal buffer, but read_into
shall only read the number of bytes requested. Read moreSource§impl MemoryManager for Ble
impl MemoryManager for Ble
Source§unsafe fn drop_event_packet(evt: *mut EvtPacket)
unsafe fn drop_event_packet(evt: *mut EvtPacket)
SAFETY: passing a pointer to something other than a managed event packet is UB
Auto Trait Implementations§
impl Freeze for Ble
impl RefUnwindSafe for Ble
impl Send for Ble
impl Sync for Ble
impl Unpin for Ble
impl UnwindSafe for Ble
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> GapCommands for Twhere
T: Controller,
impl<T> GapCommands for Twhere
T: Controller,
Source§async fn gap_set_nondiscoverable(&mut self)
async fn gap_set_nondiscoverable(&mut self)
Set the device in non-discoverable mode. This command will disable the LL advertising and
put the device in standby state. Read more
Source§async fn set_limited_discoverable<'a, 'b>(
&mut self,
params: &DiscoverableParameters<'a, 'b>,
) -> Result<(), Error>
async fn set_limited_discoverable<'a, 'b>( &mut self, params: &DiscoverableParameters<'a, 'b>, ) -> Result<(), Error>
Set the device in limited discoverable mode. Read more
Source§async fn set_discoverable<'a, 'b>(
&mut self,
params: &DiscoverableParameters<'a, 'b>,
) -> Result<(), Error>
async fn set_discoverable<'a, 'b>( &mut self, params: &DiscoverableParameters<'a, 'b>, ) -> Result<(), Error>
Set the device in discoverable mode. Read more
Source§async fn set_direct_connectable(
&mut self,
params: &DirectConnectableParameters,
) -> Result<(), Error>
async fn set_direct_connectable( &mut self, params: &DirectConnectableParameters, ) -> Result<(), Error>
Set the device in direct connectable mode. Read more
Source§async fn set_io_capability(&mut self, capability: IoCapability)
async fn set_io_capability(&mut self, capability: IoCapability)
Set the IO capabilities of the device. Read more
Source§async fn set_authentication_requirement(
&mut self,
params: &AuthenticationRequirements,
) -> Result<(), Error>
async fn set_authentication_requirement( &mut self, params: &AuthenticationRequirements, ) -> Result<(), Error>
Set the authentication requirements for the device. Read more
Set the authorization requirements of the device. Read more
Source§async fn pass_key_response(
&mut self,
conn_handle: ConnectionHandle,
pin: u32,
) -> Result<(), Error>
async fn pass_key_response( &mut self, conn_handle: ConnectionHandle, pin: u32, ) -> Result<(), Error>
This command should be send by the host in response to the
GAP Pass Key Request event. Read more
This command should be send by the host in response to the
GAP Authorization Request event. Read more
Source§async fn init(
&mut self,
role: Role,
privacy_enabled: bool,
dev_name_characteristic_len: u8,
)
async fn init( &mut self, role: Role, privacy_enabled: bool, dev_name_characteristic_len: u8, )
Register the GAP service with the GATT. Read more
Source§async fn set_nonconnectable(
&mut self,
advertising_type: AdvertisingType,
address_type: AddressType,
) -> Result<(), Error>
async fn set_nonconnectable( &mut self, advertising_type: AdvertisingType, address_type: AddressType, ) -> Result<(), Error>
Put the device into non-connectable mode. Read more
Source§async fn set_undirected_connectable(
&mut self,
params: &UndirectedConnectableParameters,
) -> Result<(), Error>
async fn set_undirected_connectable( &mut self, params: &UndirectedConnectableParameters, ) -> Result<(), Error>
Put the device into undirected connectable mode. Read more
Source§async fn peripheral_security_request(&mut self, conn_handle: &ConnectionHandle)
async fn peripheral_security_request(&mut self, conn_handle: &ConnectionHandle)
This command has to be issued to notify the central device of the security requirements of
the peripheral. Read more
Source§async fn update_advertising_data(&mut self, data: &[u8]) -> Result<(), Error>
async fn update_advertising_data(&mut self, data: &[u8]) -> Result<(), Error>
This command can be used to update the advertising data for a particular AD type. If the AD
type specified does not exist, then it is added to the advertising data. If the overall
advertising data length is more than 31 octets after the update, then the command is
rejected and the old data is retained. Read more
Source§async fn delete_ad_type(&mut self, ad_type: AdvertisingDataType)
async fn delete_ad_type(&mut self, ad_type: AdvertisingDataType)
This command can be used to delete the specified AD type from the advertisement data if
present. Read more
Source§async fn get_security_level(&mut self, conn_handle: &ConnectionHandle)
async fn get_security_level(&mut self, conn_handle: &ConnectionHandle)
This command can be used to get the current security settings of the device. Read more
Source§async fn set_event_mask(&mut self, flags: EventFlags)
async fn set_event_mask(&mut self, flags: EventFlags)
Allows masking events from the GAP. Read more
Source§async fn configure_white_list(&mut self)
async fn configure_white_list(&mut self)
Configure the controller’s white list with devices that are present in the security
database. Read more
Source§async fn terminate(
&mut self,
conn_handle: ConnectionHandle,
reason: Status,
) -> Result<(), Error>
async fn terminate( &mut self, conn_handle: ConnectionHandle, reason: Status, ) -> Result<(), Error>
Command the controller to terminate the connection. Read more
Source§async fn clear_security_database(&mut self)
async fn clear_security_database(&mut self)
Clear the bonding table. All the devices in the bonding table are removed. Read more
Source§async fn allow_rebond(&mut self, conn_handle: ConnectionHandle)
async fn allow_rebond(&mut self, conn_handle: ConnectionHandle)
This command should be given by the application when it receives the
GAP Bond Lost event if it wants the re-bonding to happen
successfully. If this command is not given on receiving the event, the bonding procedure
will timeout. Read more
Source§async fn start_limited_discovery_procedure(
&mut self,
params: &DiscoveryProcedureParameters,
)
async fn start_limited_discovery_procedure( &mut self, params: &DiscoveryProcedureParameters, )
Start the limited discovery procedure. Read more
Source§async fn start_general_discovery_procedure(
&mut self,
params: &DiscoveryProcedureParameters,
)
async fn start_general_discovery_procedure( &mut self, params: &DiscoveryProcedureParameters, )
Start the general discovery procedure. The controller is commanded to start active scanning. Read more
Source§async fn start_auto_connection_establishment_procedure<'a>(
&mut self,
params: &AutoConnectionEstablishmentParameters<'a>,
) -> Result<(), Error>
async fn start_auto_connection_establishment_procedure<'a>( &mut self, params: &AutoConnectionEstablishmentParameters<'a>, ) -> Result<(), Error>
Start the auto connection establishment procedure. Read more
Source§async fn start_general_connection_establishment_procedure(
&mut self,
params: &GeneralConnectionEstablishmentParameters,
)
async fn start_general_connection_establishment_procedure( &mut self, params: &GeneralConnectionEstablishmentParameters, )
Start a general connection establishment procedure. Read more
Source§async fn start_selective_connection_establishment_procedure<'a>(
&mut self,
params: &SelectiveConnectionEstablishmentParameters<'a>,
) -> Result<(), Error>
async fn start_selective_connection_establishment_procedure<'a>( &mut self, params: &SelectiveConnectionEstablishmentParameters<'a>, ) -> Result<(), Error>
Start a selective connection establishment procedure. Read more
Source§async fn create_connection(&mut self, params: &NameDiscoveryProcedureParameters)
async fn create_connection(&mut self, params: &NameDiscoveryProcedureParameters)
Start the direct connection establishment procedure. Read more
Source§async fn terminate_gap_procedure(
&mut self,
procedure: Procedure,
) -> Result<(), Error>
async fn terminate_gap_procedure( &mut self, procedure: Procedure, ) -> Result<(), Error>
The GAP procedure(s) specified is terminated. Read more
Source§async fn start_connection_update(&mut self, params: &ConnectionUpdateParameters)
async fn start_connection_update(&mut self, params: &ConnectionUpdateParameters)
Start the connection update procedure. Read more
Source§async fn send_pairing_request(&mut self, params: &PairingRequest)
async fn send_pairing_request(&mut self, params: &PairingRequest)
Send the SM pairing request to start a pairing process. The authentication requirements and
I/O capabilities should be set before issuing this command using the
set_io_capability
and
set_authentication_requirement
commands. Read moreSource§async fn resolve_private_address(&mut self, addr: BdAddr)
async fn resolve_private_address(&mut self, addr: BdAddr)
This command tries to resolve the address provided with the IRKs present in its database. Read more
Source§async fn set_broadcast_mode<'a, 'b>(
&mut self,
params: &BroadcastModeParameters<'a, 'b>,
) -> Result<(), Error>
async fn set_broadcast_mode<'a, 'b>( &mut self, params: &BroadcastModeParameters<'a, 'b>, ) -> Result<(), Error>
This command puts the device into broadcast mode. Read more
Source§async fn start_observation_procedure(
&mut self,
params: &ObservationProcedureParameters,
)
async fn start_observation_procedure( &mut self, params: &ObservationProcedureParameters, )
Starts an Observation procedure, when the device is in Observer Role. Read more
Source§async fn get_bonded_devices(&mut self)
async fn get_bonded_devices(&mut self)
This command gets the list of the devices which are bonded. It returns the number of
addresses and the corresponding address types and values. Read more
Source§async fn is_device_bonded(&mut self, addr: PeerAddrType)
async fn is_device_bonded(&mut self, addr: PeerAddrType)
Source§async fn numeric_comparison_value_confirm_yes_no(
&mut self,
params: &NumericComparisonValueConfirmYesNoParameters,
)
async fn numeric_comparison_value_confirm_yes_no( &mut self, params: &NumericComparisonValueConfirmYesNoParameters, )
This command allows the user to validate/confirm or not the numeric comparison value showed through
the [
NumericComparisonValueEvent
]Source§async fn passkey_input(
&mut self,
conn_handle: ConnectionHandle,
input_type: InputType,
)
async fn passkey_input( &mut self, conn_handle: ConnectionHandle, input_type: InputType, )
This command permits to signal to the Stack the input type detected during Passkey input.
Source§async fn get_oob_data(&mut self, oob_data_type: OobDataType)
async fn get_oob_data(&mut self, oob_data_type: OobDataType)
This command is sent by the user to get (i.e. to extract from the Stack) the OOB
data generated by the Stack itself.
Source§async fn set_oob_data(&mut self, params: &SetOobDataParameters)
async fn set_oob_data(&mut self, params: &SetOobDataParameters)
This command is sent (by the User) to input the OOB data arrived via OOB
communication.
Source§async fn add_devices_to_resolving_list(
&mut self,
whitelist_identities: &[PeerAddrType],
clear_resolving_list: bool,
)
async fn add_devices_to_resolving_list( &mut self, whitelist_identities: &[PeerAddrType], clear_resolving_list: bool, )
This command is used to add devices to the list of address translations
used to resolve Resolvable Private Addresses in the Controller.
Source§async fn remove_bonded_device(&mut self, address: BdAddrType)
async fn remove_bonded_device(&mut self, address: BdAddrType)
This command is used to remove a specified device from bonding table
Source§async fn add_devices_to_list(
&mut self,
list_entries: &[BdAddrType],
mode: AddDeviceToListMode,
)
async fn add_devices_to_list( &mut self, list_entries: &[BdAddrType], mode: AddDeviceToListMode, )
This command is used to add specific device addresses to the white and/or resolving list.
Source§async fn additional_beacon_start(
&mut self,
params: &AdditonalBeaconStartParameters,
) -> Result<(), Error>
async fn additional_beacon_start( &mut self, params: &AdditonalBeaconStartParameters, ) -> Result<(), Error>
This command starts an advertising beacon. It allows additional advertising
packets to be transmitted independently of the packets transmitted with GAP
advertising commands such as ACI_GAP_SET_DISCOVERABLE or
ACI_GAP_SET_LIMITED_DISCOVERABLE.
Source§async fn additional_beacon_stop(&mut self)
async fn additional_beacon_stop(&mut self)
This command stops the advertising beacon started with
ACI_GAP_ADDITIONAL_BEACON_START.
Source§async fn additonal_beacon_set_data(&mut self, advertising_data: &[u8])
async fn additonal_beacon_set_data(&mut self, advertising_data: &[u8])
This command sets the data transmitted by the advertising beacon started
with ACI_GAP_ADDITIONAL_BEACON_START. If the advertising beacon is already
started, the new data is used in subsequent beacon advertising events.
Source§async fn adv_set_config(&mut self, params: &AdvSetConfig)
async fn adv_set_config(&mut self, params: &AdvSetConfig)
This command is used to set the extended advertising configuration for one
advertising set. Read more
Source§async fn adv_set_enable<'a>(&mut self, params: &AdvSetEnable<'a>)
async fn adv_set_enable<'a>(&mut self, params: &AdvSetEnable<'a>)
This command is used to request the Controller to enable or disbale one
or more extended advertising sets.
Source§async fn adv_set_advertising_data<'a>(
&mut self,
params: &AdvSetAdvertisingData<'a>,
)
async fn adv_set_advertising_data<'a>( &mut self, params: &AdvSetAdvertisingData<'a>, )
This command is used to set the data used in extended advertising PDUs
that have a data field
Source§async fn adv_set_scan_response_data<'a>(
&mut self,
params: &AdvSetAdvertisingData<'a>,
)
async fn adv_set_scan_response_data<'a>( &mut self, params: &AdvSetAdvertisingData<'a>, )
This command is used to provide scan response data used during extended
advertising
Source§async fn adv_remove_set(&mut self, handle: AdvertisingHandle)
async fn adv_remove_set(&mut self, handle: AdvertisingHandle)
This command is used to remove an advertising set from the Controller.
Source§async fn adv_clear_sets(&mut self)
async fn adv_clear_sets(&mut self)
This command is used to remove all exisiting advertising sets from
the Controller.
Source§async fn adv_set_random_address(
&mut self,
handle: AdvertisingHandle,
addr: BdAddr,
)
async fn adv_set_random_address( &mut self, handle: AdvertisingHandle, addr: BdAddr, )
This command is used to set the random device address of an advertising
set configured to use specific random address.
Source§async fn init_gap(
&mut self,
role: Role,
privacy_enabled: bool,
dev_name_characteristic_len: u8,
)
async fn init_gap( &mut self, role: Role, privacy_enabled: bool, dev_name_characteristic_len: u8, )
Register the GAP service with the GATT. Read more
Source§async fn set_gap_event_mask(&mut self, flags: EventFlags)
async fn set_gap_event_mask(&mut self, flags: EventFlags)
Allows masking events from the GAP. Read more
Source§impl<T> GattCommands for Twhere
T: Controller,
impl<T> GattCommands for Twhere
T: Controller,
Source§async fn init(&mut self)
async fn init(&mut self)
Initialize the GATT server on the slave device. Initialize all the pools and active
nodes. Also it adds GATT service with service changed characteristic. Until this command is
issued the GATT channel will not process any commands even if the connection is opened. This
command has to be given before using any of the GAP features. Read more
Source§async fn add_service(&mut self, params: &AddServiceParameters)
async fn add_service(&mut self, params: &AddServiceParameters)
Add a service to GATT Server. Read more
Source§async fn include_service(&mut self, params: &IncludeServiceParameters)
async fn include_service(&mut self, params: &IncludeServiceParameters)
Include a service to another service. Read more
Source§async fn add_characteristic(&mut self, params: &AddCharacteristicParameters)
async fn add_characteristic(&mut self, params: &AddCharacteristicParameters)
Add a characteristic to a service. Read more
Source§async fn add_characteristic_descriptor<'a>(
&mut self,
params: &AddDescriptorParameters<'a>,
) -> Result<(), Error>
async fn add_characteristic_descriptor<'a>( &mut self, params: &AddDescriptorParameters<'a>, ) -> Result<(), Error>
Add a characteristic descriptor to a service. Read more
Source§async fn update_characteristic_value<'a>(
&mut self,
params: &UpdateCharacteristicValueParameters<'a>,
) -> Result<(), Error>
async fn update_characteristic_value<'a>( &mut self, params: &UpdateCharacteristicValueParameters<'a>, ) -> Result<(), Error>
Update a characteristic value in a service. Read more
Source§async fn delete_characteristic(
&mut self,
service: AttributeHandle,
characteristic: AttributeHandle,
)
async fn delete_characteristic( &mut self, service: AttributeHandle, characteristic: AttributeHandle, )
Delete the characteristic specified from the service. Read more
Source§async fn delete_service(&mut self, service: AttributeHandle)
async fn delete_service(&mut self, service: AttributeHandle)
Delete the service specified from the GATT server database. Read more
Source§async fn delete_included_service(
&mut self,
params: &DeleteIncludedServiceParameters,
)
async fn delete_included_service( &mut self, params: &DeleteIncludedServiceParameters, )
Delete the Include definition from the service. Read more
Source§async fn set_event_mask(&mut self, params: Event)
async fn set_event_mask(&mut self, params: Event)
Allows masking events from the GATT. Read more
Source§async fn exchange_configuration(&mut self, conn_handle: ConnectionHandle)
async fn exchange_configuration(&mut self, conn_handle: ConnectionHandle)
Perform an ATT MTU exchange. Read more
Source§async fn find_information_request(
&mut self,
conn_handle: ConnectionHandle,
attribute_range: Range<AttributeHandle>,
)
async fn find_information_request( &mut self, conn_handle: ConnectionHandle, attribute_range: Range<AttributeHandle>, )
Post the Find information request. Read more
Source§async fn find_by_type_value_request<'a>(
&mut self,
params: &FindByTypeValueParameters<'a>,
) -> Result<(), Error>
async fn find_by_type_value_request<'a>( &mut self, params: &FindByTypeValueParameters<'a>, ) -> Result<(), Error>
Post the Find by type value request. Read more
Source§async fn read_by_type_request(&mut self, params: &ReadByTypeParameters)
async fn read_by_type_request(&mut self, params: &ReadByTypeParameters)
Send a Read By Type Request. Read more
Source§async fn read_by_group_type_request(&mut self, params: &ReadByTypeParameters)
async fn read_by_group_type_request(&mut self, params: &ReadByTypeParameters)
Sends a Read By Group Type request. Read more
Source§async fn prepare_write_request<'a>(
&mut self,
params: &WriteRequest<'a>,
) -> Result<(), Error>
async fn prepare_write_request<'a>( &mut self, params: &WriteRequest<'a>, ) -> Result<(), Error>
Sends a Prepare Write request. Read more
Source§async fn execute_write_request(&mut self, conn_handle: ConnectionHandle)
async fn execute_write_request(&mut self, conn_handle: ConnectionHandle)
Sends an Execute Write Request to write all pending prepared writes. Read more
Source§async fn cancel_write_request(&mut self, conn_handle: ConnectionHandle)
async fn cancel_write_request(&mut self, conn_handle: ConnectionHandle)
Sends an Execute Write Request to discard prepared writes. Read more
Source§async fn discover_all_primary_services(&mut self, conn_handle: ConnectionHandle)
async fn discover_all_primary_services(&mut self, conn_handle: ConnectionHandle)
This command will start the GATT client procedure to discover all primary services on the
server. Read more
Source§async fn discover_primary_services_by_uuid(
&mut self,
conn_handle: ConnectionHandle,
uuid: Uuid,
)
async fn discover_primary_services_by_uuid( &mut self, conn_handle: ConnectionHandle, uuid: Uuid, )
This command will start the procedure to discover the primary services of the specified
UUID on the server. Read more
Source§async fn find_included_services(
&mut self,
conn_handle: ConnectionHandle,
service_handle_range: Range<AttributeHandle>,
)
async fn find_included_services( &mut self, conn_handle: ConnectionHandle, service_handle_range: Range<AttributeHandle>, )
Start the procedure to find all included services. Read more
Source§async fn discover_all_characteristics_of_service(
&mut self,
conn_handle: ConnectionHandle,
attribute_handle_range: Range<AttributeHandle>,
)
async fn discover_all_characteristics_of_service( &mut self, conn_handle: ConnectionHandle, attribute_handle_range: Range<AttributeHandle>, )
Start the procedure to discover all the characteristics of a given service. Read more
Source§async fn discover_characteristics_by_uuid(
&mut self,
conn_handle: ConnectionHandle,
attribute_handle_range: Range<AttributeHandle>,
uuid: Uuid,
)
async fn discover_characteristics_by_uuid( &mut self, conn_handle: ConnectionHandle, attribute_handle_range: Range<AttributeHandle>, uuid: Uuid, )
Start the procedure to discover all the characteristics specified by the UUID. Read more
Source§async fn discover_all_characteristic_descriptors(
&mut self,
conn_handle: ConnectionHandle,
characteristic_handle_range: Range<AttributeHandle>,
)
async fn discover_all_characteristic_descriptors( &mut self, conn_handle: ConnectionHandle, characteristic_handle_range: Range<AttributeHandle>, )
Start the procedure to discover all characteristic descriptors on the server. Read more
Source§async fn read_characteristic_value(
&mut self,
conn_handle: ConnectionHandle,
characteristic_handle: AttributeHandle,
)
async fn read_characteristic_value( &mut self, conn_handle: ConnectionHandle, characteristic_handle: AttributeHandle, )
Start the procedure to read the attribute value. Read more
Source§async fn read_characteristic_using_uuid(
&mut self,
conn_handle: ConnectionHandle,
characteristic_handle_range: Range<AttributeHandle>,
uuid: Uuid,
)
async fn read_characteristic_using_uuid( &mut self, conn_handle: ConnectionHandle, characteristic_handle_range: Range<AttributeHandle>, uuid: Uuid, )
Start the procedure to read all the characteristics specified by the UUID. Read more
Source§async fn read_long_characteristic_value(
&mut self,
params: &LongCharacteristicReadParameters,
)
async fn read_long_characteristic_value( &mut self, params: &LongCharacteristicReadParameters, )
Start the procedure to read a long characteristic value. Read more
Source§async fn read_multiple_characteristic_values<'a>(
&mut self,
params: &MultipleCharacteristicReadParameters<'a>,
) -> Result<(), Error>
async fn read_multiple_characteristic_values<'a>( &mut self, params: &MultipleCharacteristicReadParameters<'a>, ) -> Result<(), Error>
Start a procedure to read multiple characteristic values from a server. Read more
Source§async fn write_characteristic_value<'a>(
&mut self,
params: &CharacteristicValue<'a>,
) -> Result<(), Error>
async fn write_characteristic_value<'a>( &mut self, params: &CharacteristicValue<'a>, ) -> Result<(), Error>
Start the procedure to write a characteristic value. Read more
Source§async fn write_long_characteristic_value<'a>(
&mut self,
params: &LongCharacteristicValue<'a>,
) -> Result<(), Error>
async fn write_long_characteristic_value<'a>( &mut self, params: &LongCharacteristicValue<'a>, ) -> Result<(), Error>
Start the procedure to write a long characteristic value. Read more
Source§async fn write_characteristic_value_reliably<'a>(
&mut self,
params: &LongCharacteristicValue<'a>,
) -> Result<(), Error>
async fn write_characteristic_value_reliably<'a>( &mut self, params: &LongCharacteristicValue<'a>, ) -> Result<(), Error>
Start the procedure to write a characteristic reliably. Read more
Source§async fn write_long_characteristic_descriptor<'a>(
&mut self,
params: &LongCharacteristicValue<'a>,
) -> Result<(), Error>
async fn write_long_characteristic_descriptor<'a>( &mut self, params: &LongCharacteristicValue<'a>, ) -> Result<(), Error>
Start the procedure to write a long characteristic descriptor. Read more
Source§async fn read_long_characteristic_descriptor(
&mut self,
params: &LongCharacteristicReadParameters,
)
async fn read_long_characteristic_descriptor( &mut self, params: &LongCharacteristicReadParameters, )
Start the procedure to read a long characteristic descriptor. Read more
Source§async fn write_characteristic_descriptor<'a>(
&mut self,
params: &CharacteristicValue<'a>,
) -> Result<(), Error>
async fn write_characteristic_descriptor<'a>( &mut self, params: &CharacteristicValue<'a>, ) -> Result<(), Error>
Start the procedure to write a characteristic descriptor value. Read more
Source§async fn read_characteristic_descriptor(
&mut self,
conn_handle: ConnectionHandle,
characteristic_handle: AttributeHandle,
)
async fn read_characteristic_descriptor( &mut self, conn_handle: ConnectionHandle, characteristic_handle: AttributeHandle, )
Start the procedure to read a characteristic descriptor. Read more
Source§async fn write_without_response<'a>(
&mut self,
params: &CharacteristicValue<'a>,
) -> Result<(), Error>
async fn write_without_response<'a>( &mut self, params: &CharacteristicValue<'a>, ) -> Result<(), Error>
Start the procedure to write a characteristic value without waiting for any response from
the server. Read more
Source§async fn signed_write_without_response<'a>(
&mut self,
params: &CharacteristicValue<'a>,
) -> Result<(), Error>
async fn signed_write_without_response<'a>( &mut self, params: &CharacteristicValue<'a>, ) -> Result<(), Error>
Start the procedure to write a characteristic value with an authentication signature without
waiting for any response from the server. It cannot be used when the link is encrypted. Read more
Source§async fn confirm_indication(&mut self, conn_handle: ConnectionHandle)
async fn confirm_indication(&mut self, conn_handle: ConnectionHandle)
Allow application to confirm indication. This command has to be sent when the application
receives the GATT Indication event. Read more
Source§async fn write_response<'a>(
&mut self,
params: &WriteResponseParameters<'a>,
) -> Result<(), Error>
async fn write_response<'a>( &mut self, params: &WriteResponseParameters<'a>, ) -> Result<(), Error>
Allows or rejects a write request from a client. Read more
Source§async fn allow_read(&mut self, conn_handle: ConnectionHandle)
async fn allow_read(&mut self, conn_handle: ConnectionHandle)
Allows the GATT server to send a response to a read request from a client. Read more
Source§async fn set_security_permission(
&mut self,
params: &SecurityPermissionParameters,
)
async fn set_security_permission( &mut self, params: &SecurityPermissionParameters, )
This command sets the security permission for the attribute handle specified. Currently the
setting of security permission is allowed only for client configuration descriptor. Read more
Source§async fn set_descriptor_value<'a>(
&mut self,
params: &DescriptorValueParameters<'a>,
) -> Result<(), Error>
async fn set_descriptor_value<'a>( &mut self, params: &DescriptorValueParameters<'a>, ) -> Result<(), Error>
This command sets the value of a descriptor. Read more
Source§async fn read_handle_value_offset(
&mut self,
handle: AttributeHandle,
offset: usize,
)
async fn read_handle_value_offset( &mut self, handle: AttributeHandle, offset: usize, )
The command returns the value of the attribute handle from the specified offset. Read more
Source§async fn update_characteristic_value_ext<'a>(
&mut self,
params: &UpdateCharacteristicValueExt<'a>,
) -> Result<(), Error>
async fn update_characteristic_value_ext<'a>( &mut self, params: &UpdateCharacteristicValueExt<'a>, ) -> Result<(), Error>
This is a more flexible version of ACI_GATT_UPDATE_CHAR_VALUE tp support update of Long
attribute up to 512 bytes and indicate selectively the generation of Indication/Notification Read more
Source§async fn deny_read(&mut self, handle: ConnectionHandle, err: u8)
async fn deny_read(&mut self, handle: ConnectionHandle, err: u8)
This command is used to deny the GATT server to send a response to a read request from a client. Read more
Source§async fn set_access_permission(
&mut self,
service: AttributeHandle,
attribute: AttributeHandle,
permissions: AccessPermission,
)
async fn set_access_permission( &mut self, service: AttributeHandle, attribute: AttributeHandle, permissions: AccessPermission, )
This command sets the access permission for the attribute handle specified.
Source§async fn store_database(&mut self)
async fn store_database(&mut self)
This command forces the saving of the GATT database for all active connections. Note that,
by default, the GATT database is saved per active connection at the time of disconnecting.
Source§async fn send_multiple_notification(
&mut self,
conn_handle: ConnectionHandle,
handles: &[AttributeHandle],
)
async fn send_multiple_notification( &mut self, conn_handle: ConnectionHandle, handles: &[AttributeHandle], )
This commad sends a Multiple Handle Value Notification over the ATT bearer specified in
parameter. The handles provided as parameters must be the handles of the characteristic
declarations.
Source§async fn read_multiple_variable_characteristic_value(
&mut self,
conn_handle: ConnectionHandle,
handles: &[AttributeHandle],
)
async fn read_multiple_variable_characteristic_value( &mut self, conn_handle: ConnectionHandle, handles: &[AttributeHandle], )
Starts a procedure to read multiple variable length characteristic values from a server; Read more
Source§async fn set_gatt_event_mask(&mut self, mask: Event)
async fn set_gatt_event_mask(&mut self, mask: Event)
Allows masking events from the GATT. Read more
Source§impl<T> HalCommands for Twhere
T: Controller,
impl<T> HalCommands for Twhere
T: Controller,
Source§async fn get_firmware_revision(&mut self)
async fn get_firmware_revision(&mut self)
This command is intended to retrieve the firmware revision number. Read more
Source§async fn write_config_data(&mut self, params: &ConfigData)
async fn write_config_data(&mut self, params: &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. Read more
Source§async fn read_config_data(&mut self, param: ConfigParameter)
async fn read_config_data(&mut self, param: ConfigParameter)
This command requests the value in the low level configure data structure. Read more
Source§async fn set_tx_power_level(&mut self, level: PowerLevel)
async fn set_tx_power_level(&mut self, level: PowerLevel)
This command sets the TX power level of the BlueNRG-MS. Read more
Source§async fn get_tx_test_packet_count(&mut self)
async fn get_tx_test_packet_count(&mut self)
Retrieve the number of packets sent in the last TX direct test. Read more
Source§async fn start_tone(
&mut self,
channel: u8,
freq_offset: u8,
) -> Result<(), Error>
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. Read more
Source§async fn stop_tone(&mut self)
async fn stop_tone(&mut self)
Stops the previously started by the
start_tone
command. Read moreSource§async fn get_link_status(&mut self)
async fn get_link_status(&mut self)
This command is intended to return the Link Layer Status and Connection Handles. Read more
Source§async fn get_anchor_period(&mut self)
async fn get_anchor_period(&mut self)
This command is intended to retrieve information about the current Anchor Interval and
allocable timing slots. Read more
Source§async fn set_radio_activity_mask(&mut self, mask: RadioActivityFlags)
async fn set_radio_activity_mask(&mut self, mask: RadioActivityFlags)
This command sets the bitmask associated to
End of Radio Activity event. Read more
Source§async fn set_event_mask(&mut self, mask: HalEventFlags)
async fn set_event_mask(&mut self, mask: HalEventFlags)
This command is used to enable/disable the generation of HAL events. Read more
Source§async fn get_pm_debug_info(&mut self)
async fn get_pm_debug_info(&mut self)
This command is used to retreive Tx, Rx, and total buffer count allocated for ACL packets.
Source§async fn set_peripheral_latency(&mut self, enabled: bool)
async fn set_peripheral_latency(&mut self, enabled: bool)
This command is used to disable/enable the Peripheral latencyy feature during a connection. Read more
Source§async fn read_radio_reg(&mut self, address: u8)
async fn read_radio_reg(&mut self, address: u8)
This command reads a register value from the RF module
Source§async fn read_raw_rssi(&mut self)
async fn read_raw_rssi(&mut self)
This command returns the raw value of the RSSI
Source§async fn rx_start(&mut self, rf_channel: u8)
async fn rx_start(&mut self, rf_channel: u8)
This command does set up the RF to listen to a specific RF Channel. Read more
Source§async fn rx_stop(&mut self)
async fn rx_stop(&mut self)
This command stops a previous HAL Rx Start command
Source§async fn stack_reset(&mut self)
async fn stack_reset(&mut self)
This command is equivalent to HCI Reset but ensures
the sleep mode is entered immediately after its completion.
Source§impl<T> HostHci for Twhere
T: Controller,
impl<T> HostHci for Twhere
T: Controller,
Source§async fn disconnect(
&mut self,
conn_handle: ConnectionHandle,
reason: Status,
) -> Result<(), Error>
async fn disconnect( &mut self, conn_handle: ConnectionHandle, reason: Status, ) -> Result<(), Error>
Terminates an existing connection. All synchronous connections on a physical link should be
disconnected before the ACL connection on the same physical connection is disconnected. Read more
Source§async fn read_remote_version_information(
&mut self,
conn_handle: ConnectionHandle,
)
async fn read_remote_version_information( &mut self, conn_handle: ConnectionHandle, )
Obtains the values for the version information for the remote device identified by the
conn_handle
parameter, which must be a connection handle for an ACL or LE connection. Read moreSource§async fn set_event_mask(&mut self, mask: EventFlags)
async fn set_event_mask(&mut self, mask: EventFlags)
Controls which events are generated by the HCI for the Host. If the flag in the mask is set,
then the event associated with that bit will be enabled. For an LE Controller, the
LE Meta Event flag shall enable or disable all LE events (see Section
7.7.65). The Host has to deal with each event that occurs. The event mask allows the Host to
control how much it is interrupted. Read more
Source§async fn reset(&mut self)
async fn reset(&mut self)
Resets the Controller and the Link Manager on the BR/EDR Controller, the PAL on an AMP
Controller, or the Link Layer on an LE Controller. If the Controller supports both BR/EDR
and LE then the Reset command shall reset the Link Manager, Baseband and Link Layer. The
Reset command shall not affect the used HCI transport layer since the HCI transport layers
may have reset mechanisms of their own. After the reset is completed, the current
operational state will be lost, the Controller will enter standby mode and the Controller
will automatically revert to the default values for the parameters for which default values
are defined in the specification. Read more
Source§async fn read_tx_power_level(
&mut self,
conn_handle: ConnectionHandle,
power_level_type: TxPowerLevel,
)
async fn read_tx_power_level( &mut self, conn_handle: ConnectionHandle, power_level_type: TxPowerLevel, )
Reads the values for the transmit power level for the specified
conn_handle
. conn_handle
shall be a connection handle for an ACL connection. Read moreSource§async fn set_controller_to_host_flow_control(
&mut self,
flow_control: FlowControl,
)
async fn set_controller_to_host_flow_control( &mut self, flow_control: FlowControl, )
This command is used by the Host to turn flow control on and off for data and/or voice
sent in the direction from the Controller to the Host. Read more
Source§async fn host_buffer_size(&mut self, params: HostBufferSize)
async fn host_buffer_size(&mut self, params: HostBufferSize)
This command is used by the Host to notify the Controller about the Maximum size of the data portion
of HCI ACL and Synchronous Sata Packets sent from the controller to the Host. Read more
Source§async fn number_of_completed_packets(
&mut self,
params: NumberOfCompletedPackets,
)
async fn number_of_completed_packets( &mut self, params: NumberOfCompletedPackets, )
This command is used by the Host to indicate to the Controller the number of HCI Data Packets
that have been completed for each Connection Handle since the previous
Number of Completed Packets command was sent to
the Controller. This means that the corresponding buffer space has been freed in the Host. Read more
Source§async fn read_local_version_information(&mut self)
async fn read_local_version_information(&mut self)
This command reads the values for the version information for the local Controller. Read more
Source§async fn read_local_supported_commands(&mut self)
async fn read_local_supported_commands(&mut self)
Reads the list of HCI commands supported for the local Controller. Read more
Source§async fn read_local_supported_features(&mut self)
async fn read_local_supported_features(&mut self)
Requests a list of the supported features for the local BR/EDR Controller. Read more
Source§async fn read_bd_addr(&mut self)
async fn read_bd_addr(&mut self)
On a BR/EDR Controller, this command reads the Bluetooth Controller address (BD_ADDR). Read more
Source§async fn read_rssi(&mut self, conn_handle: ConnectionHandle)
async fn read_rssi(&mut self, conn_handle: ConnectionHandle)
Reads the Received Signal Strength Indication (RSSI) value from a Controller. Read more
Source§async fn le_set_event_mask(&mut self, event_mask: LeEventFlags)
async fn le_set_event_mask(&mut self, event_mask: LeEventFlags)
Controls which LE events are generated by the HCI for the Host. If the flag in
event_mask
is set, then the event associated with that flag will be enabled. The Host has to deal with
each event that is generated by an LE Controller. The event mask allows the Host to control
which events will interrupt it. Read moreSource§async fn le_read_buffer_size(&mut self)
async fn le_read_buffer_size(&mut self)
Reads the maximum size of the data portion of HCI LE ACL Data Packets sent from the Host to
the Controller. The Host will segment the data transmitted to the Controller according to
these values, so that the HCI Data Packets will contain data with up to this size. This
command also returns the total number of HCI LE ACL Data Packets that can be stored in the
data buffers of the Controller. This command must be issued by the Host before it sends any
data to an LE Controller (see Section 4.1.1). Read more
Source§async fn le_read_local_supported_features(&mut self)
async fn le_read_local_supported_features(&mut self)
Requests the list of the supported LE features for the Controller. Read more
Source§async fn le_set_random_address(&mut self, bd_addr: BdAddr) -> Result<(), Error>
async fn le_set_random_address(&mut self, bd_addr: BdAddr) -> Result<(), Error>
Sets the LE Random Device Address in the Controller. Read more
Source§async fn le_set_advertising_parameters(
&mut self,
params: &AdvertisingParameters,
) -> Result<(), Error>
async fn le_set_advertising_parameters( &mut self, params: &AdvertisingParameters, ) -> Result<(), Error>
Sets the advertising parameters on the Controller. Read more
Source§async fn le_read_advertising_channel_tx_power(&mut self)
async fn le_read_advertising_channel_tx_power(&mut self)
Reads the transmit power level used for LE advertising channel packets. Read more
Source§async fn le_set_advertising_data(&mut self, data: &[u8]) -> Result<(), Error>
async fn le_set_advertising_data(&mut self, data: &[u8]) -> Result<(), Error>
Sets the data used in advertising packets that have a data field. Read more
Source§async fn le_set_scan_response_data(&mut self, data: &[u8]) -> Result<(), Error>
async fn le_set_scan_response_data(&mut self, data: &[u8]) -> Result<(), Error>
Provides data used in scanning packets that have a data field. Read more
Source§async fn le_set_advertising_enable(&mut self, enable: bool)
async fn le_set_advertising_enable(&mut self, enable: bool)
Requests the Controller to start or stop advertising. The Controller manages the timing of
advertisements as per the advertising parameters given in the
le_set_advertising_parameters
command. Read moreSource§async fn le_set_scan_parameters(&mut self, params: &ScanParameters)
async fn le_set_scan_parameters(&mut self, params: &ScanParameters)
Sets the scan parameters. Read more
Source§async fn le_set_scan_enable(&mut self, enable: bool, filter_duplicates: bool)
async fn le_set_scan_enable(&mut self, enable: bool, filter_duplicates: bool)
Starts scanning. Scanning is used to discover advertising devices nearby. Read more
Source§async fn le_create_connection(&mut self, params: &ConnectionParameters)
async fn le_create_connection(&mut self, params: &ConnectionParameters)
Creates a Link Layer connection to a connectable advertiser. Read more
Source§async fn le_create_connection_cancel(&mut self)
async fn le_create_connection_cancel(&mut self)
Cancels the
le_create_connection
or
le_extended_create_connection
(for v5.0) command. This command shall only be issued after
the le_create_connection
command has been issued, a
CommandStatus
event has been received for the
le_create_connection
command and before the
LeConnectionComplete
event. Read moreSource§async fn le_read_white_list_size(&mut self)
async fn le_read_white_list_size(&mut self)
Reads the total number of White List entries that can be stored in the Controller. Read more
Source§async fn le_clear_white_list(&mut self)
async fn le_clear_white_list(&mut self)
Clears the white list stored in the Controller. Read more
Source§async fn le_add_device_to_white_list(&mut self, addr: BdAddrType)
async fn le_add_device_to_white_list(&mut self, addr: BdAddrType)
Adds a single device to the white list stored in the Controller. Read more
Source§async fn le_add_anon_advertising_devices_to_white_list(&mut self)
async fn le_add_anon_advertising_devices_to_white_list(&mut self)
Adds anonymous devices sending advertisements to the white list stored in the Controller. Read more
Source§async fn le_remove_device_from_white_list(&mut self, addr: BdAddrType)
async fn le_remove_device_from_white_list(&mut self, addr: BdAddrType)
Removes a single device from the white list stored in the Controller. Read more
Source§async fn le_remove_anon_advertising_devices_from_white_list(&mut self)
async fn le_remove_anon_advertising_devices_from_white_list(&mut self)
Removes anonymous devices sending advertisements from the white list stored in the
Controller. Read more
Source§async fn le_connection_update(&mut self, params: &ConnectionUpdateParameters)
async fn le_connection_update(&mut self, params: &ConnectionUpdateParameters)
Changes the Link Layer connection parameters of a connection. This command may be issued on
both the central and peripheral devices. Read more
Source§async fn le_set_host_channel_classification(
&mut self,
channels: ChannelClassification,
) -> Result<(), Error>
async fn le_set_host_channel_classification( &mut self, channels: ChannelClassification, ) -> Result<(), Error>
Source§async fn le_read_channel_map(&mut self, conn_handle: ConnectionHandle)
async fn le_read_channel_map(&mut self, conn_handle: ConnectionHandle)
Returns the current channel map for the specified connection handle. The returned value
indicates the state of the channel map specified by the last transmitted or received channel
map (in a CONNECT_REQ or LL_CHANNEL_MAP_REQ message) for the specified connection handle,
regardless of whether the Master has received an acknowledgement. Read more
Source§async fn le_read_remote_used_features(&mut self, conn_handle: ConnectionHandle)
async fn le_read_remote_used_features(&mut self, conn_handle: ConnectionHandle)
Requests a list of the used LE features from the remote device. This command shall return a
list of the used LE features. Read more
Source§async fn le_encrypt(&mut self, params: &AesParameters)
async fn le_encrypt(&mut self, params: &AesParameters)
Source§async fn le_rand(&mut self)
async fn le_rand(&mut self)
Requests the Controller to generate 8 octets of random data to be sent to the Host. The
random number shall be generated according to the Bluetooth spec, Vol 2, Part H, Section 2
if the LL Encryption Feature is supported. Read more
Source§async fn le_start_encryption(&mut self, params: &EncryptionParameters)
async fn le_start_encryption(&mut self, params: &EncryptionParameters)
Authenticates the given encryption key associated with the remote device specified by the
connection handle, and once authenticated will encrypt the connection. The parameters are as
defined in the Bluetooth spec, Vol 3, Part H, Section 2.4.4. Read more
Source§async fn le_long_term_key_request_reply(
&mut self,
conn_handle: ConnectionHandle,
key: &EncryptionKey,
)
async fn le_long_term_key_request_reply( &mut self, conn_handle: ConnectionHandle, key: &EncryptionKey, )
Replies to an LE Long Term Key Request event
from the Controller, and specifies the long term key parameter that shall be used for this
connection handle. Read more
Source§async fn le_long_term_key_request_negative_reply(
&mut self,
conn_handle: ConnectionHandle,
)
async fn le_long_term_key_request_negative_reply( &mut self, conn_handle: ConnectionHandle, )
Replies to an LE Long Term Key Request event
from the Controller if the Host cannot provide a Long Term Key for this connection handle. Read more
Source§async fn le_read_supported_states(&mut self)
async fn le_read_supported_states(&mut self)
Reads the states and state combinations that the link layer supports. Read more
Source§async fn le_receiver_test(&mut self, channel: u8) -> Result<(), Error>
async fn le_receiver_test(&mut self, channel: u8) -> Result<(), Error>
Starts a test where the DUT receives test reference packets at a fixed interval. The tester
generates the test reference packets. Read more
Source§async fn le_transmitter_test(
&mut self,
channel: u8,
payload_length: usize,
payload: TestPacketPayload,
) -> Result<(), Error>
async fn le_transmitter_test( &mut self, channel: u8, payload_length: usize, payload: TestPacketPayload, ) -> Result<(), Error>
Starts a test where the DUT generates test reference packets at a fixed interval. The
Controller shall transmit at maximum power. Read more
Source§async fn le_test_end(&mut self)
async fn le_test_end(&mut self)
Stops any test which is in progress. Read more
Source§impl<T> L2capCommands for Twhere
T: Controller,
impl<T> L2capCommands for Twhere
T: Controller,
Source§async fn connection_parameter_update_request(
&mut self,
params: &ConnectionParameterUpdateRequest,
)
async fn connection_parameter_update_request( &mut self, params: &ConnectionParameterUpdateRequest, )
Send an L2CAP connection parameter update request from the peripheral to the central
device. Read more
Source§async fn connection_parameter_update_response(
&mut self,
params: &ConnectionParameterUpdateResponse,
)
async fn connection_parameter_update_response( &mut self, params: &ConnectionParameterUpdateResponse, )
This command should be sent in response to the
L2CapConnectionUpdateResponse
event from the controller. The accept parameter has to be set to true if the connection
parameters given in the event are acceptable. Read moreSource§async fn coc_connect(&mut self, params: &L2CapCocConnect)
async fn coc_connect(&mut self, params: &L2CapCocConnect)
This command sends a Credit-Based Connection Request packet to the specified connection. Read more
Source§async fn coc_connect_confirm(&mut self, params: &L2CapCocConnectConfirm)
async fn coc_connect_confirm(&mut self, params: &L2CapCocConnectConfirm)
This command sends a Credit-Based Connection Response packet. It must be used upon receipt
of a connection request though L2CAP COC Connection
event. Read more
Source§async fn coc_reconfig(&mut self, params: &L2CapCocReconfig)
async fn coc_reconfig(&mut self, params: &L2CapCocReconfig)
This command sends a Credit-Based Reconfigure Request packet on the specified connection. Read more
Source§async fn coc_reconfig_confirm(&mut self, params: &L2CapCocReconfigConfirm)
async fn coc_reconfig_confirm(&mut self, params: &L2CapCocReconfigConfirm)
This command sends a Credit-Based Reconfigure Response packet. It must be use upon receipt
of a Credit-Based Reconfigure Request through
L2CAP COC Reconfigure event. Read more
Source§async fn coc_disconnect(&mut self, channel_index: u8)
async fn coc_disconnect(&mut self, channel_index: u8)
This command sends a Disconnection Request signaling packet on the specified connection-oriented
channel. Read more
Source§async fn coc_flow_control(&mut self, params: &L2CapCocFlowControl)
async fn coc_flow_control(&mut self, params: &L2CapCocFlowControl)
This command sends a Flow Control Credit signaling packet on the specified connection-oriented
channel. Read more
Source§async fn coc_tx_data(&mut self, params: &L2CapCocTxData)
async fn coc_tx_data(&mut self, params: &L2CapCocTxData)
This command sends a K-frame packet on the specified connection-oriented channel. Read more