Pigweed
 
Loading...
Searching...
No Matches
pw::bluetooth::Controller2 Class Referenceabstract

#include <controller2.h>

Inheritance diagram for pw::bluetooth::Controller2:
pw::channel::Implement< pw::channel::ReliableDatagramReaderWriter >

Public Types

enum class  FeaturesBits : uint32_t { kHciSco = (1 << 0) , kSetAclPriorityCommand = (1 << 1) , kAndroidVendorExtensions = (1 << 2) }
 Bitmask of features the controller supports. More...
 
enum class  ScoCodingFormat : uint8_t { kCvsd , kMsbc }
 
enum class  ScoEncoding : uint8_t { k8Bits , k16Bits }
 
enum class  ScoSampleRate : uint8_t { k8Khz , k16Khz }
 

Public Member Functions

virtual async2::Poll< StatusPendError (async2::Context &cx)=0
 
virtual async2::OnceReceiver< StatusInitialize ()=0
 
virtual async2::OnceReceiver< StatusConfigureSco (ScoCodingFormat coding_format, ScoEncoding encoding, ScoSampleRate sample_rate)=0
 
virtual async2::OnceReceiver< StatusResetSco ()=0
 
virtual async2::OnceReceiver< FeaturesBitsGetFeatures ()=0
 
virtual async2::OnceReceiver< Result< multibuf::MultiBuf > > EncodeVendorCommand (VendorCommandParameters parameters)=0
 

Detailed Description

The Controller class is a shim for communication between the Host and the Controller. Controller is a pw::Channel used to send and receive HCI packets. The first byte of each datagram is a UART packet indicator (H4PacketType Emboss enum).

Member Enumeration Documentation

◆ FeaturesBits

enum class pw::bluetooth::Controller2::FeaturesBits : uint32_t
strong

Bitmask of features the controller supports.

Enumerator
kHciSco 

Indicates support for transferring Synchronous Connection-Oriented (SCO) link data over the HCI. Offloaded SCO links may still be supported even if HCI SCO isn't.

kSetAclPriorityCommand 

Indicates support for the Set Acl Priority command.

kAndroidVendorExtensions 

Indicates support for the LE_Get_Vendor_Capabilities command documented at HCI requirements.

Member Function Documentation

◆ ConfigureSco()

virtual async2::OnceReceiver< Status > pw::bluetooth::Controller2::ConfigureSco ( ScoCodingFormat  coding_format,
ScoEncoding  encoding,
ScoSampleRate  sample_rate 
)
pure virtual

Configure the HCI for a SCO connection with the indicated parameters.

Returns
  • OK - success, packets can be sent/received.
  • UNIMPLEMENTED - the implementation/controller does not support SCO over HCI
  • ALREADY_EXISTS - a SCO connection is already configured
  • INTERNAL - an internal error occurred

◆ EncodeVendorCommand()

virtual async2::OnceReceiver< Result< multibuf::MultiBuf > > pw::bluetooth::Controller2::EncodeVendorCommand ( VendorCommandParameters  parameters)
pure virtual

Encode the vendor-specific HCI command for a generic type of vendor command, and return the encoded command in a buffer.

Parameters
parametersVendor command to encode.
Returns
Returns the result of the encoding request. On success, contains the command buffer.

◆ GetFeatures()

virtual async2::OnceReceiver< FeaturesBits > pw::bluetooth::Controller2::GetFeatures ( )
pure virtual
Returns
A bitmask of features supported by the controller.

◆ Initialize()

virtual async2::OnceReceiver< Status > pw::bluetooth::Controller2::Initialize ( )
pure virtual

Initializes the controller interface and starts processing packets. Asynchronously returns the result of initialization.

On success, HCI packets may now be sent and received with this object.

◆ PendError()

virtual async2::Poll< Status > pw::bluetooth::Controller2::PendError ( async2::Context cx)
pure virtual

Returns Ready when fatal errors occur after initialization. After a fatal error, this object is invalid.

◆ ResetSco()

virtual async2::OnceReceiver< Status > pw::bluetooth::Controller2::ResetSco ( )
pure virtual

Releases the resources held by an active SCO connection. This should be called when a SCO connection is closed. No-op if no SCO connection is configured.

Returns
  • OK - success, the SCO configuration was reset.
  • UNIMPLEMENTED - the implementation/controller does not support SCO over
  • HCI INTERNAL - an internal error occurred

The documentation for this class was generated from the following file: