Hinoko.FwIsoIrMultiple

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new ()

allocate (path, channels)

get_payload (index)

map_buffer (bytes_per_chunk, chunks_per_buffer)

start (cycle_match, sync_code, tags, chunks_per_irq)

Virtual Methods

Inherited:

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

do_interrupted (count)

Properties

Inherited:

Hinoko.FwIsoCtx (2)

Name

Type

Flags

Short Description

channels

GLib.ByteArray

r

The array with elements to express channels to be listened to

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.FwIsoIrMultiple(**kwargs)
Bases:

GObject.Object, Hinoko.FwIsoCtx

Abstract:

No

Structure:

Hinoko.FwIsoIrMultipleClass

An object to receive isochronous packet for several channels. [class`FwIsoIrMultiple`] receives isochronous packets for several channels by buffer-fill mode of IR context in 1394 OHCI.

classmethod new()
Returns:

an instance of [class`FwIsoIrMultiple`].

Return type:

Hinoko.FwIsoIrMultiple

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

allocate(path, channels)
Parameters:
  • path (str) – A path to any Linux FireWire character device.

  • channels (bytes) – an array for channels to listen to. The value of each element should be up to 63.

Raises:

GLib.Error

Return type:

bool

Allocate an IR context to 1394 OHCI hardware for buffer-fill 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.

get_payload(index)
Parameters:

index (int) – the index of packet available in this interrupt.

Returns:

The array with data frame for payload of IR context.

Return type:

payload: bytes

Retrieve data for packet indicated by the index parameter. The data has isochronous packet header in its first quadlet, timestamp in its last quadlet. The rest is data of isochronous packet.

New in version 0.7.

map_buffer(bytes_per_chunk, chunks_per_buffer)
Parameters:
  • bytes_per_chunk (int) – The maximum number of bytes for payload of isochronous packet (not payload for isochronous context).

  • chunks_per_buffer (int) – The number of chunks in buffer.

Raises:

GLib.Error

Return type:

bool

Map an intermediate buffer to share payload of IR context with 1394 OHCI hardware.

start(cycle_match, sync_code, tags, chunks_per_irq)
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.

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

  • chunks_per_irq (int) – The number of chunks per interval of interrupt. When 0 is given, application should call [method`FwIsoCtx`.flush_completions] voluntarily to generate [signal`FwIsoIrMultiple`:py:func:::interrupted<Hinoko.FwIsoIrMultiple.signals.interrupted>] event.

Raises:

GLib.Error

Return type:

bool

Start IR context.

do_interrupted(count) virtual
Parameters:

count (int) – The number of packets available in this interrupt.

Class closure for the [signal`FwIsoIrMultiple`:py:func:::interrupted<Hinoko.FwIsoIrMultiple.signals.interrupted>].

Signal Details

Hinoko.FwIsoIrMultiple.signals.interrupted(fw_iso_ir_multiple, count)
Signal Name:

interrupted

Flags:

RUN_LAST

Parameters:
  • fw_iso_ir_multiple (Hinoko.FwIsoIrMultiple) – The object which received the signal

  • count (int) – The number of packets available in this interrupt.

Emitted when Linux FireWire subsystem generates interrupt event. There are two 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 application calls [method`FwIsoCtx`.flush_completions] explicitly.

The handler of signal can retrieve the content of packet by call of [method`FwIsoIrMultiple`.get_payload].

Property Details

Hinoko.FwIsoIrMultiple.props.channels
Name:

channels

Type:

GLib.ByteArray

Default Value:

None

Flags:

READABLE

The array with elements to express isochronous channels to be listened to.