Module losc.bundle

OSC Bundle.

An OSC Bundle consists of the OSC-string "#bundle" followed by an OSC Time Tag, followed by zero or more OSC Bundle Elements.

Info:

  • Copyright: David Granström 2021
  • License: MIT
  • Author: David Granström

High level API

Bundle.new ([...]) Create a new OSC bundle.
Bundle:add (item) Adds an item to the bundle.
Bundle:timetag ([tt]) Get or set the bundle Timetag.
Bundle.validate (bundle) Validate a bundle.

Low level API

Bundle.tbl_validate (tbl) Validate a table that can be used as an OSC bundle.
Bundle.bytes_validate (data[, offset]) Validate a byte string that can be unpacked to an OSC bundle.
Bundle.pack (tbl) Pack an OSC bundle.
Bundle.unpack (data, offset) Unpack an OSC bundle byte string.


High level API

Bundle.new ([...])

Create a new OSC bundle.

Arguments can be one form of:

  1. nil (return empty bundle object).
  2. Timetag.
  3. Timetag, message/bundle objects.

Parameters:

  • ... arguments. (optional)

Returns:

    Bundle object.
Bundle:add (item)
Adds an item to the bundle.

Parameters:

  • item Can be a Message or another bundle.
Bundle:timetag ([tt])
Get or set the bundle Timetag.

Parameters:

  • tt A Timetag object. If no parameter is given it returns the current Timetag. (optional)
Bundle.validate (bundle)
Validate a bundle.

Parameters:

  • bundle table or string The bundle to validate. Can be in packed or unpacked form.

Low level API

Bundle.tbl_validate (tbl)
Validate a table that can be used as an OSC bundle.

Parameters:

  • tbl The table to validate.
Bundle.bytes_validate (data[, offset])
Validate a byte string that can be unpacked to an OSC bundle.

Parameters:

  • data The byte string to validate.
  • offset Byte offset. (optional)
Bundle.pack (tbl)
Pack an OSC bundle.

The returned object is suitable for sending via a transport layer such as UDP or TCP.

Parameters:

  • tbl The content to pack.

Returns:

    OSC data packet (byte string).
Bundle.unpack (data, offset)
Unpack an OSC bundle byte string.

Parameters:

  • data The data to unpack.
  • offset The initial offset into data.

Returns:

    table with the content of the OSC bundle.
generated by LDoc 1.4.6 Last updated 2021-02-01 17:13:04