I made a data field in which I want to send some BLE notifications to a peripheral device when the user discards the activity.
I pressed the start/stop button in activity and pressed discard, but onTimerReset wasn't called. So curious why.
The same code works on fr745/fr955 but fenix7.
The outcome looks like the onTimerStop invoked incorrectly instead of onTimerReset on fenix7.
MODEL: FENIX7
FW:14.68
import Toybox.Activity;
import Toybox.Lang;
import Toybox.Time;
import Toybox.WatchUi;
import Toybox.Application.Storage;
using LogMonkey as Log;
class MyView extends WatchUi.DataField {
//! Set the label of the data field here
//! @param deviceManager The device manager
public function initialize(deviceManager as DeviceManager) {
DataField.initialize();
_deviceManager = deviceManager;
_tick = 0;
}
public function compute(
info as Info
) as Numeric or Duration or String or Null {
//other logic
// See Activity.Info in the documentation for available information.
WatchUi.requestUpdate();
}
// Update the field layout and display the field data
function onUpdate(dc) {
//update view
}
public function onTimerStart() as Void {
Log.Debug.logMessage("View", "sending start/resume");
//notify
}
public function onTimerResume() as Void {
Log.Debug.logMessage("View", "sending resume/start");
//notify
}
public function onTimerPause() as Void {
Log.Debug.logMessage("View", "sending pause");
//notify
}
public function onTimerStop() as Void {
Log.Debug.logMessage("View", "sending pause");
//notify
}
public function onTimerReset() as Void {
Log.Debug.logMessage("View", "onTimerReset sending save");
//notify
}
}