EV3RT C API Reference [English]
An RTOS-based development platform for LEGO Mindstorms EV3.
 All Data Structures Functions Variables Enumerations Enumerator Groups
ev3api_fs.h
1 
7 #pragma once
8 
31 typedef struct {
32  void* buffer;
33  uint32_t filesz;
34  uint32_t buffersz;
35 } memfile_t;
36 
37 #define TMAX_FILENAME_LEN (255)
38 
39 
46 typedef struct {
47  uint32_t size;
48  uint16_t date;
49  uint16_t time;
50  bool_t is_dir;
51  bool_t is_readonly;
52  bool_t is_hidden;
53  char name[TMAX_FILENAME_LEN + 1];
54 } fileinfo_t;
55 
79 ER_ID ev3_sdcard_opendir(const char *path);
80 
106 ER ev3_sdcard_readdir(ID dirid, fileinfo_t *p_fileinfo);
107 
127 ER ev3_sdcard_closedir(ID dirid);
128 
152 ER ev3_memfile_load(const char *path, memfile_t *p_memfile);
153 
171 ER ev3_memfile_free(memfile_t *p_memfile);
172 
180 typedef enum {
184 } serial_port_t;
185 
200 
213 
ER ev3_memfile_free(memfile_t *p_memfile)
Free the resource (memory) allocated to a memory file.
Definition: ev3api_fs.c:81
bool_t is_dir
Flag of a folder.
Definition: ev3api_fs.h:50
uint16_t time
Last modified time.
Definition: ev3api_fs.h:49
uint32_t filesz
Actual size of this file.
Definition: ev3api_fs.h:33
bool_t is_hidden
Flag of hidden.
Definition: ev3api_fs.h:52
Default serial port (port for log task)
Definition: ev3api_fs.h:181
Structure of file information.
Definition: ev3api_fs.h:46
uint32_t size
File size.
Definition: ev3api_fs.h:47
uint16_t date
Last modified date.
Definition: ev3api_fs.h:48
serial_port_t
Numbers representing serial ports.
Definition: ev3api_fs.h:180
ER ev3_sdcard_readdir(ID dirid, fileinfo_t *p_fileinfo)
Read file information in the directory.
Definition: ev3api_fs.c:129
ER_ID ev3_sdcard_opendir(const char *path)
Open a directory for reading.
Definition: ev3api_fs.c:124
A memory file is a file stored in RAM rather than on the SD card.
Definition: ev3api_fs.h:31
ER ev3_memfile_load(const char *path, memfile_t *p_memfile)
Create a memory file and load a specific file into it from the SD card.
Definition: ev3api_fs.c:14
ER ev3_sdcard_closedir(ID dirid)
Close a directory.
Definition: ev3api_fs.c:148
bool_t ev3_bluetooth_is_connected()
It is checked whether Bluetooth (Serial Port Profile) is connected.
Definition: ev3api_fs.c:152
uint32_t buffersz
Maximum size of the buffer to store this file.
Definition: ev3api_fs.h:34
bool_t is_readonly
Flag of read-only.
Definition: ev3api_fs.h:51
Bluetooth SPP.
Definition: ev3api_fs.h:183
UART (Sensor port 1)
Definition: ev3api_fs.h:182
#define TMAX_FILENAME_LEN
Maximum length of a file name.
Definition: ev3api_fs.h:37
void * buffer
Pointer of the buffer where this file is stored. NULL means a invalid memory file.
Definition: ev3api_fs.h:32
FILE * ev3_serial_open_file(serial_port_t port)
Open the serial port as a file.
Definition: ev3api_fs.c:97