I spent hours debugging, but can't find out the reason for this Error:
Error: Illegal Access (Out of Bounds) Details: Failed invoking <symbol> Stack: - getServiceDelegate() at /source/NSFaceApp.mc:34 0x10000079
Can someone help figure this out?
The source files:
// NSFaceApp.mc
using Toybox.Application as App;
using Toybox.WatchUi;
using Toybox.System as Sys;
using Toybox.Background;
using Utils;
var controller;
(:background)
class NSFaceApp extends App.AppBase {
function initialize() {
AppBase.initialize();
}
// onStart() is called on application start up
function onStart(state) {
}
// onStop() is called when your application is exiting
function onStop(state) {
controller.unregisterBackgroundEvent();
}
// Return the initial view of your application here
function getInitialView() {
controller.registerBackgroundEvent();
return [ new NSFaceView() ];
}
// This function is called when the temporal event occurrs
function getServiceDelegate(){
var c = new Utils.Controller();
c.initState();
Utils.validateAndUpdateURL();
controller.setBackground(true);
return [new NSFaceBackground()];
}
// This function passes data back to the main process when
// BG process has exited
function onBackgroundData(data) {
controller.onBackgroundData(data);
}
// New app settings have been received so trigger a UI update
function onSettingsChanged() {
Utils.validateAndUpdateURL();
WatchUi.requestUpdate();
}
}
// Utils.mc
module Utils{
function validateAndUpdateURL() {
}
class Controller {
function initialize() {
}
function initState() {
}
function getState() {
}
function setState(data) {
}
function getUrl() {
}
function getUnit() {
}
function registerBackgroundEvent() {
}
function unregisterBackgroundEvent() {
}
function setBackground(_inBackground) {
}
function onBackgroundData(data) {
}
function makeNightscoutRequest() {
}
function processResponse(responseCode, data) {
}
}
}