Using macros to change device name
I'm trying to explore the following use case. I configure the MetaWear C board and store a macro in the register. The macro is used to change the device name and play a specific LED pattern when the switch is pressed. My current implementation can be found here: https://gist.github.com/HongyiZhu/b8cdb07a88cf8dbd89ac866f277dfd4d
I'm currently using API v2.6.0. I faced few problems during development.
1. I've disabled the macro's run on boot feature. When I call macro.record(), it seemed like the recorded commands would be executed once even if I didn't call macro.execute(). Is this the right workflow of the Macro.record API?
2. I tried to update the device name field. I pressed the button and the LED worked correctly. I waited for 2 minutes for the new device name to show up but it didn't. However, after I connected and disconnected from the sensor, the name field was changed. Can changing the device name be triggered and completed without the second connection attempt?
3. I configured the sensor name back to the default "MetaWear" with the Android Sample app. However, I was not able to press the switch to change the name and play the LED pattern again. I have to restart my application and reconfigure the sensor in order to get the macro work again. I didn't remove the macro nor the data route of the Switch module. What happened on the board that prevented the data monitoring?
This discussion has been closed.