ev3duder  0.3.0
EV3 Downloader/Uploader
defs.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <string.h>

Go to the source code of this file.

Macros

#define ARRAY_SIZE(array)   (sizeof(array) / sizeof(array)[0])
 
#define die(msg)
 
#define print_bytes(buf, len)
 
#define print_chars(buf, len)
 
#define TIMEOUT   2000 /* in milliseconds */
 

Typedefs

typedef uint8_t u8
 
typedef uint16_t u16
 
typedef uint32_t u32
 
typedef uint64_t u64
 
typedef int8_t i8
 
typedef int16_t i16
 
typedef int32_t i32
 
typedef int64_t i64
 

Macro Definition Documentation

#define ARRAY_SIZE (   array)    (sizeof(array) / sizeof(array)[0])

Definition at line 19 of file defs.h.

#define die (   msg)
Value:
do {\
fprintf(stderr, "[%s:%d]: %ls (%s)", __func__, __LINE__, hid_error(handle), msg);\
exit(__LINE__);\
} while (0)
EXTERN void * handle
Definition: ev3_io.h:17

Definition at line 21 of file defs.h.

#define print_bytes (   buf,
  len 
)
Value:
do {\
u8 *ptr = (u8*)buf;\
for (int i = 0; i != len; i++, ptr++) fprintf(stderr, "%02x ", *ptr);\
} while (0*putc('\n', stderr))
uint8_t u8
Definition: defs.h:9

Definition at line 34 of file defs.h.

#define print_chars (   buf,
  len 
)
Value:
do {\
char *ptr = buf;\
for (int i = 0; i != len; i++, ptr++) fprintf(stderr, "%c ", *ptr);\
} while (0*putc('\n', stderr))

Definition at line 40 of file defs.h.

#define TIMEOUT   2000 /* in milliseconds */

Definition at line 46 of file defs.h.

Typedef Documentation

typedef int16_t i16

Definition at line 15 of file defs.h.

typedef int32_t i32

Definition at line 16 of file defs.h.

typedef int64_t i64

Definition at line 17 of file defs.h.

typedef int8_t i8

Definition at line 14 of file defs.h.

typedef uint16_t u16

Definition at line 10 of file defs.h.

typedef uint32_t u32

Definition at line 11 of file defs.h.

typedef uint64_t u64

Definition at line 12 of file defs.h.

typedef uint8_t u8

Definition at line 9 of file defs.h.