Hepta_Cam&GPS
Dependents: HEPTA2_assembly_0720 HEPTA2_ALL HEPTA2_ALL_ver0803_02
Fork of HeptaSerial by
Diff: HeptaSerial.h
- Revision:
- 4:57c7f33a3621
- Parent:
- 3:12659e671bad
- Child:
- 6:c11f48bbb567
diff -r 12659e671bad -r 57c7f33a3621 HeptaSerial.h --- a/HeptaSerial.h Fri Jul 21 10:35:56 2017 +0000 +++ b/HeptaSerial.h Mon Jul 24 05:51:24 2017 +0000 @@ -4,14 +4,15 @@ #ifndef HEPTA_SERIAL_H #define HEPTA_SERIAL_H -class HeptaSerial { +class HeptaSerial +{ public: enum JpegResolution { - JpegResolution80x64 = 0x01, // unofficial - JpegResolution160x128 = 0x03, // unofficial - JpegResolution320x240 = 0x05, // QVGA - JpegResolution640x480 = 0x07 // VGA + JpegResolution80x64 = 0x01, // unofficial + JpegResolution160x128 = 0x03, // unofficial + JpegResolution320x240 = 0x05, // QVGA + JpegResolution640x480 = 0x07 // VGA }; enum ErrorNumber { @@ -30,7 +31,7 @@ Baud115200 = 0x04, Baud57600 = 0x05, Baud28800 = 0x06, - Baud14400 = 0x07 // Default. + Baud14400 = 0x07 // Default. }; enum ResetType { @@ -38,7 +39,7 @@ High = 0xff }; - HeptaSerial(PinName tx, PinName rx, int baud = 14400); + HeptaSerial(PinName tx, PinName rx); ~HeptaSerial(); @@ -52,22 +53,34 @@ void test_jpeg_snapshot_picture(int CAPTURE_FRAMES); void test_jpeg_snapshot_data(int CAPTURE_FRAMES); void jpeg_callback(char *buf, size_t siz); - - - - + char getc(); + int readable(); + void flushSerialBuffer(void); + void gga_sensing(float *time, float *latitude, char *ns, float *longitude, char *ew, int *quality, int *stnum, float *hacu, float *altitude, char *aunit, int *gps_check); + void lat_log_sensing_u16(char *lat, char *log, int *dsize); + private: SerialBuffered serial; static const int COMMAND_LENGTH = 6; static const int SYNCMAX = 60; static const int packageSize = 256; //static const int CAPTURE_FRAMES = 3; - + + char msg[256],msgd[256]; + int i,ite,rlock,stn; + char c; + char gps_data[7][1000]; + char ns,ew,statas; + float time,hokui,tokei,vel; + float g_hokui,g_tokei; + float d_hokui,m_hokui,d_tokei,m_tokei; + int h_time,m_time,s_time; + ErrorNumber sendInitial(Baud band, JpegResolution jr); ErrorNumber sendGetPicture(void); - ErrorNumber sendSnapshot(void); + ErrorNumber sendSnapshot(void); ErrorNumber sendSetPackageSize(uint16_t packageSize); - ErrorNumber sendReset(ResetType specialReset); + ErrorNumber sendReset(ResetType specialReset); ErrorNumber recvData(uint32_t *length); ErrorNumber sendSync(); ErrorNumber recvSync(); @@ -79,5 +92,4 @@ bool waitRecv(); bool waitIdle(); }; - #endif