summaryrefslogtreecommitdiff
path: root/src/components/ble/FSService.h
diff options
context:
space:
mode:
authorTim Keller <geekboy1011@gmail.com>2021-10-25 03:02:02 +0000
committerTim Keller <geekboy1011@gmail.com>2021-12-10 01:18:57 +0000
commitc1aa5a5ea7d5ecde63a786827a866312c04507f9 (patch)
tree741b28e90900f5644cbc59fb91370c8cbcbf6133 /src/components/ble/FSService.h
parent8fb99471c38c2efd7af88d4888c5792bdd8deafb (diff)
Write works
Diffstat (limited to 'src/components/ble/FSService.h')
-rw-r--r--src/components/ble/FSService.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/components/ble/FSService.h b/src/components/ble/FSService.h
index e9c98fb4..17f52eb0 100644
--- a/src/components/ble/FSService.h
+++ b/src/components/ble/FSService.h
@@ -47,9 +47,6 @@ namespace Pinetime {
uint16_t versionCharacteristicHandle;
uint16_t transferCharacteristicHandle;
- // lfs_dir_t dir;
- // lfs_info info;
-
enum class commands : uint8_t {
INVALID = 0x00,
READ = 0x10,
@@ -74,6 +71,7 @@ namespace Pinetime {
};
FSState state;
char filepath[maxpathlen]; // TODO ..ugh fixed filepath len
+ int fileSize;
using ReadHeader = struct __attribute__((packed)) {
commands command;
uint8_t padding;
@@ -100,6 +98,33 @@ namespace Pinetime {
uint32_t chunksize;
};
+ using WriteHeader = struct __attribute__((packed)) {
+ commands command;
+ uint8_t padding;
+ uint16_t pathlen;
+ uint32_t offset;
+ uint64_t modTime;
+ uint32_t totalSize;
+ char pathstr[];
+ };
+
+ using WriteResponse = struct __attribute__((packed)) {
+ commands command;
+ uint8_t status;
+ uint16_t padding;
+ uint32_t offset;
+ uint64_t modTime;
+ uint32_t freespace;
+ };
+
+ using WritePacing = struct __attribute__((packed)) {
+ commands command;
+ uint8_t status;
+ uint16_t padding;
+ uint32_t offset;
+ uint32_t dataSize;
+ uint8_t data[];
+ };
using ListDirHeader = struct __attribute__((packed)) {
commands command;
uint8_t padding;