Hinawa.FwReq¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
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:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Hinawa.FwReq(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
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 devicelength (
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:
- 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:
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 devicelength (
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:
- Returns:
True
if the overall operation finishes successfully, otherwiseFalse
.- 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:
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 devicelength (
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:
- Returns:
True
if the overall operation finishes successfully, otherwiseFalse
.- 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:
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:
- Parameters:
fw_req (
Hinawa.FwReq
) – The object which received the signalrcode (
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.