Hitaki.EfwProtocol¶
- Implementations:
Methods¶
|
|
|
|
|
Virtual Methods¶
|
|
|
Properties¶
None
Signals¶
Name |
Short Description |
---|---|
Emitted when the unit transfers asynchronous packet as response of Echo Audio Efw transaction and the process successfully reads the content of response from ALSA Efw driver. |
Fields¶
None
Class Details¶
- class Hitaki.EfwProtocol¶
- Bases:
- Structure:
An interface for Fireworks Protocol. Echo Audio Fireworks devices listen to specific address space for specific request frame. When accepting and handling the request frame, it transfers response frame to specific address in requester. The [iface`EfwProtocol`] is an object interface for the Fireworks protocol.
- receive_response(buffer)¶
- Parameters:
buffer (
bytes
) – The buffer for transaction frames.
Parse the given buffer for response frame of Fireworks transaction. The buffer should includes one response frames at least. It results in [signal`EfwProtocol`:py:func:::responded<Hitaki.EfwProtocol.signals.responded>] per response frame. It’s expected that the function is used by any implementation of [iface`EfwProtocol`].
- transaction(category, command, args, params, timeout_ms)¶
- Parameters:
category (
int
) – One of category for the transaction.command (
int
) – One of commands for the transaction.args ([
int
] orNone
) – An array with elements for quadlet data as arguments for command.params ([
int
] orNone
) – An array with elements for quadlet data to save parameters in response. Callers should give it for buffer with enough space against the request since this library performs no reallocation. Due to the reason, the value of this argument should point to the pointer to the array and immutable. The content of array is mutable for parameters in response.timeout_ms (
int
) – The timeout to wait for response.
- Raises:
- Returns:
True
if the overall operation finished successfully, elseFalse
.- params:
An array with elements for quadlet data to save parameters in response. Callers should give it for buffer with enough space against the request since this library performs no reallocation. Due to the reason, the value of this argument should point to the pointer to the array and immutable. The content of array is mutable for parameters in response.
- Return type:
Transfer asynchronous transaction for request frame of Echo Efw protocol and wait for response matched to the command. The call results in [signal`EfwProtocol`:py:func:::responded<Hitaki.EfwProtocol.signals.responded>] signal with data of response.
- transmit_request(category, command, args)¶
- Parameters:
- Raises:
- Returns:
True
if the overall operation finished successfully, elseFalse
.- resp_seqnum:
The sequence number to match response.
- Return type:
Transfer asynchronous transaction for request frame of Fireworks transaction. It calls [vfunc`EfwProtocol`.transmit_request] internally after composing request frame. It results in [signal`EfwProtocol`:py:func:::responded<Hitaki.EfwProtocol.signals.responded>] signal with response parameters when receiving response for the transaction.
- do_get_seqnum() virtual¶
- Returns:
The sequence number for request frame of transaction.
- Return type:
seqnum:
int
Virtual function to retrieve the sequence number for request frame of transaction. The number is used for the frame transmitted to device, then the device is expected to transmit response frame with the number incremented by 1.
- do_responded(version, seqnum, category, command, status, params) virtual¶
- Parameters:
version (
int
) – The version of transaction protocol.seqnum (
int
) – The sequence number of response.category (
int
) – The value of category field in the response.command (
int
) – The value of command field in the response.status (
Hitaki.EfwProtocolError
) – The status of response.params ([
int
]) – The array with quadlet elements of parameters in response of Fireworks protocol.
Class closure for the [signal`EfwProtocol`:py:func:::responded<Hitaki.EfwProtocol.signals.responded>] signal.
Signal Details¶
- Hitaki.EfwProtocol.signals.responded(efw_protocol, version, seqnum, category, command, status, params)¶
- Signal Name:
responded
- Flags:
- Parameters:
efw_protocol (
Hitaki.EfwProtocol
) – The object which received the signalversion (
int
) – The version of transaction protocol.seqnum (
int
) – The sequence number of response.category (
int
) – The value of category field in the response.command (
int
) – The value of command field in the response.status (
Hitaki.EfwProtocolError
) – The status of response.params ([
int
]) – The array with quadlet elements of parameters in response of Fireworks protocol.
Emitted when the unit transfers asynchronous packet as response of Echo Audio Efw transaction and the process successfully reads the content of response from ALSA Efw driver.