EvoDownloadManager#

class EvoDownloadManager(name='Evo', debug=False)#

BLE file download, console and sensor streaming service used by the Evo MicroPython firmware.

start_advertising(interval_us=None)#

Begin BLE advertising for the download service.

Returns:

None.

stop_advertising()#

Stop BLE advertising.

Returns:

None.

set_name(name)#

Update the advertised BLE name.

Returns:

None.

console_write(text, stream='stdout')#

Send console text through the notify characteristic when connected.

Returns:

True if the message was queued/sent, otherwise False.

Configuration Helpers#

config_get()#

Load the persistent download manager configuration.

Returns:

Configuration dictionary.

config_set(**kwargs)#

Update known configuration keys and write the config file.

Returns:

Updated configuration dictionary.

enable_persistent(on=True)#
set_name_persistent(name)#
set_ack_every_persistent(n=1)#
sensor_streaming_persistent(on=True)#
set_sensor_tick_persistent(ms=50)#

Convenience helpers for common persistent settings.

Returns:

Updated configuration dictionary.

Runtime Helpers#

start(name=None, adv_interval_us=None, debug=None, ack_every=None, sensor_streaming=None, sensor_tick_ms=None)#

Create or reuse the shared service instance and start advertising.

Returns:

The active EvoDownloadManager instance.

stop()#

Stop sensor streaming and advertising on the shared service instance.

Returns:

None.

auto_start()#

Start the service when persistent configuration has enabled set.

Returns:

The active service instance, or None when disabled.

console_write(text, stream='stdout')#

Write text to the BLE console through the shared service.

Returns:

True when a service is running and accepts the write, otherwise False.

console_print(*args, sep=' ', end='\\n', stream='stdout')#

Format values like print() and forward them to console_write.

Returns:

True when sent, otherwise False.

status()#

Read current service and configuration status.

Returns:

Dictionary.

cli(cmd=None)#

Small command parser for status, enable/disable, naming, ACK and sensor streaming settings.

Returns:

Status dictionary for known commands, or an error dictionary for unknown commands.