Commit 32ab9f55cc215036a1380b8fb837557cea45b421
1 parent
22c8e2b6
add GPS description and SD script
Showing
1 changed file
with
24 additions
and
0 deletions
Show diff stats
README.md
@@ -79,4 +79,28 @@ Lets detail the methods of the most important script files. | @@ -79,4 +79,28 @@ Lets detail the methods of the most important script files. | ||
79 | |`void GetCurrentGPSTime(char* isoTime)`|It gives the current time according to GPS| | 79 | |`void GetCurrentGPSTime(char* isoTime)`|It gives the current time according to GPS| |
80 | |`int GetShiftTime(char* tm1,char* tm2)`|It returns the shift between two time stamps in seconds| | 80 | |`int GetShiftTime(char* tm1,char* tm2)`|It returns the shift between two time stamps in seconds| |
81 | 81 | ||
82 | +### customized_SD.h/cpp | ||
83 | + | ||
84 | +|Method|Description| | ||
85 | +|:----:|:---------:| | ||
86 | +|`int getFileID(File& root)`|It returns the ID of a new CSV file| | ||
87 | +|`void appendFile(fs::FS &fs, const char * path, const char * message)`|It combines the string message with the data of a CSV file| | ||
88 | +|`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| | ||
89 | +|`char* getFileName(void)`|It returns the name of the used CSV file| | ||
90 | + | ||
91 | +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. | ||
92 | +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()`. | ||
93 | + | ||
94 | +### customized_GPS.h/cpp | ||
95 | + | ||
96 | +|Method|Description| | ||
97 | +|:----:|:---------:| | ||
98 | +|`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| | ||
99 | +|`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| | ||
100 | +|`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| | ||
101 | +|`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| | ||
102 | + | ||
103 | + | ||
104 | + | ||
105 | + | ||
82 | 106 |