Commit Graph

8 Commits

Author SHA1 Message Date
Wyatt Hepler
88adfe8b91 pw_kvs: Move EntryHeaderFormat to pw_kvs/format.h
- Move EntryHeaderFormat and the EntryHeader struct to pw_kvs/format.h.
- Rename EntryHeaderFormat to EntryFormat.

Change-Id: Ic5e53c688cd3a483101c7985def6e4bef9c3cbaf
2020-02-21 09:34:31 -08:00
Wyatt Hepler
38ce30f766 pw_kvs: Allow specifying max entries and sectors
Move the KeyDescriptor and SectorDescriptor lists to a templated derived
KeyValueStoreBuffer class. This allows multiple KVSs supporting
different numbers of keys and sectors to exist side-by-side.

Change-Id: I43d0647382e763008ae3b08580c736c1978793dd
2020-02-21 00:25:43 +00:00
Alexei Frolov
972b5f4769 pw_kvs: debug_cli usability improvements
This change adds help text to the KVS CLI which explains the supported
commands.

Change-Id: Ie51b011055ce10f783bd74dbfa5af9e01ecf889f
2020-02-21 00:10:42 +00:00
Wyatt Hepler
a00d1ef82c pw_kvs: Expand Entry tests; fix issues
- Expand the tests for the KVS entry class.
- Fix a few minor issues found by the tests.

Change-Id: I92b5dd614d2a726c912b7b1bf1f9ebd47a702be4
2020-02-19 11:12:01 -08:00
Wyatt Hepler
cdd6dfcfc6 pw_kvs: FlashMemory updates; test utilities
- Update comments for FlashMemory class.
- Split InMemoryFakeFlash to move the fixed-size buffer into the
  derived FakeFlashBuffer class.
- Support initializing FakeFlashBuffer to data provided at construction.
- Allow direct access to the underlying fake flash buffer for testing.
- Create utilities for working with byte arrays in byte_utils.h.

Change-Id: I90d33621cb91da079d7213fe7d33823494120e48
2020-02-19 19:10:32 +00:00
Wyatt Hepler
50f70779c8 Remove StatusWithSize implicit conversions
- Disallow implicit conversions between Status and StatusWithSize, which
  can be problematic.
- Add TRY_WITH_SIZE to pw_kvs to handle returning StatusWithSize from
  functions.
- Make zero the default size argument for StatusWithSize.
- Expand tests for StatusWithSize.

Change-Id: Ia1c36e5a39402a50138d93e89afbaa5e772adb8a
2020-02-14 17:59:00 +00:00
Wyatt Hepler
8e5d313b29 pw_kvs: Debug CLI tweaks to support delete
Change-Id: I9273dde09950d69fefc90eee70d05926335f3647
2020-02-06 02:28:30 +00:00
Wyatt Hepler
d621682fe5 pw_kvs: Simple debug command line interface
Add the pw_kvs:debug_cli executable for performing very basic manual
testing locally.

Change-Id: Ifab6eb237f92a1b09ed7e3797485f9889e6cec64
2020-02-04 17:42:23 -08:00