MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
Functions
debug.h File Reference

Testing and debug functions, for advanced users only. More...

#include <stdint.h>
#include "data.h"
#include "metawearboard_fwd.h"
#include "datasignal_fwd.h"
#include "metawear/platform/dllmarker.h"

Go to the source code of this file.

Functions

METAWEAR_API void mbl_mw_debug_reset (const MblMwMetaWearBoard *board)
 Issues a soft reset. More...
 
METAWEAR_API void mbl_mw_debug_jump_to_bootloader (const MblMwMetaWearBoard *board)
 Restarts the board in bootloader mode. More...
 
METAWEAR_API void mbl_mw_debug_disconnect (const MblMwMetaWearBoard *board)
 Instructs the board to terminate the connection. More...
 
METAWEAR_API void mbl_mw_debug_reset_after_gc (const MblMwMetaWearBoard *board)
 Restarts the board after performing garbage collection. More...
 
METAWEAR_API void mbl_mw_debug_enable_power_save (const MblMwMetaWearBoard *board)
 Places the board in a powered down state after the next reset. More...
 
METAWEAR_API void mbl_mw_debug_set_stack_overflow_assertion (const MblMwMetaWearBoard *board, uint8_t enable)
 Enables/disables stack overflow assertion. More...
 
METAWEAR_API void mbl_mw_debug_read_stack_overflow_state (const MblMwMetaWearBoard *board, void *context, MblMwFnData handler)
 Reads the current stack state. More...
 
METAWEAR_API void mbl_mw_debug_read_schedule_queue_usage (const MblMwMetaWearBoard *board, void *context, MblMwFnData handler)
 Reads the internal queues' current usage statistics; data is returned as a byte array. More...
 
METAWEAR_API void mbl_mw_debug_spoof_notification (const MblMwMetaWearBoard *board, const uint8_t *value, uint8_t length)
 Creates a synthetic notification internally to the MetaWear system. More...
 
METAWEAR_API void mbl_mw_debug_send_command (const MblMwMetaWearBoard *board, const uint8_t *value, uint8_t length)
 Sends a raw command directly to the MetaWear. More...
 
METAWEAR_API MblMwDataSignalmbl_mw_debug_get_key_register_data_signal (const MblMwMetaWearBoard *board)
 Retrieves a data signal representing the key register value. More...
 
METAWEAR_API void mbl_mw_debug_set_key_register (const MblMwMetaWearBoard *board, uint32_t value)
 Sets the key register value. More...
 

Detailed Description

Testing and debug functions, for advanced users only.

Function Documentation

◆ mbl_mw_debug_disconnect()

METAWEAR_API void mbl_mw_debug_disconnect ( const MblMwMetaWearBoard board)

Instructs the board to terminate the connection.

Parameters
boardCalling object

◆ mbl_mw_debug_enable_power_save()

METAWEAR_API void mbl_mw_debug_enable_power_save ( const MblMwMetaWearBoard board)

Places the board in a powered down state after the next reset.

When in power save mode, press the switch or plug in the USB charger to wake the board up.

Parameters
boardCalling object

◆ mbl_mw_debug_get_key_register_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_debug_get_key_register_data_signal ( const MblMwMetaWearBoard board)

Retrieves a data signal representing the key register value.

This is a simple 4 byte scratch register.

Parameters
boardBoard to receive data from

◆ mbl_mw_debug_jump_to_bootloader()

METAWEAR_API void mbl_mw_debug_jump_to_bootloader ( const MblMwMetaWearBoard board)

Restarts the board in bootloader mode.

Parameters
boardCalling object

◆ mbl_mw_debug_read_schedule_queue_usage()

METAWEAR_API void mbl_mw_debug_read_schedule_queue_usage ( const MblMwMetaWearBoard board,
void *  context,
MblMwFnData  handler 
)

Reads the internal queues' current usage statistics; data is returned as a byte array.

If feature is unspported, nullptr will be passed to the handler parameter

Parameters
boardCalling object
contextPointer to additional data for the callback function
handlerCallback function for handling the received data

◆ mbl_mw_debug_read_stack_overflow_state()

METAWEAR_API void mbl_mw_debug_read_stack_overflow_state ( const MblMwMetaWearBoard board,
void *  context,
MblMwFnData  handler 
)

Reads the current stack state.

If feature is unspported, nullptr will be passed to the handler parameter

Parameters
boardCalling object
contextPointer to additional data for the callback function
handlerCallback function for handling the received data

◆ mbl_mw_debug_reset()

METAWEAR_API void mbl_mw_debug_reset ( const MblMwMetaWearBoard board)

Issues a soft reset.

Parameters
boardCalling object

◆ mbl_mw_debug_reset_after_gc()

METAWEAR_API void mbl_mw_debug_reset_after_gc ( const MblMwMetaWearBoard board)

Restarts the board after performing garbage collection.

Parameters
boardCalling object

◆ mbl_mw_debug_send_command()

METAWEAR_API void mbl_mw_debug_send_command ( const MblMwMetaWearBoard board,
const uint8_t *  value,
uint8_t  length 
)

Sends a raw command directly to the MetaWear.

Useful for testing.

Parameters
boardCalling object
valueValue to send: [Module ID, Register ID, Optional Index, Data...]
lenghtSize of the value array

◆ mbl_mw_debug_set_key_register()

METAWEAR_API void mbl_mw_debug_set_key_register ( const MblMwMetaWearBoard board,
uint32_t  value 
)

Sets the key register value.

This is a simple 4 byte scratch register.

Parameters
boardBoard to receive data from

◆ mbl_mw_debug_set_stack_overflow_assertion()

METAWEAR_API void mbl_mw_debug_set_stack_overflow_assertion ( const MblMwMetaWearBoard board,
uint8_t  enable 
)

Enables/disables stack overflow assertion.

Function will do nothing if feature is unsupported.

Parameters
boardCalling object
enable0 to disable, non-zero value to enable

◆ mbl_mw_debug_spoof_notification()

METAWEAR_API void mbl_mw_debug_spoof_notification ( const MblMwMetaWearBoard board,
const uint8_t *  value,
uint8_t  length 
)

Creates a synthetic notification internally to the MetaWear system.

Useful for testing.

Parameters
boardCalling object
valueValue to spoof: [Module ID, Register ID, Notifcation En, Optional Index, Data...]
lenghtSize of the value array