How to rename ble devices using macros?

Hi Eric,
I am integrating MetawearCPro with the android app. Right now I am facing issues with updating names of the device using macros to make the change permanent. Earlier that was working, but by the end of the day it's not updating name anymore and giving task.result()=0;

Here below is code snippet:
btn_UpdateName.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if(!et_device_name.getText().toString().isEmpty()){

                Macro macro = VigilAssessmentApplication.metawear.getModule(Macro.class);
                macro.startRecord(true);
                final Settings settings=VigilAssessmentApplication.metawear.getModule(Settings.class);

               settings.editBleAdConfig().deviceName(et_device_name.getText().toString()).commit();

                macro.endRecordAsync().continueWith((Continuation<Byte, Void>) task -> {
                    Log.e("Task Result",task.getResult()+""); 
                    //macro.execute(task.getResult());

                    return null;

                });
            }

            alertDialog.dismiss();
            finish();
        }
    });

Thanks

Comments

  • Did you ever remove previous macros?

  • edited September 2018

    Not now, but earlier I was clearing macros everytime it starts recording

    macro.eraseAll();
    macro.startRecord(true);

    it is updating name for the device but not reflecting change immediately and every time. Hope, we don't need to reboot the device every time.

This discussion has been closed.