HinawaFwFcp

HinawaFwFcp — A FCP transaction executor to a FireWire unit

Functions

Properties

gboolean is-bound Read
guint timeout Read / Write / Construct

Signals

void responded Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── HinawaFwResp
        ╰── HinawaFwFcp

Includes

#include <fw_fcp.h>

Description

A HinawaFwFcp supports Function Control Protocol (FCP) in IEC 61883-1, in which no way is defined to match response against command by the contents of frames. In 'AV/C Digital Interface Command Set General Specification Version 4.2' (Sep 1 2004, 1394TA), a pair of command and response is loosely matched by the contents of frames. For convenience, HinawaFwFcp supports synchronous API of command and response for AV/C specification.

Any of transaction frames should be aligned to 8bit (byte). This class is an application of HinawaFwReq / HinawaFwResp.

Functions

hinawa_fw_fcp_error_quark ()

GQuark
hinawa_fw_fcp_error_quark ();

Return the GQuark for error domain of GError which has code in HinawaFwFcpError.

Returns

A GQuark.

Since: 2.1


hinawa_fw_fcp_new ()

HinawaFwFcp *
hinawa_fw_fcp_new (void);

Instantiate HinawaFwFcp object and return the instance.

Returns

an instance of HinawaFwFcp.

Since: 1.3.


hinawa_fw_fcp_transaction ()

void
hinawa_fw_fcp_transaction (HinawaFwFcp *self,
                           const guint8 *req_frame,
                           gsize req_frame_size,
                           guint8 *const *resp_frame,
                           gsize *resp_frame_size,
                           GError **exception);

hinawa_fw_fcp_transaction has been deprecated since version 2.1 and should not be used in newly-written code.

Use hinawa_fw_fcp_avc_transaction(), instead.

Finish the pair of command and response transactions for FCP. The value of “timeout” property is used to wait for response transaction since the command transaction is initiated.

Parameters

self

A HinawaFwFcp.

 

req_frame

An array with elements for request byte data. The value of this argument should point to the array and immutable.

[array length=req_frame_size][in]

req_frame_size

The size of array for request in byte unit.

 

resp_frame

An array with elements for response byte data. 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.

[array length=resp_frame_size][inout]

resp_frame_size

The size of array for response in byte unit. The value of this argument should point to the numerical number and mutable.

 

exception

A GError. Error can be generated with four domains; hinawa_fw_node_error_quark(), hinawa_fw_req_error_quark(), and hinawa_fw_fcp_error_quark().

 

Since: 1.4.


hinawa_fw_fcp_bind ()

void
hinawa_fw_fcp_bind (HinawaFwFcp *self,
                    HinawaFwNode *node,
                    GError **exception);

Start to listen to FCP responses.

Parameters

self

A HinawaFwFcp.

 

node

A HinawaFwNode.

 

exception

A GError. Error can be generated with domain of hinawa_fw_resp_error_quark().

 

Since: 1.4


hinawa_fw_fcp_unbind ()

void
hinawa_fw_fcp_unbind (HinawaFwFcp *self);

Stop to listen to FCP responses.

Parameters

self

A HinawaFwFcp.

 

Since: 1.4.


hinawa_fw_fcp_command ()

void
hinawa_fw_fcp_command (HinawaFwFcp *self,
                       const guint8 *cmd,
                       gsize cmd_size,
                       guint timeout_ms,
                       GError **exception);

Transfer command frame for FCP. When receiving response frame for FCP, “responded” signal is emitted.

Parameters

self

A HinawaFwFcp.

 

cmd

An array with elements for request byte data. The value of this argument should point to the array and immutable.

[array length=cmd_size]

cmd_size

The size of array for request in byte unit.

 

timeout_ms

The timeout to wait for response subaction of transaction for command frame.

 

exception

A GError. Error can be generated with four domains; hinawa_fw_node_error_quark(), hinawa_fw_req_error_quark().

 

Since: 2.1.


hinawa_fw_fcp_avc_transaction ()

void
hinawa_fw_fcp_avc_transaction (HinawaFwFcp *self,
                               const guint8 *cmd,
                               gsize cmd_size,
                               guint8 *const *resp,
                               gsize *resp_size,
                               guint timeout_ms,
                               GError **exception);

Finish the pair of AV/C command and response transactions. The timeout_ms parameter is used to wait for response transaction since the command transaction is initiated, ignoring “timeout” property of instance. The timeout is not expanded in the case that AV/C INTERIM status is arrived, thus the caller should expand the timeout in advance for the case.

Parameters

self

A HinawaFwFcp.

 

cmd

An array with elements for request byte data. The value of this argument should point to the array and immutable.

[array length=cmd_size][in]

cmd_size

The size of array for request in byte unit.

 

resp

An array with elements for response byte data. 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.

[array length=resp_size][inout]

resp_size

The size of array for response in byte unit. The value of this argument should point to the numerical number and mutable.

 

timeout_ms

The timeout to wait for response transaction since command transactions finishes.

 

exception

A GError. Error can be generated with four domains; hinawa_fw_node_error_quark(), hinawa_fw_req_error_quark(), and hinawa_fw_fcp_error_quark().

 

Since: 2.1.

Types and Values

HINAWA_FW_FCP_ERROR

#define HINAWA_FW_FCP_ERROR hinawa_fw_fcp_error_quark()

Property Details

The “is-bound” property

  “is-bound”                 gboolean

Whether this protocol is bound to any instance of HinawaFwNode.

Owner: HinawaFwFcp

Flags: Read

Default value: FALSE

Since: 2.0


The “timeout” property

  “timeout”                  guint

Since 1.4

HinawaFwFcp:timeout has been deprecated since version 2.1 and should not be used in newly-written code.

Use timeout_ms parameter of hinawa_fw_fcp_avc_transaction().

Owner: HinawaFwFcp

Flags: Read / Write / Construct

Allowed values: >= 10

Default value: 200

Signal Details

The “responded” signal

void
user_function (HinawaFwFcp *self,
               gpointer     frame,
               guint        frame_size,
               gpointer     user_data)

When the unit transfers asynchronous packet as response for Echo Audio Fireworks protocol, and the process successfully reads the content of packet from ALSA Fireworks driver, the “responded” signal handler is called with parameters of the response.

Parameters

self

A HinawaFwFcp.

 

frame

The array with elements for byte data of response for Function Control Protocol.

[array length=frame_size][element-type guint8]

frame_size

The number of elements of the array.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 2.1