From 3c2ae7c30f055078cca17ca5988f0118f0bc0471 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Fri, 10 Feb 2023 10:36:15 +0900 Subject: [PATCH] GNSS: Add new function to remove the backup file --- .../spresense/1.0.0/libraries/GNSS/GNSS.cpp | 13 +++++++++++++ .../hardware/spresense/1.0.0/libraries/GNSS/GNSS.h | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/GNSS/GNSS.cpp b/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/GNSS/GNSS.cpp index ed08d19f0..19bec76e0 100644 --- a/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/GNSS/GNSS.cpp +++ b/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/GNSS/GNSS.cpp @@ -858,6 +858,19 @@ int SpGnss::saveEphemeris(void) return ret; } +/** + * @brief Remove the backup data stored in the Flash + * @return 0 if success, -1 if failure + */ +int SpGnss::removeEphemeris(void) +{ +#ifdef CONFIG_CXD56_GNSS_BACKUP_FILENAME + return unlink(CONFIG_CXD56_GNSS_BACKUP_FILENAME); +#else + return -1; +#endif +} + /** * @brief Get the QZQSM DC report data * @return the pointer to DC Report structure if valid, otherwise NULL diff --git a/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/GNSS/GNSS.h b/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/GNSS/GNSS.h index ff03f3389..b74104d07 100644 --- a/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/GNSS/GNSS.h +++ b/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/libraries/GNSS/GNSS.h @@ -437,6 +437,12 @@ class SpGnss */ int saveEphemeris(void); + /** + * @brief Remove the backup data stored in the Flash + * @return 0 if success, -1 if failure + */ + int removeEphemeris(void); + /** * @brief Get the QZQSM DC report data * @return the pointer to DC Report structure if valid, otherwise NULL