Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сhange the device name permanently with macro not working #34

Open
tagplus5 opened this issue Aug 29, 2023 · 0 comments
Open

Сhange the device name permanently with macro not working #34

tagplus5 opened this issue Aug 29, 2023 · 0 comments

Comments

@tagplus5
Copy link

I need to change name of device. I change it using a method in the api, but after the battery runs out, the device name returns to default.
I tried using macro. The macro is recorded successfully, if I call it after recording, the device name changes, but after the battery is discharged, the macro does not start automatically and the script crashes when manually started.
Has anyone experienced this behavior?

Macro example from c++ api:

In this example, we will change the device name permanently:

#include "metawear/core/macro.h"
#include "metawear/peripheral/led.h"

void setup_macro(MblMwMetaWearBoard* board) {
    static auto callback = [](MblMwMetaWearBoard* board, int32_t id) {
        cout << "Macro ID = " << id << endl;
        macro_id = id;
    };

    // Change on boot
    mbl_mw_macro_record(board, 1);
    auto new_name = "METAMOO";
    mbl_mw_settings_set_device_name(board, new_name, 7);
    mbl_mw_macro_end_record(board, callback);

    // Change the name now
    mbl_mw_macro_execute(macro_id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant