diff options
author | Cristian Maglie <c.maglie@bug.st> | 2013-06-07 17:39:03 +0200 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2013-06-07 17:39:03 +0200 |
commit | 842a235ec4352b4d4d040743a87bc7b69daef4f9 (patch) | |
tree | 09d15fa176de76e78fd239c4cc007d76aef96a1e /libraries/Bridge/Bridge.h | |
parent | 514b18bb059f86a7e9f125c529befa914a1cde48 (diff) |
Bridge: Added File I/O
Diffstat (limited to 'libraries/Bridge/Bridge.h')
-rw-r--r-- | libraries/Bridge/Bridge.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libraries/Bridge/Bridge.h b/libraries/Bridge/Bridge.h index c7b5361..6043e15 100644 --- a/libraries/Bridge/Bridge.h +++ b/libraries/Bridge/Bridge.h @@ -42,6 +42,20 @@ public: void writeCommandInput(uint8_t handle, const char *buff, unsigned int size) { writeCommandInput(handle, reinterpret_cast<const uint8_t *>(buff), size); } + // Methods to handle files + uint8_t fileOpen(String &file, uint8_t mode, uint8_t &err); + void fileClose(uint8_t handle); + + unsigned int fileRead(uint8_t handle, uint8_t *buff, unsigned int size, uint8_t &err); + unsigned int fileRead(uint8_t handle, char *buff, unsigned int size, uint8_t &err) + { return fileRead(handle, reinterpret_cast<uint8_t *>(buff), size, err); } + + void fileWrite(uint8_t handle, const uint8_t *buff, unsigned int size, uint8_t &err); + void fileWrite(uint8_t handle, const char *buff, unsigned int size, uint8_t &err) + { fileWrite(handle, reinterpret_cast<const uint8_t *>(buff), size, err); } + + void fileSeek(uint8_t handle, uint32_t position, uint8_t &err); + // Methods to handle mailbox messages unsigned int readMessage(uint8_t *buffer, unsigned int size); void writeMessage(const uint8_t *buffer, unsigned int size); |