Csr location demo application shows location and satellite information, which supports H13467 + ST F103RB/NXP LCP1549 boards now.
Dependencies: CsrLocation mbed GPSProvider
Fork of CsrLocationDemo by
Diff: CsrLocationDemo.cpp
- Revision:
- 4:b917d49df4bd
- Parent:
- 3:7a3ed8ae071d
- Child:
- 5:a4f421140212
--- a/CsrLocationDemo.cpp Wed May 21 08:56:40 2014 +0000 +++ b/CsrLocationDemo.cpp Tue May 27 08:09:34 2014 +0000 @@ -148,9 +148,16 @@ pCsrLoc->CsrLocLpmGetPos(); break; case APP_CMD_NMEA: - CSR_APP_LOG_INFO("select NMEA protocol.\r\n"); - sProto = PROTO_NMEA; - sAppCmd = APP_CMD_IDLE; + if(sPwrMode != PWR_FULL) + { + CSR_APP_LOG_INFO("Canot select NMEA protocol because current lpm is not supported for NMEA protocol.\r\n"); + } + else + { + CSR_APP_LOG_INFO("select NMEA protocol.\r\n"); + sProto = PROTO_NMEA; + sAppCmd = APP_CMD_IDLE; + } break; case APP_CMD_OSP: CSR_APP_LOG_INFO("select OSP protocol.\r\n"); @@ -168,9 +175,16 @@ sPwrMode = PWR_FULL; break; case APP_CMD_PM_PTF: - CSR_APP_LOG_INFO("lpm ptf set.\r\n"); - sAppCmd = APP_CMD_IDLE; - sPwrMode = PWR_PTF; + if(sProto == PROTO_NMEA) + { + CSR_APP_LOG_INFO("Canot set lpm because LPM is not supported for current NMEA protocol.\r\n"); + } + else + { + CSR_APP_LOG_INFO("lpm ptf set.\r\n"); + sAppCmd = APP_CMD_IDLE; + sPwrMode = PWR_PTF; + } break; } }