Sink

class otacast.Sink

The OTAcast sink

close()

Close the sink.

configure()

Configure the sink with the given parameters. This is useful for reusing an existing sink. Note that the reconfiguration always implies a reset, so the sink 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.
param file_size
The size of the file in bytes.
param file_name
The name of the file.
param file_hash
The hash of the file.
param hash
The hash of the transfer.
property file_hash

Return the file hash as an integer.

property file_name

Return the file name as a string.

property file_size

Return the file size in bytes.

property hash

Return the hash of the source as an integer.

is_complete()

Return True if the sink is complete. Otherwise False

is_configured()

Return True if the sink is configured. Otherwise False

is_open()

Return True if the sink is open. Otherwise False

static meta_packet_deserialize()

Parse the given packet as a meta packet. If successful a dict containing the meta packet information will be returned, otherwise None. The meta packet info can be used for configuring the Decoder.

Parameters
packetr – A bytearray containing the meta packet
open()

Open the sink. :param directory: The directory to store the files in.

property output_directory

Return the output directory as a string.

property output_file_path

Return the output file path as a string.

progress()

Return the progress of the sink as a float between 0 and 1.

read_packet()

Read a packet from the sink. :param packet: A bytearray containing the packet. Must be at least Sink.symbol_bytes bytes large.

statistics()

Return the statistics of the sink as a dictionary.

property symbol_bytes

The size of a symbol in bytes.

property width

Return The width of the encoding.

Versions
4.0.0
3.2.0
3.1.0
3.0.0
2.0.0
1.0.1
Development
latest