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.
file_hash
¶Return the file hash as an integer.
file_name
¶Return the file name as a string.
file_size
¶Return the file size in bytes.
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
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.
open
()¶Open the sink. :param directory: The directory to store the files in.
output_directory
¶Return the output directory as a string.
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.
symbol_bytes
¶The size of a symbol in bytes.
width
¶Return The width of the encoding.