ev3.h
Go to the documentation of this file.
1 
2 /* ev3.h was generated by yup.py (yupp) 1.0c3
3  out of ev3.yu-h
4  */
11 #ifndef EV3_H
12 #define EV3_H
13 
14 #ifdef EV3_IMPLEMENT
15 #define EV3_VAR( decl ) \
16  decl
17 #define EV3_VAR_INIT( decl, ... ) \
18  decl = __VA_ARGS__
19 
20 #define EV3_INL
21 
22 #else /* EV3_IMPLEMENT */
23 #define EV3_VAR( decl ) \
24  extern decl
25 #define EV3_VAR_INIT( decl, ... ) \
26  extern decl
27 
28 #if __GNUC__ && !__GNUC_STDC_INLINE__
29 #define EV3_INL \
30  extern inline
31 #else
32 #define EV3_INL \
33  inline
34 #endif
35 
36 #endif /* EV3_IMPLEMENT */
37 
38 #include <stddef.h>
39 #include <stdint.h>
40 #include <stdbool.h>
41 #include "ev3_both.h"
42 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 // CLIENT ////////////////////////////////////////
57 #ifndef __ARM_ARCH_4T__
58 
62 EV3_VAR_INIT( char *ev3_brick_addr, NULL );
63 
67 EV3_VAR_INIT( uint16_t ev3_brick_port, 8800 );
68 
70 #endif
71 
72 #ifndef DEFINE_H
73 typedef uint8_t byte;
74 typedef uint32_t dword;
75 
76 #endif
77 
78 typedef uint8_t INX_T;
79 typedef uint8_t FLAGS_T;
80 
81 #define STR_unknown_ "<unknown>"
82 
90 extern int ev3_init( void );
91 
95 extern void ev3_uninit( void );
96 
104 extern size_t ev3_write_binary( const char *fn, char *data, size_t sz );
105 
112 extern size_t ev3_write( const char *fn, char *value );
113 
120 extern size_t ev3_write_bool( const char *fn, bool value );
121 
128 extern size_t ev3_write_int( const char *fn, int value );
129 
136 extern size_t ev3_write_dword( const char *fn, uint32_t value );
137 
144 extern size_t ev3_write_byte( const char *fn, uint8_t value );
145 
152 extern size_t ev3_write_float( const char *fn, float value );
153 
154 extern size_t ev3_write_char_array( const char *fn, char *value );
155 extern size_t ev3_write_byte_array( const char *fn, uint8_t *value, size_t sz );
156 
166 extern size_t ev3_multi_write_binary( uint8_t *sn, uint16_t pos, const char *fn, char *data, size_t sz );
167 
168 extern size_t ev3_multi_write( uint8_t *sn, uint16_t pos, const char *fn, char *value );
169 extern size_t ev3_multi_write_bool( uint8_t *sn, uint16_t pos, const char *fn, bool value );
170 extern size_t ev3_multi_write_int( uint8_t *sn, uint16_t pos, const char *fn, int value );
171 extern size_t ev3_multi_write_dword( uint8_t *sn, uint16_t pos, const char *fn, uint32_t value );
172 extern size_t ev3_multi_write_byte( uint8_t *sn, uint16_t pos, const char *fn, uint8_t value );
173 extern size_t ev3_multi_write_float( uint8_t *sn, uint16_t pos, const char *fn, float value );
174 extern size_t ev3_multi_write_char_array( uint8_t *sn, uint16_t pos, const char *fn, char *value );
175 extern size_t ev3_multi_write_byte_array( uint8_t *sn, uint16_t pos, const char *fn, uint8_t *value, size_t sz );
176 
184 extern size_t ev3_read_binary( const char *fn, char *buf, size_t sz );
185 
193 extern size_t ev3_read( const char *fn, char *buf, size_t sz );
194 
201 extern size_t ev3_read_bool( const char *fn, bool *buf );
202 
209 extern size_t ev3_read_int( const char *fn, int *buf );
210 
217 extern size_t ev3_read_dword( const char *fn, uint32_t *buf );
218 
225 extern size_t ev3_read_byte( const char *fn, uint8_t *buf );
226 
233 extern size_t ev3_read_float( const char *fn, float *buf );
234 
235 extern size_t ev3_read_char_array( const char *fn, char *buf, size_t sz );
236 extern size_t ev3_read_byte_array( const char *fn, uint8_t *buf, size_t sz );
237 
245 extern size_t ev3_listdir( const char *fn, char *buf, size_t sz );
246 
252 extern size_t ev3_read_keys( uint8_t *buf );
253 
258 extern bool ev3_poweroff( void );
259 
268 extern int ev3_string_suffix( const char *prefix, char **s, uint32_t *buf );
269 
270 #ifdef __cplusplus
271 }
272 #endif
273 
276 #undef EV3_VAR
277 #undef EV3_VAR_INIT
278 #undef EV3_INL
279 #endif
280 
size_t ev3_write_binary(const char *fn, char *data, size_t sz)
Write binary data into the specified file of the EV3 brick.
Definition: ev3.c:174
size_t ev3_write(const char *fn, char *value)
Write a string into the specified file.
Definition: ev3.c:207
size_t ev3_read_int(const char *fn, int *buf)
Read an integer value from the specified file.
Definition: ev3.c:316
size_t ev3_listdir(const char *fn, char *buf, size_t sz)
List files in the specified directory of the EV3 brick.
Definition: ev3.c:390
size_t ev3_read_float(const char *fn, float *buf)
Read a float value from the specified file.
Definition: ev3.c:344
void ev3_uninit(void)
Uninitialize the remote access.
Definition: ev3.c:169
size_t ev3_multi_write_binary(uint8_t *sn, uint16_t pos, const char *fn, char *data, size_t sz)
Write binary data into several specified files of the EV3 brick.
Definition: ev3.c:179
size_t ev3_write_float(const char *fn, float value)
Write a float value into the specified file.
Definition: ev3.c:249
bool ev3_poweroff(void)
Power-off the EV3 brick.
Definition: ev3.c:199
size_t ev3_write_int(const char *fn, int value)
Write an integer value into the specified file.
Definition: ev3.c:217
size_t ev3_read(const char *fn, char *buf, size_t sz)
Read a string from the specified file.
Definition: ev3.c:305
size_t ev3_read_byte(const char *fn, uint8_t *buf)
Read a byte value from the specified file.
Definition: ev3.c:369
size_t ev3_read_keys(uint8_t *buf)
Read state of the EV3 brick&#39;s keys.
Definition: ev3.c:189
size_t ev3_write_dword(const char *fn, uint32_t value)
Write an unsigned integer value into the specified file.
Definition: ev3.c:233
size_t ev3_write_byte(const char *fn, uint8_t value)
Write a byte value into the specified file.
Definition: ev3.c:275
size_t ev3_write_bool(const char *fn, bool value)
Write a boolean value into the specified file.
Definition: ev3.c:265
size_t ev3_read_binary(const char *fn, char *buf, size_t sz)
Read binary data from the specified file.
Definition: ev3.c:184
size_t ev3_read_bool(const char *fn, bool *buf)
Read a boolean value from the specified file.
Definition: ev3.c:358
EV3_VAR_INIT(char *ev3_brick_addr, NULL)
Predefined IP address of the EV3 brick.
int ev3_string_suffix(const char *prefix, char **s, uint32_t *buf)
Get a numerical suffix of the string.
Definition: ev3.c:401
int ev3_init(void)
Initialize the remote access and detect the EV3 brick. This function do nothing in the case of the lo...
Definition: ev3.c:154
EV3 brick definitions.
size_t ev3_read_dword(const char *fn, uint32_t *buf)
Read an unsigned integer value from the specified file.
Definition: ev3.c:330