Csr location class shows location and satellite information, which supports H13467 + ST F103RB/NXP LCP1549 boards now.

Dependents:   CsrLocationDemo CsrLocationDemo

Fork of CsrLocation by jie zhao

Files at this revision

API Documentation at this revision

Comitter:
zhjcpi
Date:
Tue Aug 05 06:22:16 2014 +0000
Parent:
6:aed3c66b39d9
Child:
8:fa29f8455134
Commit message:
Add button support to triger position report in PTF mode.

Changed in this revision

CsrLocation.cpp Show annotated file Show diff for this revision Revisions of this file
CsrLocation.h Show annotated file Show diff for this revision Revisions of this file
--- a/CsrLocation.cpp	Mon Aug 04 10:15:22 2014 +0000
+++ b/CsrLocation.cpp	Tue Aug 05 06:22:16 2014 +0000
@@ -58,11 +58,6 @@
 	_CsrLocHwReset();
 }
 
-eCsrLocState CsrLocation::CsrLocGetState(void)
-{
-	return csrLocInst.locState;
-}
-
 void CsrLocation::CsrLocStart(ePowerMode pwrMode, eProto proto)
 {
     csrLocInst.pwrMode = pwrMode;
@@ -91,10 +86,6 @@
 
         /* trigger on_off */
         _CsrLocHwOnoff();
-		if(csrLocInst.pwrMode == PWR_PTF)
-		{
-			_CsrLocSendData(SEND_DATA_TYPE_OSP_LPM_REQ);
-		}
 
         csrLocInst.locState = CSR_LOC_STATE_RUN;
     	csrLocInst.bPwrModeRsp = false;
@@ -133,12 +124,6 @@
     }
     else
     {
-   		if(csrLocInst.pwrMode == PWR_PTF)
-		{
-    		CSR_LOG_INFO("Stop with fpm.\r\n");
-			_CsrLocSendData(SEND_DATA_TYPE_OSP_FPM_REQ);
-		}
-
         _CsrLocSendData(SEND_DATA_TYPE_OSP_STOP_REQ);
     }
     wait_ms(10);
@@ -553,20 +538,6 @@
             {
                 if(pLocInst->protoState == PROTO_STATE_DET_OSP || pLocInst->protoState == PROTO_STATE_DET_OSP_FROM_NMEA)
                 {
-                    if(pLocInst->protoState == PROTO_STATE_DET_OSP_FROM_NMEA)
-                    {
-                        if(!csrLocInst.bPwrModeRsp)
-				        {
-				            if(csrLocInst.pwrMode == PWR_PTF)
-				            {
-				                _CsrLocSendData(SEND_DATA_TYPE_OSP_LPM_REQ);
-				            }
-				            else
-				            {
-				                _CsrLocSendData(SEND_DATA_TYPE_OSP_FPM_REQ);
-				            }
-				        }
-                	}
                     CSR_LOG_INFO("Checking OSP protocol OK.\r\n");
                     pLocInst->protoState = PROTO_STATE_DET_OK;
                     pLocInst->appEventCb(CSR_LOC_EVENT_START_RESULT, 0);
@@ -951,10 +922,12 @@
         {
             if(csrLocInst.pwrMode == PWR_PTF)
             {
+		        CSR_LOG_INFO("Send PTF command.\r\n");
                 _CsrLocSendData(SEND_DATA_TYPE_OSP_LPM_REQ);
             }
             else
             {
+		        CSR_LOG_INFO("Send FPM command.\r\n");
                 _CsrLocSendData(SEND_DATA_TYPE_OSP_FPM_REQ);
             }
         }
--- a/CsrLocation.h	Mon Aug 04 10:15:22 2014 +0000
+++ b/CsrLocation.h	Tue Aug 05 06:22:16 2014 +0000
@@ -21,6 +21,8 @@
 #define PINMAP_UART_LOC_RX          D9
 #define PINMAP_GPIO_LOC_ONOFF       D11
 #define PINMAP_GPIO_LOC_RESET       D12
+#define PINMAP_GPIO_BTN             D6
+#define PINMAP_GPIO_TEST            D10
 #define LOC_LED1                    LED1
 #define LOC_LED2                    LED2
 #define DBG_SERIAL_TYPE             RawSerial
@@ -33,6 +35,8 @@
 #define PINMAP_GPIO_LOC_ONOFF       D9
 #define PINMAP_GPIO_LOC_WAKEUP      D3
 #define PINMAP_GPIO_LOC_RESET       D4
+#define PINMAP_GPIO_BTN             D6
+#define PINMAP_GPIO_TEST            D10
 #define LOC_LED1                    D7
 #define LOC_LED2                    D5
 #define DBG_SERIAL_TYPE             Serial
@@ -386,9 +390,6 @@
 
     /** hw reset to get location chip into hibernation mode */
     void CsrLocReset(void);
-    
-    /** get location state */
-    eCsrLocState CsrLocGetState(void);
 
     /** Start location request, activate location chip */
     void CsrLocStart(ePowerMode pwrMode, eProto proto);