Commit Graph

10 Commits

Author SHA1 Message Date
Wyatt Hepler
16b04521dd pw_kvs: Move test; disable dumping to file
- Move long-running Put test to a separate file.
- Do not dump the KVS state to file by default to prevent files from
  showing up when the tests run.

Change-Id: Ie466d06aa3e22819cad03713e866afae5c63cbe6
2020-02-07 16:03:02 -08:00
Wyatt Hepler
97fc794536 pw_kvs: Introduce alignment to the entry header
- Add an 8-bit alignment field to the entry header. This makes the
  entry header a complete description of the entry's representation in
  flash (assuming the checksum algorithm is implied by the magic).
- Write basic tests for the EntryHeader class.

Change-Id: I7e48d5c16451ceb81f7c191d2f261e0a9bef14b7
2020-02-07 00:34:58 +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
Wyatt Hepler
ad684a1897 pw_kvs: Make in_memory_fake_flash.h library
- Make in_memory_fake_flash.h a separate library that is only visible
  within pw_kvs (for now).
- Have the fake flash use PW_LOG_ERROR instead of the short names, since
  it's logging from the header.

Change-Id: I686024bad1e532632d0c9e6eefe74207fdc1f22e
2020-02-04 17:41:49 -08:00
Wyatt Hepler
6e3a83b61f pw_kvs: Get checksums working; enable test
- Allow checksums to verify data larger than their internal state. This
  facilitates using a CRC16 in a uint32_t.
- Move checksum functions to the EntryHeader class, since it ultimately
  stores the checksums and is included with it.
- Enable one checksum test. Further tests are needed.
- Make some tweaks to the Get overload for objects.

Change-Id: I989b72905e140794f75c8f8619aaab1623f6f195
2020-02-04 16:35:40 -08:00
Wyatt Hepler
ec4b9351de pw_kvs: Implement CRC16 checksum for KVS
- Create CRC16 implementation of pw::kvs::ChecksumAlgorithm.
- Add tests for the ChecksumAlgorithm class.

Change-Id: I3d7268e49c4eec06d61e113602ce24c05a3b0fa0
2020-02-04 01:22:49 +00:00
Wyatt Hepler
4da1fcb4b2 pw_kvs: Initial commit of new KVS design
Builds, but lots more work needed.

Fun fact: this code was written collaboratively in a Google Doc.

Change-Id: I8a89c5d0fdc71ec28cf432350e65d17e24a6f25c
2020-01-31 14:38:37 -08:00
Wyatt Hepler
acaacf9a4f pw_kvs: Initial API changes
- Use std::string_view for keys to avoid the need for null termination.
- Use std::span and std::byte for data.
- Use StatusWithSize and size_t.
- Other minor adjustments.

Change-Id: I10d2f0f47b386071ed4ecf81586decfcc99244cd
2020-01-29 16:20:50 -08:00
Wyatt Hepler
d6b384aba0 pw_kvs: Remove the sub-sector interface
Change-Id: Id9d2984220b6aa28e6dc1bd87e8da0e39b3131ea
2020-01-28 01:18:28 +00:00
Wyatt Hepler
2ad6067478 pw_kvs: Add to build; get tests passing
Change-Id: Idfd357beaf60b94ebaf9b4b1f8cd1b3d712e9b10
2020-01-27 19:13:05 +00:00