2017年伊豆大島共同打ち上げ実験用電装モジュール搭載GPS測位プログラム

Dependents:   Hybrid_interruptGPS Hybrid_main_FirstEdtion rocket_logger_sinkan2018_v1 HYBRYD2018_IZU_ROCKET ... more

Revision:
15:6b1ed321c1be
Parent:
13:3ee69851e270
Child:
16:ded6e8e2850f
--- a/GPS_interrupt.h	Sun Feb 25 19:29:26 2018 +0000
+++ b/GPS_interrupt.h	Fri May 25 21:29:17 2018 +0000
@@ -1,5 +1,5 @@
 /*=============================================================================
-*   GPS_interrupt.lib ver 1.3.5
+*   GPS_interrupt.lib ver 1.6
 *   
 *   Each palameters are not stable because they can be changed unexpectedly.
 *   Therefor, you should use the funtions which have return value.
@@ -10,8 +10,8 @@
 /**
  * @file GPS_interrupt.h
  * @brief GPSから送られてくるデータをバックグラウンドで解析し、呼び出せるライブラリ
- * @author 松本岳
- * @note ver1.3.6
+ * @author 松本岳 and 林拓真
+ * @note ver1.6
  */
  
 #ifndef GPS_INTERRUPT_H_
@@ -28,14 +28,38 @@
 class GPS_interrupt{
     
     public:
-        GPS_interrupt(Serial *_gps);
-        
         /** 
         *   @bref GPS_interrupt's constructer
         *   @param _gps GPSと通信したいSerialバスのポインタ
-        *   @param _frequency GPSから何Hzでデータを取得したいか
+        */
+        GPS_interrupt(Serial *_gps);
+        
+        /**
+        *   @bref GPSのボーレートを変更
+        *   @param _baudrate GPSのボーレート(4800, 9600, 14400, 19200, 38400, 57600, 115200)
+        */
+        void changeGPSBaud(int _baudrate);
+        
+        /**
+        *   @bref GPSのデータレート(1秒に何回データを送信するか)を変更
+        *   @param _frequency GPSのデータレート(1~10)
+        *   @retval false 失敗
+        *   @retval true 成功
         */
-        GPS_interrupt(Serial *_gps,  int _baudrate);
+        bool changeGPSFreq(int _frequency);
+        
+        /**
+        *   @bref GPSのデータ内容を変更
+        *   @param _GLL GLLの送信頻度(0 or 1)
+        *   @param _RMC RMCの送信頻度(1)
+        *   @param _VTG VTGの送信頻度(0 or 1)
+        *   @param _GGA GGAの送信頻度(1)
+        *   @param _GSA GSAの送信頻度(0 or 1)
+        *   @param _GSV GSVの送信頻度(0 or 1)
+        *   @retval false 失敗
+        *   @retval true 成功
+        */
+        bool changeGPSData(int _GLL, int _RMC, int _VTG, int _GGA, int _GSA, int _GSV);
         
         void debug(bool tf);
 
@@ -44,6 +68,7 @@
         void gps_auto_receive();
         bool processGPRMC(char *line);
         bool processGPGGA(char *line);
+        void processPMTK(char *line);
         
         unsigned char checkSum(char *str);
         void rmc_initialize();
@@ -57,6 +82,10 @@
         char gps_buffer_B[128];
         //static char gps_buffer_C[128];
         bool debugFlag;
+        int data_sum; //for ChangeGPSData
+        int flag_change_freq; // for ChangeGPSFreq
+        int flag_change_data; // for ChangeGPSData
+        int wait_change;
         
     public:
         double latitude;