From 32ab9f55cc215036a1380b8fb837557cea45b421 Mon Sep 17 00:00:00 2001 From: yessine kammoun Date: Fri, 29 Jan 2021 15:18:14 +0100 Subject: [PATCH] add GPS description and SD script --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index b03c8a2..16b2b1c 100644 --- a/README.md +++ b/README.md @@ -79,4 +79,28 @@ Lets detail the methods of the most important script files. |`void GetCurrentGPSTime(char* isoTime)`|It gives the current time according to GPS| |`int GetShiftTime(char* tm1,char* tm2)`|It returns the shift between two time stamps in seconds| +### customized_SD.h/cpp + +|Method|Description| +|:----:|:---------:| +|`int getFileID(File& root)`|It returns the ID of a new CSV file| +|`void appendFile(fs::FS &fs, const char * path, const char * message)`|It combines the string message with the data of a CSV file| +|`void init_SD_Card(ObdInfoPid* PIDs, int nbr_elem)`|It initializes the SD card device and create a new CSV file during a power cycle wake| +|`char* getFileName(void)`|It returns the name of the used CSV file| + +To save data in RTC register(ex: the CSV file name) during deep sleep, we need to attach `RTC_DATA_ATTR` in the declaration of the variable. +To know the cause of [wake of ESP32](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/system_time.html), you should check the flag returned by `esp_sleep_get_wakeup_cause()`. + +### customized_GPS.h/cpp + +|Method|Description| +|:----:|:---------:| +|`void init_GPS_dev(void)`|It initializes the GPS device and ensures the receiving a strong GPS signal in order to update the date and time| +|`int isDataGPSReady(int wait_MS)`|It waits for a strong GPS signal with a time out. It returns 1 if a GPS signal is detected otherwise 0| +|`int FilterGpsData(char* isoTime, double* res)`|It avoids incoherent points especially when the GPS speed is more than 350 km/h this value could be changed. It calulates also the slope. It returns 1 if a slope can be calculated (It requires two successive points), 0 if it is not possible and -1 if the point is incoherent| +|`int AddGPSData(char* isoTime,char* p, int* nbr)`|It writes the GPS data collected previously in string pointed by `p`. It returns 1 if a data was written otherwise 0| + + + + -- libgit2 0.21.4