mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Added missing File::size() method to Bridge.
This commit is contained in:
parent
061d71e123
commit
fcb20ea80c
@ -139,7 +139,19 @@ void File::flush() {
|
|||||||
|
|
||||||
//int read(void *buf, uint16_t nbyte)
|
//int read(void *buf, uint16_t nbyte)
|
||||||
|
|
||||||
//uint32_t size()
|
uint32_t File::size() {
|
||||||
|
if (bridge.getBridgeVersion() < 101)
|
||||||
|
return 0;
|
||||||
|
uint8_t cmd[] = {'t', handle};
|
||||||
|
uint8_t buff[5];
|
||||||
|
bridge.transfer(cmd, 2, buff, 5);
|
||||||
|
//err = res[0]; // First byte is error code
|
||||||
|
uint32_t res = buff[1] << 24;
|
||||||
|
res += buff[2] << 16;
|
||||||
|
res += buff[3] << 8;
|
||||||
|
res += buff[4];
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
void File::close() {
|
void File::close() {
|
||||||
if (mode == 255)
|
if (mode == 255)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user