+ if (getMode() == MODE_TRACK_SINGLE)
+ setMode(MODE_INACTIVE); // we're done with a single shot
+ resetInternalRequest();
+
+ // whether we next release the token or pass it to the CAP
+ // component, we want it back (because we decide later
+ // whether we'll actually stop tracking the beacon in future)
+ call RadioToken.request();
+
+ if (!wasBeaconReceived()) {
+
+ resetBeaconReceived(); // buffer ready
+ m_numBeaconsMissed += 1;
+ m_dt += getBeaconInterval(m_beaconOrder);
+ dbg_serial("BeaconSynchronizeP", "Missed a beacon (total missed: %lu).\n", (uint32_t) m_numBeaconsMissed);
+
+ if (wasInternalRequest) {
+ // note: if it only was an internal request, the
+ // mode was reset above already (SINGLE_SHOT)
+ signal TrackSingleBeacon.startDone(FAIL);
+ }
+ if (isExternalRequest() && m_numBeaconsMissed >= IEEE154_aMaxLostBeacons) {
+ resetExternalRequest();
+ setMode(MODE_INACTIVE);