Hinawa.FwReq

g GObject.Object GObject.Object Hinawa.FwReq Hinawa.FwReq GObject.Object->Hinawa.FwReq

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

request (node, tcode, addr, length, frame)

transaction (node, tcode, addr, length, frame, timeout_ms)

transaction_with_tstamp (node, tcode, addr, length, frame, timeout_ms)

Virtual Methods

Inherited:

GObject.Object (7)

do_responded (rcode, request_tstamp, response_tstamp, frame)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

responded

Emitted when the node transfers asynchronous packet as response subaction for the transaction and the process successfully reads the content of packet from Linux firewire subsystem.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Hinawa.FwReq(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Hinawa.FwReqClass

A transaction executor to a node in IEEE 1394 bus. [class`FwReq`] supports all types of transactions defiend in IEEE 1212.

classmethod new()
Returns:

an instance of [class`FwReq`].

Return type:

Hinawa.FwReq

Instantiate [class`FwReq`] object and return the instance.

New in version 1.3.

request(node, tcode, addr, length, frame)
Parameters:
  • node (Hinawa.FwNode) – A [class`FwNode`].

  • tcode (Hinawa.FwTcode) – A transaction code of [enum`FwTcode`].

  • addr (int) – A destination address of target device

  • length (int) – The range of address in byte unit.

  • frame (bytes) – 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.

Raises:

GLib.Error

Returns:

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.

Return type:

(bool, frame: bytes)

Execute request subaction of transaction to the given node according to given code. When the response subaction arrives and running event dispatcher reads the contents, [signal`FwReq`:py:func:::responded<Hinawa.FwReq.signals.responded>] signal handler is called.

New in version 4.0.

transaction(node, tcode, addr, length, frame, timeout_ms)
Parameters:
  • node (Hinawa.FwNode) – A [class`FwNode`].

  • tcode (Hinawa.FwTcode) – A transaction code of [enum`FwTcode`].

  • addr (int) – A destination address of target device

  • length (int) – The range of address in byte unit.

  • frame (bytes) – 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.

  • timeout_ms (int) – The timeout to wait for response subaction of the transaction since request subaction is initiated, in milliseconds.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

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.

Return type:

(bool, frame: bytes)

Execute request subaction of transaction to the given node according to given code, then wait for response subaction within the value of timeout argument. The function is a thin wrapper to [method`FwReq`.transaction_with_tstamp].

New in version 4.0.

transaction_with_tstamp(node, tcode, addr, length, frame, timeout_ms)
Parameters:
  • node (Hinawa.FwNode) – A [class`FwNode`].

  • tcode (Hinawa.FwTcode) – A transaction code of [enum`FwTcode`].

  • addr (int) – A destination address of target device

  • length (int) – The range of address in byte unit.

  • frame (bytes) – 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.

  • timeout_ms (int) – The timeout to wait for the response subaction of transaction since the request subaction is initiated, in milliseconds.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

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.

tstamp:

The array with two elements for time stamps. The first element is for the isochronous cycle at which the request subaction was sent. The second element is for the isochronous cycle at which the response subaction arrived.

Return type:

(bool, frame: bytes, tstamp: [int])

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

Each value of tstamp is unsigned 16 bit integer including higher 3 bits for three low order bits of second field and the rest 13 bits for cycle field in the format of IEEE 1394 CYCLE_TIMER register.

If the version of kernel ABI for Linux FireWire subsystem is less than 6, each element of tstamp has invalid value (=:obj:GObject.G_MAXUINT).

New in version 2.6.

do_responded(rcode, request_tstamp, response_tstamp, frame) virtual
Parameters:
  • rcode (Hinawa.FwRcode) – One of [enum`FwRcode`].

  • request_tstamp (int) – The isochronous cycle at which the request subaction was sent for the transaction.

  • response_tstamp (int) – The isochronous cycle at which the response subaction arrived for the transaction.

  • frame (bytes) – The array with elements for byte data of the response subaction of transaction.

Class closure for the [signal`FwReq`:py:func:::responded<Hinawa.FwReq.signals.responded>] signal.

New in version 4.0.

Signal Details

Hinawa.FwReq.signals.responded(fw_req, rcode, request_tstamp, response_tstamp, frame)
Signal Name:

responded

Flags:

RUN_LAST

Parameters:
  • fw_req (Hinawa.FwReq) – The object which received the signal

  • rcode (Hinawa.FwRcode) – One of [enum`FwRcode`].

  • request_tstamp (int) – The isochronous cycle at which the request subaction was sent for the transaction.

  • response_tstamp (int) – The isochronous cycle at which the response subaction arrived for the transaction.

  • frame (bytes) – The array with elements for byte data of response subaction for the transaction.

Emitted when the node transfers asynchronous packet as response subaction for the transaction and the process successfully reads the content of packet from Linux firewire subsystem.

The values of request_tstamp and response_tstamp are unsigned 16 bit integer including higher 3 bits for three low order bits of second field and the rest 13 bits for cycle field in the format of IEEE 1394 CYCLE_TIMER register.

If the version of kernel ABI for Linux FireWire subsystem is less than 6, the request_tstamp and response_tstamp argument has invalid value (=:obj:GObject.G_MAXUINT).

New in version 4.0.