MetaWear C++ API  0.20.0
C++ implementation of the MetaWear protocol
Functions
macro.h File Reference

Firmware feature that saves MetaWear commands to the on-board flash memory. More...

#include "metawearboard_fwd.h"
#include "metawear/platform/dllmarker.h"

Go to the source code of this file.

Functions

METAWEAR_API void mbl_mw_macro_record (MblMwMetaWearBoard *board, uint8_t exec_on_boot)
 Begin macro recording. More...
 
METAWEAR_API void mbl_mw_macro_end_record (MblMwMetaWearBoard *board, void *context, MblMwFnBoardPtrInt commands_recorded)
 Ends macro recording. More...
 
METAWEAR_API void mbl_mw_macro_execute (MblMwMetaWearBoard *board, uint8_t id)
 Execute the commands corresponding to the macro ID. More...
 
METAWEAR_API void mbl_mw_macro_erase_all (MblMwMetaWearBoard *board)
 Remove all macros on the flash memory. More...
 

Detailed Description

Firmware feature that saves MetaWear commands to the on-board flash memory.

Function Documentation

◆ mbl_mw_macro_end_record()

METAWEAR_API void mbl_mw_macro_end_record ( MblMwMetaWearBoard board,
void *  context,
MblMwFnBoardPtrInt  commands_recorded 
)

Ends macro recording.


An numerical id representing the macro will be passed to the callback function when the operation is complete.

Parameters
boardCalling object
contextPointer to additional data for the callback function
commands_recordedCallback function to be executed when the commands are recorded

◆ mbl_mw_macro_erase_all()

METAWEAR_API void mbl_mw_macro_erase_all ( MblMwMetaWearBoard board)

Remove all macros on the flash memory.


The erase operation will not be performed until you disconnect from the board.
If you wish to reset the board after the erase operation, use the mbl_mw_debug_reset_after_gc method.

Parameters
boardCalling object

◆ mbl_mw_macro_execute()

METAWEAR_API void mbl_mw_macro_execute ( MblMwMetaWearBoard board,
uint8_t  id 
)

Execute the commands corresponding to the macro ID.

Parameters
boardCalling object
idNumerical ID of the macro to execute

◆ mbl_mw_macro_record()

METAWEAR_API void mbl_mw_macro_record ( MblMwMetaWearBoard board,
uint8_t  exec_on_boot 
)

Begin macro recording.


Used to command the board on boot. Commands will survive a reset. For example, on boot, flash the LED red. For example, when the user drops the metawear (freefall event), vibrate the coin motor. For example, renaming the device permanently. Every MetaWear command issued will be recorded to the flash memory.

Parameters
boardCalling object
exec_on_bootTrue if the commands should be executed when the board powers on