![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Final tidy of code following installation of new sensor, more comments added prior to submission
Dependencies: mbed
SD_Card/FATFileSystem/FATFileHandle.h@18:fc63b51a0302, 2022-02-04 (annotated)
- Committer:
- legstar85
- Date:
- Fri Feb 04 09:20:18 2022 +0000
- Revision:
- 18:fc63b51a0302
- Parent:
- 14:3e9991fe64e5
Final tidy of code following installation of new sensor, more comments added prior to submission
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
legstar85 | 14:3e9991fe64e5 | 1 | /* mbed Microcontroller Library |
legstar85 | 14:3e9991fe64e5 | 2 | * Copyright (c) 2006-2012 ARM Limited |
legstar85 | 14:3e9991fe64e5 | 3 | * |
legstar85 | 14:3e9991fe64e5 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
legstar85 | 14:3e9991fe64e5 | 5 | * of this software and associated documentation files (the "Software"), to deal |
legstar85 | 14:3e9991fe64e5 | 6 | * in the Software without restriction, including without limitation the rights |
legstar85 | 14:3e9991fe64e5 | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
legstar85 | 14:3e9991fe64e5 | 8 | * copies of the Software, and to permit persons to whom the Software is |
legstar85 | 14:3e9991fe64e5 | 9 | * furnished to do so, subject to the following conditions: |
legstar85 | 14:3e9991fe64e5 | 10 | * |
legstar85 | 14:3e9991fe64e5 | 11 | * The above copyright notice and this permission notice shall be included in |
legstar85 | 14:3e9991fe64e5 | 12 | * all copies or substantial portions of the Software. |
legstar85 | 14:3e9991fe64e5 | 13 | * |
legstar85 | 14:3e9991fe64e5 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
legstar85 | 14:3e9991fe64e5 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
legstar85 | 14:3e9991fe64e5 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
legstar85 | 14:3e9991fe64e5 | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
legstar85 | 14:3e9991fe64e5 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
legstar85 | 14:3e9991fe64e5 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
legstar85 | 14:3e9991fe64e5 | 20 | * SOFTWARE. |
legstar85 | 14:3e9991fe64e5 | 21 | */ |
legstar85 | 14:3e9991fe64e5 | 22 | #ifndef MBED_FATFILEHANDLE_H |
legstar85 | 14:3e9991fe64e5 | 23 | #define MBED_FATFILEHANDLE_H |
legstar85 | 14:3e9991fe64e5 | 24 | |
legstar85 | 14:3e9991fe64e5 | 25 | #include "FileHandle.h" |
legstar85 | 14:3e9991fe64e5 | 26 | |
legstar85 | 14:3e9991fe64e5 | 27 | using namespace mbed; |
legstar85 | 14:3e9991fe64e5 | 28 | |
legstar85 | 14:3e9991fe64e5 | 29 | class FATFileHandle : public FileHandle { |
legstar85 | 14:3e9991fe64e5 | 30 | public: |
legstar85 | 14:3e9991fe64e5 | 31 | |
legstar85 | 14:3e9991fe64e5 | 32 | FATFileHandle(FIL fh); |
legstar85 | 14:3e9991fe64e5 | 33 | virtual int close(); |
legstar85 | 14:3e9991fe64e5 | 34 | virtual ssize_t write(const void* buffer, size_t length); |
legstar85 | 14:3e9991fe64e5 | 35 | virtual ssize_t read(void* buffer, size_t length); |
legstar85 | 14:3e9991fe64e5 | 36 | virtual int isatty(); |
legstar85 | 14:3e9991fe64e5 | 37 | virtual off_t lseek(off_t position, int whence); |
legstar85 | 14:3e9991fe64e5 | 38 | virtual int fsync(); |
legstar85 | 14:3e9991fe64e5 | 39 | virtual off_t flen(); |
legstar85 | 14:3e9991fe64e5 | 40 | |
legstar85 | 14:3e9991fe64e5 | 41 | virtual off_t seek(off_t position, int whence) { return lseek(position, whence); } |
legstar85 | 14:3e9991fe64e5 | 42 | virtual off_t size() { return flen(); } |
legstar85 | 14:3e9991fe64e5 | 43 | |
legstar85 | 14:3e9991fe64e5 | 44 | protected: |
legstar85 | 14:3e9991fe64e5 | 45 | |
legstar85 | 14:3e9991fe64e5 | 46 | FIL _fh; |
legstar85 | 14:3e9991fe64e5 | 47 | |
legstar85 | 14:3e9991fe64e5 | 48 | }; |
legstar85 | 14:3e9991fe64e5 | 49 | |
legstar85 | 14:3e9991fe64e5 | 50 | #endif |
legstar85 | 14:3e9991fe64e5 | 51 |