### Interface

# Hitaki EfwProtocol

#### Description [src]

    interface Hitaki.EfwProtocol : GObject.Object

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 `HitakiEfwProtocol` is an object interface for the Fireworks protocol.

#### Prerequisite

In order to implement EfwProtocol, your type must inherit from`GObject`.

#### Implementations

- HitakiSndEfw

#### Instance methods

###### hitaki_efw_protocol_receive_response

Parse the given buffer for response frame of Fireworks transaction. The buffer should includes one response frames at least. It results in `HitakiEfwProtocol::responded` per response frame. It’s expected that the function is used by any implementation of `HitakiEfwProtocol`.

###### hitaki_efw_protocol_transaction

Transfer asynchronous transaction for request frame of Echo Efw protocol and wait for response matched to the command. The call results in `HitakiEfwProtocol::responded` signal with data of response.

###### hitaki_efw_protocol_transmit_request

Transfer asynchronous transaction for request frame of Fireworks transaction. It calls `Hitaki.EfwProtocolInterface.transmit_request` internally after composing request frame. It results in `HitakiEfwProtocol::responded` signal with response parameters when receiving response for the transaction.

#### Signals

###### Hitaki.EfwProtocol::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.

#### Interface structure

    struct HitakiEfwProtocolInterface {
      GTypeInterface iface;
      gboolean (* transmit_request) (
        HitakiEfwProtocol* self,
        const guint8* buffer,
        gsize length,
        GError** error
      );
      void (* get_seqnum) (
        HitakiEfwProtocol* self,
        guint32* seqnum
      );
      void (* responded) (
        HitakiEfwProtocol* self,
        guint version,
        guint seqnum,
        guint category,
        guint command,
        HitakiEfwProtocolError status,
        const guint32* params,
        guint param_count
      );

    }

No description available.

###### Interface members

`iface`

    GTypeInterface

| No description available.

`transmit_request`

    gboolean (* transmit_request) (
        HitakiEfwProtocol* self,
        const guint8* buffer,
        gsize length,
        GError** error
      )

| No description available.

`get_seqnum`

    void (* get_seqnum) (
        HitakiEfwProtocol* self,
        guint32* seqnum
      )

| No description available.

`responded`

    void (* responded) (
        HitakiEfwProtocol* self,
        guint version,
        guint seqnum,
        guint category,
        guint command,
        HitakiEfwProtocolError status,
        const guint32* params,
        guint param_count
      )

| No description available.

#### Virtual methods

###### Hitaki.EfwProtocol.get_seqnum

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.

###### Hitaki.EfwProtocol.responded

Class closure for the `HitakiEfwProtocol::responded` signal.

###### Hitaki.EfwProtocol.transmit_request

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