We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 061d71e commit fcb20eaCopy full SHA for fcb20ea
libraries/Bridge/src/FileIO.cpp
@@ -139,7 +139,19 @@ void File::flush() {
139
140
//int read(void *buf, uint16_t nbyte)
141
142
-//uint32_t size()
+uint32_t File::size() {
143
+ if (bridge.getBridgeVersion() < 101)
144
+ return 0;
145
+ uint8_t cmd[] = {'t', handle};
146
+ uint8_t buff[5];
147
+ bridge.transfer(cmd, 2, buff, 5);
148
+ //err = res[0]; // First byte is error code
149
+ uint32_t res = buff[1] << 24;
150
+ res += buff[2] << 16;
151
+ res += buff[3] << 8;
152
+ res += buff[4];
153
+ return res;
154
+}
155
156
void File::close() {
157
if (mode == 255)
0 commit comments