Host library for controlling a WiConnect enabled Wi-Fi module.
Dependents: wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more
types/File.h@0:ea85c4bb5e1f, 2014-08-11 (annotated)
- Committer:
- dan_ackme
- Date:
- Mon Aug 11 09:58:24 2014 +0000
- Revision:
- 0:ea85c4bb5e1f
- Child:
- 1:6ec9998427ad
initial check-in
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dan_ackme | 0:ea85c4bb5e1f | 1 | /* |
dan_ackme | 0:ea85c4bb5e1f | 2 | * Copyright 2014, ACKme Networks |
dan_ackme | 0:ea85c4bb5e1f | 3 | * All Rights Reserved. |
dan_ackme | 0:ea85c4bb5e1f | 4 | * |
dan_ackme | 0:ea85c4bb5e1f | 5 | * This is UNPUBLISHED PROPRIETARY SOURCE CODE of ACKme Networks; |
dan_ackme | 0:ea85c4bb5e1f | 6 | * the contents of this file may not be disclosed to third parties, copied |
dan_ackme | 0:ea85c4bb5e1f | 7 | * or duplicated in any form, in whole or in part, without the prior |
dan_ackme | 0:ea85c4bb5e1f | 8 | * written permission of ACKme Networks. |
dan_ackme | 0:ea85c4bb5e1f | 9 | */ |
dan_ackme | 0:ea85c4bb5e1f | 10 | |
dan_ackme | 0:ea85c4bb5e1f | 11 | #pragma once |
dan_ackme | 0:ea85c4bb5e1f | 12 | |
dan_ackme | 0:ea85c4bb5e1f | 13 | |
dan_ackme | 0:ea85c4bb5e1f | 14 | #include "Wiconnect.h" |
dan_ackme | 0:ea85c4bb5e1f | 15 | |
dan_ackme | 0:ea85c4bb5e1f | 16 | namespace wiconnect |
dan_ackme | 0:ea85c4bb5e1f | 17 | { |
dan_ackme | 0:ea85c4bb5e1f | 18 | |
dan_ackme | 0:ea85c4bb5e1f | 19 | |
dan_ackme | 0:ea85c4bb5e1f | 20 | class File |
dan_ackme | 0:ea85c4bb5e1f | 21 | { |
dan_ackme | 0:ea85c4bb5e1f | 22 | public: |
dan_ackme | 0:ea85c4bb5e1f | 23 | File(int rxBufferLen = 0, void *rxBuffer = NULL); |
dan_ackme | 0:ea85c4bb5e1f | 24 | ~File(); |
dan_ackme | 0:ea85c4bb5e1f | 25 | |
dan_ackme | 0:ea85c4bb5e1f | 26 | const char* getName() const; |
dan_ackme | 0:ea85c4bb5e1f | 27 | uint32_t getSize() const; |
dan_ackme | 0:ea85c4bb5e1f | 28 | FileType getType() const; |
dan_ackme | 0:ea85c4bb5e1f | 29 | FileFlags getFlags() const; |
dan_ackme | 0:ea85c4bb5e1f | 30 | uint32_t getVersion() const; |
dan_ackme | 0:ea85c4bb5e1f | 31 | const char* getVersionStr(char *buffer = NULL) const; |
dan_ackme | 0:ea85c4bb5e1f | 32 | |
dan_ackme | 0:ea85c4bb5e1f | 33 | WiconnectResult close(); |
dan_ackme | 0:ea85c4bb5e1f | 34 | WiconnectResult read(void* buffer, uint16_t maxLength, uint16_t *bytesRead); |
dan_ackme | 0:ea85c4bb5e1f | 35 | WiconnectResult read(uint8_t **bufferPtr = NULL, uint16_t *bytesReadPtr = NULL); |
dan_ackme | 0:ea85c4bb5e1f | 36 | WiconnectResult getc(uint8_t *c); |
dan_ackme | 0:ea85c4bb5e1f | 37 | void clearRxBuffer(); |
dan_ackme | 0:ea85c4bb5e1f | 38 | |
dan_ackme | 0:ea85c4bb5e1f | 39 | const File* getNext() const; |
dan_ackme | 0:ea85c4bb5e1f | 40 | const File* getPrevious() const; |
dan_ackme | 0:ea85c4bb5e1f | 41 | |
dan_ackme | 0:ea85c4bb5e1f | 42 | protected: |
dan_ackme | 0:ea85c4bb5e1f | 43 | WiconnectResult openForRead(uint8_t handle, const char *filename); |
dan_ackme | 0:ea85c4bb5e1f | 44 | WiconnectResult initWithListing(const char *typeStr, const char *flagsStr, const char* sizeStr, const char *versionStr, const char *nameStr); |
dan_ackme | 0:ea85c4bb5e1f | 45 | |
dan_ackme | 0:ea85c4bb5e1f | 46 | uint8_t handle; |
dan_ackme | 0:ea85c4bb5e1f | 47 | bool readEnabled; |
dan_ackme | 0:ea85c4bb5e1f | 48 | char name[WICONNECT_MAX_FILENAME_SIZE]; |
dan_ackme | 0:ea85c4bb5e1f | 49 | uint32_t size; |
dan_ackme | 0:ea85c4bb5e1f | 50 | FileType type; |
dan_ackme | 0:ea85c4bb5e1f | 51 | FileFlags flags; |
dan_ackme | 0:ea85c4bb5e1f | 52 | uint32_t version; |
dan_ackme | 0:ea85c4bb5e1f | 53 | Wiconnect *wiconnect; |
dan_ackme | 0:ea85c4bb5e1f | 54 | File *next; |
dan_ackme | 0:ea85c4bb5e1f | 55 | File *previous; |
dan_ackme | 0:ea85c4bb5e1f | 56 | |
dan_ackme | 0:ea85c4bb5e1f | 57 | Buffer rxBuffer; |
dan_ackme | 0:ea85c4bb5e1f | 58 | |
dan_ackme | 0:ea85c4bb5e1f | 59 | void* operator new(size_t size); |
dan_ackme | 0:ea85c4bb5e1f | 60 | void operator delete(void*); |
dan_ackme | 0:ea85c4bb5e1f | 61 | |
dan_ackme | 0:ea85c4bb5e1f | 62 | friend class FileInterface; |
dan_ackme | 0:ea85c4bb5e1f | 63 | friend class FileList; |
dan_ackme | 0:ea85c4bb5e1f | 64 | }; |
dan_ackme | 0:ea85c4bb5e1f | 65 | |
dan_ackme | 0:ea85c4bb5e1f | 66 | } |
dan_ackme | 0:ea85c4bb5e1f | 67 |