Commit Graph

48 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
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
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
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
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
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
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
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
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
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
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
Szymon Mroczek
24a8107168 [WIP] [EGD-3290] Add database backup feature with sqlite's VACUUM command. 2020-06-24 11:14:00 +02:00
rkubiak01
7cac882c7a [2306] VFS: support .boot.ini and "current" and "previous" os types (#315)
* VFS: support .boot.ini and "current" and "previous" os types

* fixes for first batch of comments
- moved crc32 functions to a seperate file
- changed naming of constant with _
- removed one magic number
- crc methods now cross platform

* using smart pointer for buffer management

* created a simple USER_FILE macro for database names

* removed commented-out code

* style fixes

* Updated crc32 version

* Update module-vfs/vfs-utils.cpp

Co-Authored-By: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>

* Update module-vfs/vfs-utils.cpp

Co-Authored-By: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>

* renamed USER_FILE to USER_PATH macro, this was also
bromen and was returning incorrect paths, std::filesystem::path
behavior is causing these issues.

* VFS: remove method changed

* fixed path for assets copy

* UNITTEST: vfs test fixed

* VFS: changed computeCRC32 return type to void

* Max supported partition to 2 (was 1)

* EOL in vfs.cpp

* nullptr check in computeCRC32
include for log.hpp fixed

* flash_eMMC merged properly

* CRC32 commit update

* testBuild

* fix newline at start of smsdb.cpp
removed test from cmake

* no user/ folder on the root of emmc causes sqlite3 to fault
this adds a create empty user call for rt1051

* flash script fixes
- do not use build-*/sys
- common.sh contains a static list of iles that land on the flash

Co-authored-by: Alek Rudnik <54846206+alekrudnik@users.noreply.github.com>
2020-05-08 10:27:17 +02:00
Alek Rudnik
699cb141e3 Egd 3168 fix for quote sign in db qeury (#335)
* [EDG-3168] fix for quote mark in DB queries

* [EGD-3168] replaced all %s with %q
2020-04-27 14:28:37 +02:00
Alek Rudnik
393f41a89a Egd 3157 prepare sms template db table (#330)
* [EGD-3157] added new DB templates table

* [EGD-3157] added SMS template record

* [EGD-3157] added sms template tabels UT and fixes

* [EGD-3157] added sms template record UT

* [EGD-3157] error log in Database.cpp

* [EGD-3157] fixed usage pf printf specifiers

* [EGD-3157] fixed description in database md file

* [EGD-3157] remove redundant comments
2020-04-24 09:04:46 +02:00
Adam Dobrowolski
4a61f400e7 EGD-3055 Fixed printf issues 2020-04-08 12:23:53 +02:00
Przemyslaw Brudny
c0822b6658 [EDG-3019] Moved log.hpp and debug.hpp into main PurePhone repo 2020-03-24 15:55:32 +01:00
Adam Dobrowolski
cbc13c4e74 EGD-3026 Added logging of sqlite error on start 2020-03-24 14:17:12 +01:00
Adam Dobrowolski
7674b44385 EGD-3026 PR applied, fixed buid for release 2020-03-24 14:17:12 +01:00
Przemyslaw Brudny
8f92715951 [EDG-3019] Segger utils moved to git submodule 2020-03-23 18:37:37 +01:00
Radoslaw Wicik
a8573a404c Apply new style 2020-03-17 10:03:16 +01:00
Adam Dobrowolski
efccb4e1ce [FIX] Fixed crash on null string creation 2019-12-18 07:13:59 +01:00
RomanKubiak
61e95c9fc6 DATABASE: clang formatting before phonebook changes 2019-11-28 12:28:25 +01:00
Kuba
4046f4e324 Unit tests for Alarms database. Fixes and code cleanup for alarms database. 2019-07-16 14:48:12 +02:00
Mati
433af1a130 Fixed warnings 2019-06-06 13:05:15 +02:00
Mati
d446b0ac94 WiP: record interface 2019-06-04 08:27:30 +02:00
Mati
b5dab4db16 Minor changes 2019-05-28 15:19:03 +02:00
Mati
7046f980d8 Added SMSTable unittests. Small updates in implementation 2019-05-28 08:48:58 +02:00
Mati
cd529667de Added DB tables interface 2019-05-27 16:03:46 +02:00