summaryrefslogtreecommitdiff
path: root/src/components/ble/FSService.h
diff options
context:
space:
mode:
authorTim Keller <geekboy1011@gmail.com>2021-10-17 16:04:23 (GMT)
committerTim Keller <geekboy1011@gmail.com>2021-12-10 01:18:57 (GMT)
commit91c644b43c250b0a03047349182828df31ddcbd2 (patch)
tree9feec7231acc3192468d281a8b091683efe14603 /src/components/ble/FSService.h
parentf57f797ff54d9ee8864d3fc62f0c8662df13aad8 (diff)
direcetory listings maybe?
Added LISTDIR command and notify responses.
Diffstat (limited to 'src/components/ble/FSService.h')
-rw-r--r--src/components/ble/FSService.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/components/ble/FSService.h b/src/components/ble/FSService.h
index 85b484a..eb4b34d 100644
--- a/src/components/ble/FSService.h
+++ b/src/components/ble/FSService.h
@@ -4,6 +4,7 @@
#include <host/ble_gap.h>
#undef max
#undef min
+
#include "components/fs/FS.h"
namespace Pinetime {
@@ -42,8 +43,26 @@ namespace Pinetime {
struct ble_gatt_chr_def characteristicDefinition[3];
struct ble_gatt_svc_def serviceDefinition[2];
uint16_t versionCharacteristicHandle;
+ uint16_t transferCharacteristicHandle;
+ typedef struct __attribute__((packed)) {
+ uint8_t command;
+ uint8_t padding;
+ uint16_t pathlen;
+ char pathstr[70];
+ } ListDirHeader;
+ typedef struct __attribute__((packed)) {
+ uint8_t command;
+ uint8_t status;
+ uint16_t path_length;
+ uint32_t entry;
+ uint32_t totalentries;
+ uint32_t flags;
+ uint32_t modification_time;
+ uint32_t file_size;
+ char path[70];
+ } ListDirResponse;
- enum class commands {
+ enum class commands : uint8_t {
INVALID = 0x00,
READ = 0x10,
READ_DATA = 0x11,
@@ -58,8 +77,10 @@ namespace Pinetime {
LISTDIR = 0x50,
LISTDIR_ENTRY = 0x51,
MOVE = 0x60,
- MOVE_STATUS = 0x61,
- }
+ MOVE_STATUS = 0x61
+ };
+
+ int FSCommandHandler(uint16_t connectionHandle, os_mbuf* om);
};
}
}