HinawaFwReq

HinawaFwReq — A transaction executor to a FireWire unit.

Functions

Properties

guint timeout Read / Write / Construct

Signals

void responded Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── HinawaFwReq

Includes

#include <fw_req.h>

Description

A HinawaFwReq supports some types of transactions in IEEE 1212. Mainly for read, write and lock operations.

This class is an application of Linux FireWire subsystem. All of operations utilize ioctl(2) with subsystem specific request commands.

Functions

hinawa_fw_req_error_quark ()

GQuark
hinawa_fw_req_error_quark ();

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

Returns

A GQuark.

Since: 2.1


hinawa_fw_req_new ()

HinawaFwReq *
hinawa_fw_req_new (void);

Instantiate HinawaFwReq object and return the instance.

Returns

an instance of HinawaFwReq.

Since: 1.3.


hinawa_fw_req_transaction_async ()

void
hinawa_fw_req_transaction_async (HinawaFwReq *self,
                                 HinawaFwNode *node,
                                 HinawaFwTcode tcode,
                                 guint64 addr,
                                 gsize length,
                                 guint8 *const *frame,
                                 gsize *frame_size,
                                 GError **exception);

Execute request subaction of transactions to the given node according to given code. When the response subaction arrives and read the contents, “responded” signal handler is called as long as event dispatcher runs.

Parameters

self

A HinawaFwReq.

 

node

A HinawaFwNode.

 

tcode

A transaction code of HinawaFwTcode.

 

addr

A destination address of target device

 

length

The range of address in byte unit.

 

frame

An array with elements for 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 for read and lock transaction.

[array length=frame_size][inout]

frame_size

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

 

exception

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

 

Since: 2.1.


hinawa_fw_req_transaction_sync ()

void
hinawa_fw_req_transaction_sync (HinawaFwReq *self,
                                HinawaFwNode *node,
                                HinawaFwTcode tcode,
                                guint64 addr,
                                gsize length,
                                guint8 *const *frame,
                                gsize *frame_size,
                                guint timeout_ms,
                                GError **exception);

Execute request subaction of transaction to the given node according to given code, then wait for response subaction within the given timeout. The “timeout” property of instance is ignored.

Parameters

self

A HinawaFwReq.

 

node

A HinawaFwNode.

 

tcode

A transaction code of HinawaFwTcode.

 

addr

A destination address of target device

 

length

The range of address in byte unit.

 

frame

An array with elements for 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 for read and lock transaction.

[array length=frame_size][inout]

frame_size

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

 

timeout_ms

The timeout to wait for response subaction of the transaction since request subaction is initiated, in milliseconds.

 

exception

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

 

Since: 2.1.


hinawa_fw_req_transaction ()

void
hinawa_fw_req_transaction (HinawaFwReq *self,
                           HinawaFwNode *node,
                           HinawaFwTcode tcode,
                           guint64 addr,
                           gsize length,
                           guint8 *const *frame,
                           gsize *frame_size,
                           GError **exception);

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

Use hinawa_fw_req_transaction_sync(), instead.

Execute request subaction of transaction to the given node according to given code, then wait for response subaction within “timeout”.

Parameters

self

A HinawaFwReq.

 

node

A HinawaFwNode.

 

tcode

A transaction code of HinawaFwTcode.

 

addr

A destination address of target device

 

length

The range of address in byte unit.

 

frame

An array with elements for 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 for read and lock transaction.

[array length=frame_size][inout]

frame_size

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

 

exception

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

 

Since: 1.4

Types and Values

HINAWA_FW_REQ_ERROR

#define HINAWA_FW_REQ_ERROR hinawa_fw_req_error_quark()

Property Details

The “timeout” property

  “timeout”                  guint

An elapse to expire waiting for response by ms unit.

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

Use timeout_ms parameter of hinawa_fw_req_transaction_sync().

Owner: HinawaFwReq

Flags: Read / Write / Construct

Allowed values: >= 10

Default value: 200

Since: 1.4

Signal Details

The “responded” signal

void
user_function (HinawaFwReq  *self,
               HinawaFwRcode rcode,
               gpointer      frame,
               guint         frame_size,
               gpointer      user_data)

When the unit transfers asynchronous packet as response subaction for the transaction, and the process successfully reads the content of packet from Linux firewire subsystem, the “responded” signal handler is called.

Parameters

self

A HinawaFwReq.

 

rcode

One of HinawaFwRcode.

 

frame

The array with elements for byte data of response subaction for transaction.

[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