9 #ifndef EV3DUDER_PACKETS_H
10 #define EV3DUDER_PACKETS_H
23 #define EV3_PACKET_FIELDS \
32 #define EV3_COMMAND_FIELDS \
42 #define EV3_REPLY_FIELDS \
61 #pragma pack(push, 1) //README: __attribute__((packed)) doesn't work for whatever reason
278 #define EV3_VM_COMMAND_FIELDS \
328 #define packet_alloc(type, extra) ({ \
330 if ((sizeof(type) + extra < (u16)-1) \
331 && (ptr = malloc(sizeof(type) + extra))) { \
332 memcpy(ptr, &type##_INIT, sizeof(type)); \
333 ((SYSTEM_CMD *)ptr)->packetLen = (u16)(sizeof(type) + extra - PREFIX_SIZE); \
SYSTEM_REPLY CREATE_DIR_REPLY
SYSTEM_CMD ENTERFWUPDATE
Force brick into Firmware update mode, untested and unused.
EV3_COMMAND_FIELDS u16 maxBytes
EV3_PACKET_FIELDS u8 replyType
const EXECUTE_FILE EXECUTE_FILE_INIT
EV3_REPLY_FIELDS u8 fileHandle
const ENTERFWUPDATE ENTERFWUPDATE_INIT
EV3_COMMAND_FIELDS u16 maxBytes
EV3_REPLY_FIELDS u8 fileHandle
Directory contents on EV3.
EV3_COMMAND_FIELDS u8 fileHandle
const CONTINUE_DOWNLOAD CONTINUE_DOWNLOAD_INIT
const CONTINUE_UPLOAD CONTINUE_UPLOAD_INIT
#define EV3_VM_COMMAND_FIELDS
VM stuff.
continue download from ev3
const VM_REPLY EXECUTE_FILE_REPLY_SUCCESS
EV3_REPLY_FIELDS u32 fileSize
const CONTINUE_DOWNLOAD_REPLY CONTINUE_DOWNLOAD_REPLY_SUCCESS
continue download from ev3 reply
EV3_COMMAND_FIELDS u8 fileHandle
SYSTEM_CMD BLUETOOTHPIN
set bluetooth pin, untested
const BEGIN_DOWNLOAD BEGIN_DOWNLOAD_INIT
const BLUETOOTHPIN BLUETOOTHPIN_INIT
BEGIN_DOWNLOAD_REPLY CONTINUE_DOWNLOAD_REPLY
const BEGIN_UPLOAD BEGIN_UPLOAD_INIT
EV3_REPLY_FIELDS BLUETOOTHPIN echo
#define EV3_COMMAND_FIELDS
const LIST_FILES LIST_FILES_INIT
SYSTEM_REPLY DELETE_FILE_REPLY
EV3_COMMAND_FIELDS u8 handle
base packet for SYSTEM REPLIES
const CONTINUE_LIST_FILES CONTINUE_LIST_FILES_INIT
EV3_COMMAND_FIELDS u32 fileSize
const CREATE_DIR CREATE_DIR_INIT
base packet for SYSTEM COMMANDS
const DELETE_FILE DELETE_FILE_INIT
EV3_REPLY_FIELDS u8 handle
const BEGIN_GETFILE BEGIN_GETFILE_INIT
EV3_REPLY_FIELDS u32 listSize
#define EV3_PACKET_FIELDS