Skip to content

Commit 9f5ca21

Browse files
Describe ppk2 file format
1 parent 6e4da63 commit 9f5ca21

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,38 @@ for details.
5757
## License
5858

5959
See the [LICENSE](LICENSE) file for details.
60+
61+
## File format
62+
63+
The app stores data in and reads data from `*.ppk2` files. There are no
64+
guarantees that the format will remain the same. But you can see in the source
65+
code, that it currently is like this:
66+
67+
A ppk2 file is a zip compressed file, containing 3 files:
68+
69+
- `session.raw`
70+
- `minimap.raw`
71+
- `metadata.json`
72+
73+
Manditoary Data:
74+
75+
- `session.raw` in
76+
[class FileData](https://github.com/NordicSemiconductor/pc-nrfconnect-ppk/blob/6e4da637f07d5f6995d96362368c781b71b5bc61/src/globals.ts#L53-L112)
77+
78+
- 4 byes for current -> decimal in uA
79+
- 2 bytes for the digital channels -> 2 bits per channel LSB is Digital
80+
channel 1 (D8-D7-D6-D5-D4-D3-D2-D1). Convertsion of the 8bit digital
81+
input to the 16bit format is done in
82+
[the function `convertBits16`](https://github.com/NordicSemiconductor/pc-nrfconnect-ppk/blob/6e4da637f07d5f6995d96362368c781b71b5bc61/src/utils/bitConversion.ts#L21)
83+
84+
- Minimap condensed data in
85+
[FoldingBuffer#saveToFile](https://github.com/NordicSemiconductor/pc-nrfconnect-ppk/blob/6e4da637f07d5f6995d96362368c781b71b5bc61/src/utils/foldingBuffer.ts#L118-L128)
86+
- Metadata stored in
87+
[`saveFileHandler`](https://github.com/NordicSemiconductor/pc-nrfconnect-ppk/blob/6e4da637f07d5f6995d96362368c781b71b5bc61/src/utils/saveFileHandler.ts#L57-L60)
88+
(samples per second must be the same as supported by our app
89+
90+
**Important**: No negative values are supported! Any values < 0.2uA is
91+
interpreted as 0.
92+
93+
Final compression of the 3 files into ppk2 in
94+
[`saveFileHandler`](https://github.com/NordicSemiconductor/pc-nrfconnect-ppk/blob/6e4da637f07d5f6995d96362368c781b71b5bc61/src/utils/saveFileHandler.ts#L40)

0 commit comments

Comments
 (0)