Hinoko.FwIsoIrSingle¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when Linux FireWire subsystem generates interrupt event. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Hinoko.FwIsoIrSingle(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An object to receive isochronous packet for single channel. [class`FwIsoIrSingle`] receives isochronous packets for single channel by packet-per-buffer mode of IR context in 1394 OHCI. The content of packet is split to two parts; context header and context payload in a manner of Linux FireWire subsystem.
- classmethod new()¶
- Returns:
an instance of [class`FwIsoIrSingle`].
- Return type:
Instantiate [class`FwIsoIrSingle`] object and return the instance.
- allocate(path, channel, header_size)¶
- Parameters:
path (
str
) – A path to any Linux FireWire character device.channel (
int
) – An isochronous channel to listen, up to 63.header_size (
int
) – The number of bytes for header of IR context, greater than 4 at least to include isochronous packet header in header parameter of [signal`FwIsoIrSingle`:py:func:::interrupted<Hinoko.FwIsoIrSingle.signals.interrupted>].
- Raises:
- Returns:
True
if the overall operation finishes successfully, otherwiseFalse
.- Return type:
Allocate an IR context to 1394 OHCI hardware for packet-per-buffer mode. A local node of the node corresponding to the given path is used as the hardware, thus any path is accepted as long as process has enough permission for the path.
The header_size parameter has an effect for the content of header parameter in [signal`FwIsoIrSingle`:py:func:::interrupted<Hinoko.FwIsoIrSingle.signals.interrupted>]. When it’s greater than 8, header includes the series of two quadlets for isochronous packet header and timestamp per isochronous packet. When it’s greater than 12, header includes the part of isochronous packet data per packet.
New in version 0.7.
- get_payload(index)¶
- Parameters:
index (
int
) – the index inner available packets at the event of interrupt.- Returns:
The array with data frame for payload of IR context.
- Return type:
payload:
bytes
Retrieve payload of IR context for a handled packet corresponding to index at the event of interrupt.
New in version 0.7.
- map_buffer(maximum_bytes_per_payload, payloads_per_buffer)¶
- Parameters:
- Raises:
- Returns:
True
if the overall operation finishes successfully, otherwiseFalse
.- Return type:
Map intermediate buffer to share payload of IR context with 1394 OHCI hardware.
New in version 0.7.
- register_packet(schedule_interrupt)¶
- Parameters:
schedule_interrupt (
bool
) – Whether to schedule hardware interrupt at isochronous cycle for the packet.- Raises:
- Returns:
True
if the overall operation finishes successfully, otherwiseFalse
.- Return type:
Register chunk of buffer to process packet for future isochronous cycle. The caller can schedule hardware interrupt to generate interrupt event. In detail, please refer to documentation about [signal`FwIsoIrSingle`:py:func:::interrupted<Hinoko.FwIsoIrSingle.signals.interrupted>] signal.
New in version 0.7.
- start(cycle_match, sync_code, tags)¶
- Parameters:
cycle_match ([
int
] orNone
) – The isochronous cycle to start packet processing. The first element should be the second part of isochronous cycle, up to 3. The second element should be the cycle part of isochronous cycle, up to 7999.sync_code (
int
) – The value of sy field in isochronous packet header for packet processing, up to 15.tags (
Hinoko.FwIsoCtxMatchFlag
) – The value of tag field in isochronous header for packet processing.
- Raises:
- Returns:
True
if the overall operation finishes successfully, otherwiseFalse
.- Return type:
Start IR context.
New in version 0.7.
- do_interrupted(sec, cycle, header, count) virtual¶
- Parameters:
sec (
int
) – The sec part of isochronous cycle when interrupt occurs, up to 7.cycle (
int
) – The cycle part of of isochronous cycle when interrupt occurs, up to 7999.header (
bytes
) – The headers of IR context for packets handled in the event of interrupt. The content is different depending on header_size parameter of [method`FwIsoIrSingle`.allocate].count (
int
) – the number of packets to handle.
Class closure for the [signal`FwIsoIrSingle`:py:func:::interrupted<Hinoko.FwIsoIrSingle.signals.interrupted>] signal.
Signal Details¶
- Hinoko.FwIsoIrSingle.signals.interrupted(fw_iso_ir_single, sec, cycle, header, count)¶
- Signal Name:
interrupted
- Flags:
- Parameters:
fw_iso_ir_single (
Hinoko.FwIsoIrSingle
) – The object which received the signalsec (
int
) – sec part of isochronous cycle when interrupt occurs, up to 7.cycle (
int
) – cycle part of of isochronous cycle when interrupt occurs, up to 7999.header (
bytes
) – The headers of IR context for packets handled in the event of interrupt. The content is different depending on header_size parameter of [method`FwIsoIrSingle`.allocate].count (
int
) – the number of packets to handle.
Emitted when Linux FireWire subsystem generates interrupt event. There are three cases for Linux FireWire subsystem to generate the event:
When 1394 OHCI hardware generates hardware interrupt as a result to process the isochronous packet for the buffer chunk marked to generate hardware interrupt.
When the size of accumulated context header for packets since the last event reaches the size of memory page (usually 4,096 bytes).
When application calls [method`FwIsoCtx`.flush_completions] explicitly.
The handler of signal can retrieve context payload of received packet by call of [method`FwIsoIrSingle`.get_payload].