From 842a235ec4352b4d4d040743a87bc7b69daef4f9 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 7 Jun 2013 17:39:03 +0200 Subject: Bridge: Added File I/O --- libraries/Bridge/Bridge.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libraries/Bridge/Bridge.h') 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(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(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(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); -- cgit v1.2.3-18-g5258