Hinawa.FwFcp

g GObject.Object GObject.Object Hinawa.FwResp Hinawa.FwResp GObject.Object->Hinawa.FwResp Hinawa.FwFcp Hinawa.FwFcp Hinawa.FwResp->Hinawa.FwFcp

Subclasses:

None

Methods

Inherited:

Hinawa.FwResp (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

avc_transaction (cmd, resp, timeout_ms)

avc_transaction_with_tstamp (cmd, resp, timeout_ms)

bind (node)

command (cmd, timeout_ms)

command_with_tstamp (cmd, timeout_ms)

unbind ()

Virtual Methods

Inherited:

Hinawa.FwResp (1), GObject.Object (7)

do_responded (generation, tstamp, frame)

Properties

Inherited:

Hinawa.FwResp (3)

Name

Type

Flags

Short Description

is-bound

bool

r

Whether this protocol is bound to any instance of Hinawa.FwNode.

Signals

Inherited:

Hinawa.FwResp (1), GObject.Object (1)

Name

Short Description

responded

Emitted when the node transfers asynchronous packet as response for FCP and the process successfully read the content of packet.

Fields

Inherited:

Hinawa.FwResp (1), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Hinawa.FwResp

r

Class Details

class Hinawa.FwFcp(**kwargs)
Bases:

Hinawa.FwResp

Abstract:

No

Structure:

Hinawa.FwFcpClass

A FCP transaction executor to node in IEEE 1394 bus. [class`FwFcp`] supports Function Control Protocol (FCP) in IEC 61883-1. FCP transaction consists of a pair of asynchronous transactions for command and response, while the protocol has no mechanism to match them. In AV/C Digital Interface Command Set General Specification Version 4.2 (Sep 1 2004, 1394TA), they are loosely matched by the content of their frames, and this class employs the way.

Any of transaction frames should be aligned to 8 bit (1 byte). This class is an application of [class`FwReq`] / [class`FwResp`].

classmethod new()
Returns:

an instance of [class`FwFcp`].

Return type:

Hinawa.FwFcp

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

New in version 1.3.

avc_transaction(cmd, resp, timeout_ms)
Parameters:
  • cmd (bytes) – An array with elements for request byte data. The value of this argument should point to the array and immutable.

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

  • timeout_ms (int) – The timeout to wait for response transaction since command transactions finishes.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

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.

Return type:

(bool, resp: bytes)

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

New in version 4.0.

avc_transaction_with_tstamp(cmd, resp, timeout_ms)
Parameters:
  • cmd (bytes) – An array with elements for request byte data. The value of this argument should point to the array and immutable.

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

  • timeout_ms (int) – The timeout to wait for response transaction since command transactions finishes.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

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.

tstamp:

The array with three elements for time stamps. The first element is for the isochronous cycle at which the request was sent for the command of FCP transaction. The second element is for the isochronous cycle at which the response arrived for the command of FCP transaction. The third element is for the isochronous cycle at which the request was sent for the response of FCP transaction.

Return type:

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

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

New in version 2.6.

bind(node)
Parameters:

node (Hinawa.FwNode) – A [class`FwNode`].

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

Return type:

bool

Start to listen to FCP responses.

New in version 4.0.

command(cmd, timeout_ms)
Parameters:
  • cmd (bytes) – An array with elements for request byte data. The value of this argument should point to the array and immutable.

  • timeout_ms (int) – The timeout to wait for response subaction of transaction for command frame.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

Return type:

bool

Transfer command frame for FCP. When receiving response frame for FCP, [signal`FwFcp`:py:func:::responded<Hinawa.FwFcp.signals.responded>] signal is emitted.

New in version 4.0.

command_with_tstamp(cmd, timeout_ms)
Parameters:
  • cmd (bytes) – An array with elements for request byte data. The value of this argument should point to the array and immutable.

  • timeout_ms (int) – The timeout to wait for response subaction of transaction for command frame.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

tstamp:

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

Return type:

(bool, tstamp: [int])

Transfer command frame for FCP. When receiving response frame for FCP, [signal`FwFcp`:py:func:::responded<Hinawa.FwFcp.signals.responded>] signal is emitted.

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_MAXUINT16).

New in version 2.6.

unbind()

Stop to listen to FCP responses. Any pending transactions are forced to be aborted.

New in version 1.4.

do_responded(generation, tstamp, frame) virtual
Parameters:
  • generation (int) – The generation of bus topology.

  • tstamp (int) – The time stamp at which the request subaction arrived for the response of FCP transaction.

  • frame (bytes) – The array with elements for byte data in the response of Function Control Protocol.

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

New in version 4.0.

Signal Details

Hinawa.FwFcp.signals.responded(fw_fcp, generation, tstamp, frame)
Signal Name:

responded

Flags:

RUN_LAST

Parameters:
  • fw_fcp (Hinawa.FwFcp) – The object which received the signal

  • generation (int) – The generation of bus topology.

  • tstamp (int) – The time stamp at which the request arrived for the response of FCP transaction.

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

Emitted when the node transfers asynchronous packet as response for FCP and the process successfully read the content of packet.

The values 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, the value of tstamp argument has invalid value (=:obj:GObject.G_MAXUINT).

New in version 4.0.

Property Details

Hinawa.FwFcp.props.is_bound
Name:

is-bound

Type:

bool

Default Value:

False

Flags:

READABLE

Whether this protocol is bound to any instance of Hinawa.FwNode.

New in version 2.0.