Hinoko.FwIsoIt¶
- 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.FwIsoIt(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An object to transmit isochronous packet for single channel. [class`FwIsoIt`] transmits isochronous packets for single channel by IT 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`FwIsoIt`].
- Return type:
Instantiate [class`FwIsoIt`] object and return the instance.
- allocate(path, scode, channel, header_size)¶
- Parameters:
path (
str
) – A path to any Linux FireWire character device.scode (
Hinoko.FwScode
) – A [enum`FwScode`] to indicate speed of isochronous communication.channel (
int
) – An isochronous channel to transfer, up to 63.header_size (
int
) – The number of bytes for header of IT context.
- Raises:
- Returns:
True
if the overall operation finishes successful, otherwiseFalse
.- Return type:
Allocate an IT context to 1394 OHCI hardware. 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.
New in version 0.7.
- map_buffer(maximum_bytes_per_payload, payloads_per_buffer)¶
- Parameters:
- Raises:
- Returns:
True
if the overall operation finishes successful, otherwiseFalse
.- Return type:
Map intermediate buffer to share payload of IT context with 1394 OHCI hardware.
New in version 0.7.
- register_packet(tags, sync_code, header, payload, schedule_interrupt)¶
- Parameters:
tags (
Hinoko.FwIsoCtxMatchFlag
) – The value of tag field for isochronous packet to register.sync_code (
int
) – The value of sync field in isochronous packet header for packet processing, up to 15.header (
bytes
orNone
) – The header of IT context for isochronous packet. The length of header should be the same as the size of header indicated in allocation if it’s not null.payload (
bytes
orNone
) – The payload of IT context for isochronous packet.schedule_interrupt (
bool
) – Whether to schedule hardware interrupt at isochronous cycle for the packet.
- Raises:
- Returns:
True
if the overall operation finishes successful, otherwiseFalse
.- Return type:
Register packet data with header and payload for IT context. The content of given header and payload is appended into data field of isochronous packet to be sent. The caller can schedule hardware interrupt to generate interrupt event. In detail, please refer to documentation about [signal`FwIsoIt`:py:func:::interrupted<Hinoko.FwIsoIt.signals.interrupted>].
New in version 0.7.
- start(cycle_match)¶
- 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.- Raises:
- Returns:
True
if the overall operation finishes successful, otherwiseFalse
.- Return type:
Start IT context.
New in version 0.7.
- do_interrupted(sec, cycle, tstamp, count) virtual¶
- Parameters:
Class closure for the [signal`FwIsoIt`:py:func:::interrupted<Hinoko.FwIsoIt.signals.interrupted>] signal.
Signal Details¶
- Hinoko.FwIsoIt.signals.interrupted(fw_iso_it, sec, cycle, tstamp, count)¶
- Signal Name:
interrupted
- Flags:
- Parameters:
fw_iso_it (
Hinoko.FwIsoIt
) – 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.tstamp (
bytes
) – A series of timestamps for packets already handled.count (
int
) – the number of handled packets.
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 of processing the isochronous packet for the buffer chunk marked to generate hardware interrupt.
When the number of isochronous packets sent since the last interrupt event reaches one quarter of memory page size (usually 4,096 / 4 = 1,024 packets).
When application calls [method`FwIsoCtx`.flush_completions] explicitly.