diff --git a/software/management/dashboard/tottag.py b/software/management/dashboard/tottag.py index 5d75795c..9a6582ad 100755 --- a/software/management/dashboard/tottag.py +++ b/software/management/dashboard/tottag.py @@ -22,6 +22,7 @@ DEVICE_ID_UUID = '00002a23-0000-1000-8000-00805f9b34fb' LOCATION_SERVICE_UUID = 'd68c3156-a23f-ee90-0c45-5231395e5d2e' FIND_MY_TOTTAG_SERVICE_UUID = 'd68c3155-a23f-ee90-0c45-5231395e5d2e' +MODE_SWITCH_UUID = 'd68c3164-a23f-ee90-0c45-5231395e5d2e' TIMESTAMP_SERVICE_UUID = 'd68c3154-a23f-ee90-0c45-5231395e5d2e' VOLTAGE_SERVICE_UUID = 'd68c3153-a23f-ee90-0c45-5231395e5d2e' EXPERIMENT_SERVICE_UUID = 'd68c3161-a23f-ee90-0c45-5231395e5d2e' @@ -192,7 +193,9 @@ def __init__(self, command_queue, result_queue, event_loop): 'GET_EXPERIMENT': self.retrieve_experiment, 'DELETE_EXPERIMENT': self.delete_experiment, 'DOWNLOAD': self.download_logs, - 'DOWNLOAD_DONE': self.download_logs_done } + 'DOWNLOAD_DONE': self.download_logs_done, + 'ENABLE_STORAGE_MAINTENANCE': self.enable_storage_maintenance, + } self.storage_directory = get_download_directory() self.subscribed_to_notifications = False self.downloading_log_file = False @@ -301,6 +304,15 @@ async def find_my_tottag(self): except Exception: self.result_queue.put_nowait(('ERROR', ('TotTag Error', 'Unable to activate FindMyTotTag'))) + async def enable_storage_maintenance(self): + self.result_queue.put_nowait(('SWITCHING', True)) + try: + await self.connected_device.write_gatt_char(MODE_SWITCH_UUID, struct.pack('