new Xadow GPS module

Dependents:   xadow_smartstrap_for_pebble Avnet_ATT_Cellular_IOT Xadow-M0_Xadow-OLED_Accelerometer

Files at this revision

API Documentation at this revision

Comitter:
KillingJacky
Date:
Thu Nov 05 04:03:05 2015 +0000
Parent:
1:97f0865ea131
Commit message:
added satellite in view function

Changed in this revision

XadowGPS.cpp Show annotated file Show diff for this revision Revisions of this file
XadowGPS.h Show annotated file Show diff for this revision Revisions of this file
--- a/XadowGPS.cpp	Wed Nov 04 10:01:05 2015 +0000
+++ b/XadowGPS.cpp	Thu Nov 05 04:03:05 2015 +0000
@@ -281,3 +281,23 @@
 
     return data[2] - '0';
 }
+
+unsigned char gps_get_sate_in_veiw(void)
+{
+    unsigned char data[GPS_SATE_IN_VIEW_SIZE+2];
+    unsigned char i;
+
+    //dlc_i2c_configure(GPS_DEVICE_ADDR, 100);
+
+    //dlc_i2c_send_byte(GPS_SATE_IN_VIEW_ID);
+    cmd[0] = GPS_SATE_IN_VIEW_ID;
+    i2c.write(GPS_DEVICE_ADDR, cmd, 1);
+    
+    for(i=0;i<(GPS_SATE_IN_VIEW_SIZE+2);i++)
+    {
+        //data[i] = dlc_i2c_receive_byte();
+        i2c.read(GPS_DEVICE_ADDR, (char *)&data[i], 1); 
+    }
+
+    return data[2];
+}
--- a/XadowGPS.h	Wed Nov 04 10:01:05 2015 +0000
+++ b/XadowGPS.h	Thu Nov 05 04:03:05 2015 +0000
@@ -136,6 +136,9 @@
 #define GPS_MODE2_ID            13 // 1,2,3
 #define GPS_MODE2_SIZE          1 // 1 byte
 
+#define GPS_SATE_IN_VIEW_ID     14 // 0~12
+#define GPS_SATE_IN_VIEW_SIZE   1 // 1 byte
+
 
 /**
  *  \brief Get the status of the device.
@@ -250,5 +253,13 @@
  */
 unsigned char gps_get_mode2(void);
 
+/**
+ *  \brief Get the number of sate in view.
+ *
+ *  \return Return the number of sate in view.
+ *
+ */
+unsigned char gps_get_sate_in_veiw(void);
+
 
 #endif