Hinoko.FwIsoIt

g GObject.GInterface GObject.GInterface Hinoko.FwIsoCtx Hinoko.FwIsoCtx GObject.GInterface->Hinoko.FwIsoCtx GObject.Object GObject.Object Hinoko.FwIsoIt Hinoko.FwIsoIt GObject.Object->Hinoko.FwIsoIt Hinoko.FwIsoCtx->Hinoko.FwIsoIt

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Hinoko.FwIsoCtx (6)

Structs:

GObject.ObjectClass (5)

class

new ()

allocate (path, scode, channel, header_size)

map_buffer (maximum_bytes_per_payload, payloads_per_buffer)

register_packet (tags, sync_code, header, payload, schedule_interrupt)

start (cycle_match)

Virtual Methods

Inherited:

GObject.Object (7), Hinoko.FwIsoCtx (7)

do_interrupted (sec, cycle, tstamp, count)

Properties

Inherited:

Hinoko.FwIsoCtx (2)

Signals

Inherited:

GObject.Object (1), Hinoko.FwIsoCtx (1)

Name

Short Description

interrupted

Emitted when Linux FireWire subsystem generates interrupt event.

Fields

Inherited:

GObject.Object (1), Hinoko.FwIsoCtx (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Hinoko.FwIsoIt(**kwargs)
Bases:

GObject.Object, Hinoko.FwIsoCtx

Abstract:

No

Structure:

Hinoko.FwIsoItClass

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:

Hinoko.FwIsoIt

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:

GLib.Error

Returns:

True if the overall operation finishes successful, otherwise False.

Return type:

bool

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:
  • maximum_bytes_per_payload (int) – The number of bytes for payload of IT context.

  • payloads_per_buffer (int) – The number of payloads of IT context in buffer.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successful, otherwise False.

Return type:

bool

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 or None) – 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 or None) – The payload of IT context for isochronous packet.

  • schedule_interrupt (bool) – Whether to schedule hardware interrupt at isochronous cycle for the packet.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successful, otherwise False.

Return type:

bool

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] or None) – 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:

GLib.Error

Returns:

True if the overall operation finishes successful, otherwise False.

Return type:

bool

Start IT context.

New in version 0.7.

do_interrupted(sec, cycle, tstamp, 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.

  • tstamp (bytes) – A series of timestamps for packets already handled.

  • count (int) – the number of handled packets.

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:

RUN_LAST

Parameters:
  • fw_iso_it (Hinoko.FwIsoIt) – The object which received the signal

  • sec (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.