Skip to content

Commit

Permalink
Merge pull request #27 from mbientlab/build-id-hotfix
Browse files Browse the repository at this point in the history
Build id hotfix
  • Loading branch information
lkasso committed Dec 17, 2020
2 parents 7b959de + 5965be6 commit 26dfdb7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions bindings/javascript/cbindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,12 @@ var Lib = ffi.Library(LIBMETAWEAR_PATH, {
*/
'mbl_mw_settings_set_whitelist_filter_mode': [ref.types.void, [ref.refType(MetaWearBoard), WhitelistFilter]],

/**
* Retrieves the firmware build id, used for identifying custom firmware build variants
* @param board Calling object
*/
'mbl_mw_settings_get_firmware_build_id': [ref.types.uint8, [ref.refType(MetaWearBoard)]],

/**
* Sets the advertisement name
* @param board Board to modify
Expand Down
3 changes: 3 additions & 0 deletions bindings/python/mbientlab/metawear/cbindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,9 @@ def init_libmetawear(libmetawear):
libmetawear.mbl_mw_settings_set_whitelist_filter_mode.restype = None
libmetawear.mbl_mw_settings_set_whitelist_filter_mode.argtypes = [c_void_p, c_int]

libmetawear.mbl_mw_settings_get_firmware_build_id.restype = c_ubyte
libmetawear.mbl_mw_settings_get_firmware_build_id.argtypes = [c_void_p]

libmetawear.mbl_mw_settings_set_device_name.restype = None
libmetawear.mbl_mw_settings_set_device_name.argtypes = [c_void_p, POINTER(c_ubyte), c_ubyte]

Expand Down
4 changes: 2 additions & 2 deletions project_version.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.19.0
VERSION=0.19.1
VERSION_MAJOR=0
VERSION_MINOR=19
VERSION_STEP=0
VERSION_STEP=1
8 changes: 8 additions & 0 deletions src/metawear/core/cpp/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,11 @@ void create_settings_uri(const MblMwDataSignal* signal, stringstream& uri) {
break;
}
}

uint8_t mbl_mw_settings_get_firmware_build_id(const MblMwMetaWearBoard *board) {
auto info = &board->module_info.at(MBL_MW_MODULE_SETTINGS);
if (info->extra.size() > 1) {
return info->extra[1];
}
return 0;
}
5 changes: 5 additions & 0 deletions src/metawear/core/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ METAWEAR_API MblMwDataSignal* mbl_mw_settings_get_whitelist_data_signal(MblMwMet
* @param mode Whitelist filter mode
*/
METAWEAR_API void mbl_mw_settings_set_whitelist_filter_mode(const MblMwMetaWearBoard *board, MblMwWhitelistFilter mode);
/**
* Retrieves the firmware build id, used for identifying custom firmware build variants
* @param board Calling object
*/
METAWEAR_API uint8_t mbl_mw_settings_get_firmware_build_id(const MblMwMetaWearBoard *board);

/**
* Reads the current power status if available. The callback function will be called with:
Expand Down
2 changes: 1 addition & 1 deletion src/metawear/sensor/cpp/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ char* copy_string_index(const char* src, std::uint8_t i) {
}

char* copy_string(const char* src) {
char* buffer = (char*)std::malloc(strlen(src)+1);
char* buffer = (char*)std::malloc(strlen(src) + 1);
strcpy(buffer, src);
return buffer;
}
Expand Down

0 comments on commit 26dfdb7

Please sign in to comment.