Пример #1
0
def reset(device):
    libmetawear.mbl_mw_logging_stop(device.board)
    libmetawear.mbl_mw_logging_clear_entries(device.board)
    libmetawear.mbl_mw_macro_erase_all(device.board)
    libmetawear.mbl_mw_debug_reset_after_gc(device.board)
    print("Erase logger and clear all entries")
    sleep(1.0)

    libmetawear.mbl_mw_debug_disconnect(device.board)
    sleep(1.0)
Пример #2
0
def reset(device) -> None:
    """
    This function resets your device if its stuck in a bad state
    :param device:
    :return None:
    """
    # Stops data logging
    libmetawear.mbl_mw_logging_stop(device.board)
    # Clear the logger of saved entries
    libmetawear.mbl_mw_logging_clear_entries(device.board)
    # Remove all macros on the flash memory
    libmetawear.mbl_mw_macro_erase_all(device.board)
    # Restarts the board after performing garbage collection
    libmetawear.mbl_mw_debug_reset_after_gc(device.board)
    libmetawear.mbl_mw_debug_disconnect(device.board)
    device.disconnect()
Пример #3
0
# usage: python full_reset.py [mac]
from __future__ import print_function
import sys
from mbientlab.metawear import MetaWear, libmetawear
from mbientlab.metawear.cbindings import *
from time import sleep
from threading import Event

# device = MetaWear('C2:9B:59:07:56:C9')
device = MetaWear('FB:81:71:31:92:7A')
device.connect()
print("Connected")

libmetawear.mbl_mw_logging_stop(device.board)
libmetawear.mbl_mw_logging_clear_entries(device.board)
libmetawear.mbl_mw_macro_erase_all(device.board)
libmetawear.mbl_mw_debug_reset_after_gc(device.board)
print("Erase logger and clear all entries")
sleep(1.0)

libmetawear.mbl_mw_debug_disconnect(device.board)
sleep(1.0)

device.disconnect()
print("Disconnect")
sleep(1.0)