diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 19:40:26 +0100 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2014-01-19 19:40:26 +0100 |
commit | c852d827bbe5e3b8f7761932ace79067c91a6af0 (patch) | |
tree | 6eafdb7a98b23687f73b67554b753fa3aca1373e /src/AntFr310XT.cpp | |
parent | 803fc1d4bed693b255e2cf7a0ea706b5a09b2106 (diff) |
provide some end user messages
on failure paths in the state machine
Diffstat (limited to 'src/AntFr310XT.cpp')
-rw-r--r-- | src/AntFr310XT.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/AntFr310XT.cpp b/src/AntFr310XT.cpp index 3690743..9d6f56b 100644 --- a/src/AntFr310XT.cpp +++ b/src/AntFr310XT.cpp @@ -326,7 +326,14 @@ AntFr310XT::handleEvents() if(state==ST_ANTFS_RESTART) { if(++m_restartCount==10) + { + LOG(LOG_RAW) << "\n\nTried " << m_restartCount << " times, and couldn't communicate with ANT device!\n" + << "Please try again running the downloader.\n" + << "Sometimes re-plugging the USB ANT stick, and rarely power cycling (turn-off, turn-on)\n" + << "the ANT device (watch/GPS) might help.\n\n\n"; stop(); + return true; + } else { m_evQue.clear(); @@ -361,7 +368,12 @@ AntFr310XT::handleEvents() { AntMessage m; //CHECK_RETURN_FALSE(m_antMessenger->waitForBroadcastDataAvail(chan, &m, 20000));//link beacon - CHECK_RETURN_FALSE(m_antMessenger->waitForBroadcast(chan, &m, 20000));//link beacon + if(!m_antMessenger->waitForBroadcast(chan, &m, 20000)) //link beacon + { + LOG(LOG_RAW) << "\n\nNo device available for linking!\n\n\n"; + return false; + } + M_ANTFS_Beacon* beacon(reinterpret_cast<M_ANTFS_Beacon*>(&m.getPayloadRef()[1])); // TODO:handle case of no available data if(!beacon->dataAvail) |