Source

class otacast.Source

The OTAcast source

close()

Close the source.

configure()

Configure the source with the given parameters. This is useful for reusing an existing source. Note that the reconfiguration always implies a reset, so the source will be in a clean state after this operation.

param width
The width of the encoding, i.e., now many symbols are combined for each encoded symbol.
param symbol_bytes
The size of a symbol in bytes.
property file_hash

Return The file hash of the source.

property file_name

Return The file name of the source.

property file_path

Return The file path of the source.

property file_size

Return The file size of the source.

property hash

Return The hash of the source.

is_open()

Check if the source is open. This function will return true if the source is open.

Return True if the source is open, false otherwise.
static meta_packet_serialize()

Serialize meta data from the source into the given bytearray.

Parameters
  • source – The source to get the meta data from.
  • packet – The bytearray to serialize into. Must be at least Source.meta_packet_size bytes
static meta_packet_size()

Return the size of the meta packet.

Parameters
source – The source to get the size of.
open()

Open the source. This will open the source and prepare it for reading. This function must be called before reading from the source.

param file_path
The path to the file to open.
property packet_size

Return The size of a packet.

statistics()

Return the statistics of the source.

Return A dictionary with the statistics.

property symbol_bytes

Return The number of bytes in a symbol.

property symbols

Return The number of symbols.

property width

Return The width of the encoding.

write_packet()

Write a packet.

Parameters
packet – The bytearray to write into.
Versions
4.0.0
3.2.0
3.1.0
3.0.0
2.0.0
1.0.1
Development
latest