Hitaki.EfwProtocol

g GObject.GInterface GObject.GInterface Hitaki.EfwProtocol Hitaki.EfwProtocol GObject.GInterface->Hitaki.EfwProtocol

Implementations:

Hitaki.SndEfw

Methods

receive_response (buffer)

transaction (category, command, args, params, timeout_ms)

transmit_request (category, command, args)

Virtual Methods

do_get_seqnum ()

do_responded (version, seqnum, category, command, status, params)

do_transmit_request (buffer)

Properties

None

Signals

Name

Short Description

responded

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:

GObject.GInterface

Structure:

Hitaki.EfwProtocolInterface

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] or None) – An array with elements for quadlet data as arguments for command.

  • params ([int] or None) – 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:

GLib.Error

Returns:

True if the overall operation finished successfully, else False.

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:

(bool, params: [int])

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:
  • category (int) – One of category for the transaction.

  • command (int) – One of commands for the transaction.

  • args ([int] or None) – An array with elements of quadlet data for arguments of command.

Raises:

GLib.Error

Returns:

True if the overall operation finished successfully, else False.

resp_seqnum:

The sequence number to match response.

Return type:

(bool, resp_seqnum: int)

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.

do_transmit_request(buffer) virtual
Parameters:

buffer (bytes) – The content of request frame for transaction.

Return type:

bool

Virtual function to transmit the content of request frame to target device.

Signal Details

Hitaki.EfwProtocol.signals.responded(efw_protocol, version, seqnum, category, command, status, params)
Signal Name:

responded

Flags:

RUN_LAST, ACTION

Parameters:
  • efw_protocol (Hitaki.EfwProtocol) – The object which received the signal

  • 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.

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.