Commit Graph

75 Commits

Author SHA1 Message Date
Lukasz Mastalerz
d9a1194e6f [BH-1688] Create a standard for logs
* Adding document describing how to use logger
* Adjusting logs to follow a new guide
* Change order in log header:
  line number is now before function name
2023-10-23 15:17:44 +02:00
Lefucjusz
137622902f [MOS-766] Change factory entries initialization routine
Changed of the algorithm used to initialize
settings database with values read from EEPROM,
previously first insertion failure resulted
in stopping the whole process, now next values
are inserted even if previous has failed.
Additionally minor cleanup.
2023-03-06 16:07:25 +01:00
Bartosz
1340e6949c Revert "[MOS-578] Fix incorrect logic with SMS notifications"
This reverts commit de99e12e00.
2023-02-15 16:32:19 +01:00
Bartosz Szostak
fb32765132 [MOS-578] Fix incorrect logic with SMS notifications
Fixed case, when there's only one thread unread and
there's no info about the thread, only a generic message

Tests are deleted because the fix would require rewritting ALL
of those tests - those will be written with new implementation
of notification table
2023-02-06 14:54:10 +01:00
Pawel Olejniczak
b50eea9ed9 [CP-1427] Cleanup leftovers after old backup restore implementation
The synchronization mechanism has been freed from the constraints
of the old backup and restore implementation.
2023-01-19 16:41:56 +01:00
Mateusz Piesta
0a9846e4a8 [MOS-694] Move DB initialization from OS to build scripts
* Switched to DB initialization at compile time
* Organized and cleaned up db files directories(not finished completely)
* Fixed DB related unit tests
* Minor improvements to CMake
* Small fixes for GCC12 build
2023-01-19 16:41:56 +01:00
Maciej-Mudita
e6bc56f362 [MOS-787] Fix crash when syncing with Mudita-Center
When Pure had large databases - exceeding 2MB, a crash occurred
during synchronization with Mudita-Center.
2023-01-13 09:12:23 +01:00
Adam Wulkiewicz
074b33a645 [MOS-685] Make small improvements in various places of the code
- Forward arguments
- Remove unused code
- Remove auto return type when it's not needed
- Add const to member functions
- Use startsWith and endsWith from utils
- Allow instantiation of operators only for specific types
- Caluclate key mask in compile time
2022-09-02 01:12:47 +02:00
Adam Wulkiewicz
fe708cdf31 [MOS-670] Change clang-format AlwaysBreakTemplateDeclarations to Yes
Add --all and --fix-all options to style-check-hook
2022-08-26 15:22:39 +02:00
Mateusz Piesta
7cbfd6a984 [BH-1356] Meditation stats backend
Added meditation statc backend.
Added temporary widget for testing
purposes and corresponding modules
(meditation stats presenter, window,model).
2022-07-25 09:05:05 +02:00
Bartosz Cichocki
839d6f301b [MOS-593] Fix backup issues with DB
Backup had some issues when filesystem was not clearly closed.
After that, sqlite was not commiting the transaction while
doing VACUUM INTO query, which caused fail on the next
query. Fixed by commiting the transaction when there's
any ongoing one during backup.
2022-07-14 10:52:10 +02:00
Adam Dobrowolski
2b1ae19d62 [MOS-512] Fix build with gcc12
As in topic
2022-06-03 12:38:34 +02:00
Lucjan Bryndza
523eb6f577 [MOS-513] Fix issues related to the GCC12 gcc
Fix issues related to the GCC 12
Fix paths for ignore license headers
2022-06-02 13:24:09 +02:00
Maciej Janicki
35ae5f21dd [MOS-351] Fix db load after update
Workaround for loading changed/new sql
after update.
Currently, updated moves sql files to wrong direction,
therefore to support both update and flashing
we have to check both directories.
2022-03-29 10:33:05 +02:00
Maciej Janicki
455d69e553 [MOS-153] Fix quotes database
Fix quotes database not being loaded
Plus: updated SQLite (3.38.01)
Minor spelling fixes
2022-03-16 12:35:44 +01:00
Piotr Tański
1d2f5cf7a4 [EGD-7754] Dates bumped in disclaimers
Dates bumped from 2020 to 2021.
2021-10-11 19:08:26 +02:00
Alek Rudnik
1490158034 [EGD-7725] Tune up file system io access
Increasd io stream buffers:
- 64kB for big files with short lifetime scope
- 16kB for big files with long lifetime scope
- 1kB - dont changes default forr the rest
2021-10-08 10:28:38 +02:00
Marcin Smoczyński
bd90e57516 [BH-907] Split utils module into components
Split module-utils into smaller components for better dependency
management. Fix many dependencies throughout the project.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-09-23 15:14:40 +02:00
Marek Niepieklo
dea6379923 [CP-281] Block restoration of mock messages
During every power on Database initialization, each DB is populated
with mock data. Used PRAGMA application_id to indicate that DB is
initialized at first run.
2021-07-13 10:30:45 +02:00
Marek Niepieklo
7495d1b6e1 [CP-327] Fix UB in QueryResult
QueryResult iterator nextRow() may get into infinite loop.
Additionally, fixed handling of the case when each row of result
could have a different count of fields.
2021-07-12 16:50:04 +02:00
Jakub Pyszczak
c494f5c1b4 [EGD-7006] Removed sensitive data from db
Sensitive data removed from logs in module db and service db.
2021-06-30 15:52:47 +02:00
Lukasz Skrzypczak
2911b6b4a1 [BH-378] PR changes
PR changes - mainly includes
2021-06-08 12:24:29 +02:00
Lukasz Skrzypczak
7fee0d9cfb [BH-378] Utils move log to library
Moved log to separate library
2021-06-08 12:24:29 +02:00
Paweł Joński
5ad878c6c4 [BH-371] Replace gsl with mainline submodule and move to third-party
Replacing loose gsl files with gsl mainline project as submodule
and moving it to third-party
2021-06-07 09:30:04 +02:00
Lucjan Bryndza
7ed58f9a9b [EGD-6767] Disable WALL mechanism in the DB
Wall mechanism is not needed due to the littlefs
fail proofs safety. It causes a lot of troubles
in the frame recovery and unnessesry increases
io bandwidth

