Failed invoking <symbol>
System Error
in open (C:\Users\Rog\Documents\Eclipse\workspace\MCyc11\source\MO2Sensor.mc:202)
in open (C:\Users\Rog\Documents\Eclipse\workspace\MCyc11\source\MO2Sensor.mc:202)
in onMenuItem (C:\Users\Rog\Documents\Eclipse\workspace\MCyc11\source\MCycMenuDelegate.mc:94)
System Error
The setPair function is called from the MenuDelegate to put the system back into wildcard searching in Proximity Pairing Mode.
//This function was added to put the system back into pairing mode
function setPair()
{
closeSensor();
pairing = true;
deviceCfg = new Ant.DeviceConfig( {
:deviceNumber => 0, //Wildcard our search for pairing
:deviceType => DEVICE_TYPE,
:transmissionType => 0,
:messagePeriod => PERIOD,
:radioFrequency => 57, //Ant+ Frequency
:searchTimeoutLowPriority => 10, //Timeout in 25s
:searchTimeoutHighPriority => 2, //Timeout in 5s
:searchThreshold => 1} ); //Turn on Proximity Pairing
GenericChannel.setDeviceConfig(deviceCfg);
data = new MO2Data();
searching = true;
}
After the setPair, it tries to reopen the channel and that is when the error occurs. This is the code in the Menu Delegate.
else if (item == :item_4_5)
{
mSensor.setPair();
mSensor.open();
Ui.pushView(new MCycViewPair(mSensor), new MCycPairDelegate(mSensor), Ui.SLIDE_UP );
}
The error is occurring in the line 202 which is just the GenericChannel.open() function that was in the MO2Sensor sample code.
function open()
{
// Open the channel
GenericChannel.open();
data = new MO2Data();
pastEventCount = 0;
searching = true;
}
This code worked in SDK 0.1.1 but it produced this error only occasionally (maybe 1 in 25 times) so I thought it was just a simulator issue. Now in SDK 0.2.4 it produces the error every time.