onTemporalEvent not called when BLE set to "Not Connected" in the simulator?

Hi, while trying to debug something, I disabled the BLE connection in the simulator. To my surprise, launching a Temporal Event did not trigger a call to onTemporalEvent. Re-enabling BLE did call onTemporalEvent. Is this expected behavior? Running ICQ 4.2.1 simulating a Venu,

  • You are doing a makeWebRequest, correct?  If BLE is off, the callback will see a responseCode of -104 and the data will be null.

    If you do a Background.exit(data) in that case, onBackgroundData() won't be called in your main app.  It never is if you did a Background.exit(null) which is what you are in effect doing.

    What I do, is if the responseCode is 200, I return thew data.  If not, I return the responseCode, and then in onBackgroundData(), I see if it's data is "instanceof Number" and if it is, I know there was an error in the makeWebRequest, be it -104 or another error and can display a message.

  • Yes, I should be calling makeWebRequest, but the onTemporalEvent routine where the makeWebRequest is located in is not called when BLE is disconnected (well, a breakpoint at the start of onTemporalEvent is never hit). That's the problem I'm encountering.

    In the makeWebRequest method, I do check for its return value but it's irrelevant here since onTemporalEvent isn't called in the first place :-(

  • Are you sure you have a temporal event registered if phoneConnected is false?  My temporal events run fine if BLE is disconnected, and I see the -104 error code in my main app. 

    What happens if in the sim you use Simulation>Background Events to trigger a temporal event?

  • Yes, but something else was preventing the temporal event from registering. I didn't notice that the persistent data were cleared when I switched to another simulated device and one data from there (GPS location that is usually taken from the last activity, which has none in the simulator) was cleared so without it, it was unable to get weather and not being able to get weather meant no point asking for a temporal event.

    As always, thanks for your help.