Signed-off-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2021-05-20 14:13:43 +02:00
Tomasz Sobkowiak
f49f4fdab3 [EGD-5512] Don't log pragma errors
Ignore false pragma errors caused by our VFS and sqlite.
2021-05-18 11:10:26 +02:00
RobertPiet
d967db0a48 [EGD-6110] Cyclic db write
WAL option used, checkpoint set to 1
2021-04-22 13:36:07 +02:00
Lucjan Bryndza
982e1b8d50 [EGD-6105] Fix database synchronization
std::fflush used in the sqlite3vfs sync only the stdio buffer
but without sync internal filesystem. Additional fsync call fix
this issue.
2021-03-24 13:31:50 +01:00
Wiktor S. Ovalle Correa
0fa3c714de [EGD-6067] Fix database performance issues
New filesystem works differently and some vFAT optimizations
backfired badly after switch.

- avoid unnecessary folder traversing
- eliminate some unnecessary fstats
- rework sqlite file driver
- reduce MMC startup delay
- fix errno bug in iosyscalls
2021-03-11 14:11:50 +01:00
Roman Kubiak
2a29e27996 [EGD-5757] Fix backup API
Fix backup endpoint to work with new paths and FS api
The flow is based on the design in confluence.
2021-02-25 16:04:04 +01:00
Wiktor S. Ovalle Correa
3b141041e9 [EGD-5737] Merge master into experimental
Keep experimental up to date with changes from master
2021-02-17 17:09:37 +01:00
Tomek Sobkowiak
be66c10888 [EGD-5347] Replace filelength with file_size
Replace use of filelenght with std::filesystem::file_size
sqlite3vfs is using file descriptors so filelength is just renamed
2021-02-17 17:07:41 +01:00
Lucjan Bryndza
f60b9c0013 [EGD-5392] Add switch vfat to RO mode
VFAT partition should be mounted in RO mode by default
because writing to FAT filesystem is unsafe.
Writing is allowed only in the LFS filesystem.
If upgrade is needed FAT partition can be temporary
switched to RW mode using mount() syscall with REMOUNT flag
but it should be switched to RO mode again after upgrade.
2021-02-17 17:07:41 +01:00
Piotr Tański
65119cb495 [EGD-5027] Services synchronization introduced
Dependencies between services are now supported.
2021-02-10 12:37:42 +01:00
Radoslaw Wicik
6d481b753b [EGD-4763] Fix Unit Tests - db unittest
Fix reqired by CI to work
2021-02-04 16:45:50 +01:00
jimmorrisson
14918dc4f9 [EGD-4925] Change new filesystem handling implementation in module-gui. (#1193)
Due to vfs deprecation there is need to remove all vfs calls from code. This PR covers module gui. There are some modifications in other modules included which are necessary because of build system issues.
2020-12-16 15:23:11 +01:00
Piotr Tanski
4e0f72e70a [EGD-4696] Several stabilization patches. (#1192) 2020-12-15 15:30:13 +01:00
jimmorrisson
6711e02bad [EGD-4446] Change: new filesystem handling implementation in module db. (#1052)
Due to vfs deprecation there is need to remove all vfs calls from code. This PR covers module database. It also contains minor fixes in module-db.
2020-12-05 10:40:27 +01:00
RobertPiet
6b66737b13 [EGD-4354] settings starting script moved to two separated scripts (#1067) 2020-11-27 11:38:40 +01:00
Tomek Sobkowiak
ee8a5e4ab9 [EDG-4346] Load script to init contacts database (#1013) 2020-11-22 17:31:56 +01:00
Tomek Sobkowiak
6e248eb3ca [EDG-4349] Load script to init alarms database (#1000) 2020-11-13 11:08:46 +01:00
Tomek Sobkowiak
c9d9ee622f [EDG-4506] Database initializer to load init scripts from file (#979)
* [EDG-4506] Database initializer to load init scripts from file
2020-11-09 11:12:08 +01:00
Lucjan Bryndza
501260be12 [EGD-4298] Disable WAL log in DB (#965)
Disable Write Ahead Log due to reduce number of fat updates

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-11-04 17:18:48 +01:00
Lucjan Bryndza
445010d7f9 [EGD-4135] Database interface improvement (#881)
Fix for unexcepted power failure by adding new implemented
function ff_fflush.
Improve write interface to complies with Linux lseek syscall.
Linux lseek syscall allows to lseek outsite the file size.
When write if lseek is out of range, write syscall write data to new
offset and fill the gap with zeros.
Free RTOS-FAT behaviour doesn't support sparse files, so we need
to implement this functionality manually on the sqlite3 vfs inteface
layer.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-10-23 09:19:57 +02:00
Przemyslaw Brudny
e131dae68f [EGD-3743] Removed old doxygen copyright statements from project. 2020-10-20 12:55:10 +02:00
Radoslaw Wicik
2276ceed67 [EGD-3743] Update copyrights in fies 2020-10-20 12:55:10 +02:00
Radoslaw Wicik
680c8168e5 [EGD-3998] New db engine (3.33.0) and vfs passing PRAGMA support back to sqlite 2020-10-09 12:46:51 +02:00
Radoslaw Wicik
5e5bbe2eb9 [EGD-3428] Fix db interface functions names - Field class 2020-07-16 10:55:07 +02:00
Radoslaw Wicik
24128854e9 [EGD-3428] Fix db interface functions names - QueryResult class 2020-07-16 10:55:07 +02:00
Radoslaw Wicik
c2b8a33d4b [EGD-3428] Fix db interface functions names - Database class 2020-07-16 10:55:07 +02:00