Hinoko.FwIsoResource

g GObject.GInterface GObject.GInterface Hinoko.FwIsoResource Hinoko.FwIsoResource GObject.GInterface->Hinoko.FwIsoResource

Implementations:

Hinoko.FwIsoResourceAuto, Hinoko.FwIsoResourceOnce

Methods

class

calculate_bandwidth (bytes_per_payload, scode)

allocate (channel_candidates, bandwidth)

allocate_wait (channel_candidates, bandwidth, timeout_ms)

create_source ()

open (path, open_flag)

Virtual Methods

do_allocate (channel_candidates, bandwidth)

do_allocated (channel, bandwidth, error)

do_create_source ()

do_deallocated (channel, bandwidth, error)

do_open (path, open_flag)

Properties

Name

Type

Flags

Short Description

generation

int

r/en

The numeric value of current generation for bus topology

Signals

Name

Short Description

allocated

Emitted when allocation of isochronous resource finishes.

deallocated

Emitted when deallocation of isochronous resource finishes.

Fields

None

Class Details

class Hinoko.FwIsoResource
Bases:

GObject.GInterface

Structure:

Hinoko.FwIsoResourceInterface

A set of basic interfaces to listen to events about isochronous resource. [iface`FwIsoResource`] includes interfaces to listen to events about allocation and deallocation of isochronous resource.

New in version 0.7.

classmethod calculate_bandwidth(bytes_per_payload, scode)
Parameters:
  • bytes_per_payload (int) – The number of bytes in payload of isochronous packet.

  • scode (Hinoko.FwScode) – The speed of transmission.

Returns:

The amount of bandwidth expected to be consumed.

Return type:

int

Calculate the amount of bandwidth expected to be consumed in allocation unit by given parameters.

allocate(channel_candidates, bandwidth)
Parameters:
  • channel_candidates (bytes) – The array with elements for numeric number of isochronous channel to be allocated.

  • bandwidth (int) – The amount of bandwidth to be allocated.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

Return type:

bool

Initiate allocation of isochronous resource without any wait. One of the candidates is actually allocated for channel. When the allocation finishes, [signal`FwIsoResource`:py:func:::allocated<Hinoko.FwIsoResource.signals.allocated>] signal is emitted to notify the result, channel, and bandwidth.

New in version 1.0.

allocate_wait(channel_candidates, bandwidth, timeout_ms)
Parameters:
  • channel_candidates (bytes) – The array with elements for numeric number for isochronous channel to be allocated.

  • bandwidth (int) – The amount of bandwidth to be allocated.

  • timeout_ms (int) – The timeout to wait for allocated event.

Raises:

GLib.Error

Returns:

True if the overall operation finishes successfully, otherwise False.

Return type:

bool

Initiate allocation of isochronous resource and wait for [signal`FwIsoResource`:py:func:::allocated<Hinoko.FwIsoResource.signals.allocated>] signal. One of the candidates is actually allocated for channel.

New in version 1.0.

create_source()
Raises:

GLib.Error

Returns:

True if the overall operation finished successfully, otherwise False.

source:

A [struct`GLib`.Source]

Return type:

(bool, source: GLib.Source)

Create [struct`GLib`.Source] for [struct`GLib`.MainContext] to dispatch events for isochronous resource.

New in version 0.7.

open(path, open_flag)
Parameters:
  • path (str) – A path of any Linux FireWire character device.

  • open_flag (int) – The flag of open(2) system call. O_RDONLY is forced to fulfil internally.

Raises:

GLib.Error

Returns:

True if the overall operation finished successfully, otherwise False.

Return type:

bool

Open Linux FireWire character device to delegate any request for isochronous resource management to Linux FireWire subsystem.

New in version 0.7.

do_allocate(channel_candidates, bandwidth) virtual
Parameters:
  • channel_candidates (bytes) – The array with elements for numeric number of isochronous channel to be allocated.

  • bandwidth (int) – The amount of bandwidth to be allocated.

Returns:

True if the overall operation finishes successfully, otherwise False.

Return type:

bool

Initiate allocation of isochronous resource without any wait. One of the candidates is actually allocated for channel. When the allocation finishes, [signal`FwIsoResource`:py:func:::allocated<Hinoko.FwIsoResource.signals.allocated>] signal is emitted to notify the result, channel, and bandwidth.

New in version 1.0.

do_allocated(channel, bandwidth, error) virtual
Parameters:
  • channel (int) – The deallocated channel number.

  • bandwidth (int) – The deallocated amount of bandwidth.

  • error (GLib.Error or None) – A [struct`GLib`.Error]. Error can be generated with domain of [error`FwIsoResourceError`] and its EVENT code.

Closure for the [signal`FwIsoResource`:py:func:::allocated<Hinoko.FwIsoResource.signals.allocated>] signal.

New in version 0.7.

do_create_source() virtual
Returns:

True if the overall operation finished successfully, otherwise False.

source:

A [struct`GLib`.Source]

Return type:

(bool, source: GLib.Source)

Create [struct`GLib`.Source] for [struct`GLib`.MainContext] to dispatch events for isochronous resource.

New in version 0.7.

do_deallocated(channel, bandwidth, error) virtual
Parameters:
  • channel (int) – The deallocated channel number.

  • bandwidth (int) – The deallocated amount of bandwidth.

  • error (GLib.Error or None) – A [struct`GLib`.Error]. Error can be generated with domain of [error`FwIsoResourceError`] and its EVENT code.

Closure for the [signal`FwIsoResource`:py:func:::deallocated<Hinoko.FwIsoResource.signals.deallocated>] signal.

New in version 0.7.

do_open(path, open_flag) virtual
Parameters:
  • path (str) – A path of any Linux FireWire character device.

  • open_flag (int) – The flag of open(2) system call. O_RDONLY is forced to fulfil internally.

Returns:

True if the overall operation finished successfully, otherwise False.

Return type:

bool

Open Linux FireWire character device to delegate any request for isochronous resource management to Linux FireWire subsystem.

New in version 0.7.

Signal Details

Hinoko.FwIsoResource.signals.allocated(fw_iso_resource, channel, bandwidth, error)
Signal Name:

allocated

Flags:

RUN_LAST, ACTION

Parameters:
  • fw_iso_resource (Hinoko.FwIsoResource) – The object which received the signal

  • channel (int) – The deallocated channel number.

  • bandwidth (int) – The deallocated amount of bandwidth.

  • error (GLib.Error or None) – A [struct`GLib`.Error]. Error can be generated with domain of [error`FwIsoResourceError`] and its EVENT code.

Emitted when allocation of isochronous resource finishes.

New in version 0.7.

Hinoko.FwIsoResource.signals.deallocated(fw_iso_resource, channel, bandwidth, error)
Signal Name:

deallocated

Flags:

RUN_LAST, ACTION

Parameters:
  • fw_iso_resource (Hinoko.FwIsoResource) – The object which received the signal

  • channel (int) – The deallocated channel number.

  • bandwidth (int) – The deallocated amount of bandwidth.

  • error (GLib.Error or None) – A [struct`GLib`.Error]. Error can be generated with domain of [error`FwIsoResourceError`] and its EVENT code.

Emitted when deallocation of isochronous resource finishes.

New in version 0.7.

Property Details

Hinoko.FwIsoResource.props.generation
Name:

generation

Type:

int

Default Value:

0

Flags:

READABLE, EXPLICIT_NOTIFY

The numeric value of current generation for bus topology