25 #include <sys/types.h>
88 #define SYSTEM_COMMAND_REPLY 0x01 // System command, reply required
89 #define SYSTEM_COMMAND_NO_REPLY 0x81 // System command, reply not required
93 #define BEGIN_DOWNLOAD 0x92 // Begin file down load
94 #define CONTINUE_DOWNLOAD 0x93 // Continue file down load
95 #define BEGIN_UPLOAD 0x94 // Begin file upload
96 #define CONTINUE_UPLOAD 0x95 // Continue file upload
97 #define BEGIN_GETFILE 0x96 // Begin get bytes from a file (while writing to the file)
98 #define CONTINUE_GETFILE 0x97 // Continue get byte from a file (while writing to the file)
99 #define CLOSE_FILEHANDLE 0x98 // Close file handle
100 #define LIST_FILES 0x99 // List files
101 #define CONTINUE_LIST_FILES 0x9A // Continue list files
102 #define CREATE_DIR 0x9B // Create directory
103 #define DELETE_FILE 0x9C // Delete
104 #define LIST_OPEN_HANDLES 0x9D // List handles
105 #define WRITEMAILBOX 0x9E // Write to mailbox
106 #define BLUETOOTHPIN 0x9F // Transfer trusted pin code to brick
107 #define ENTERFWUPDATE 0xA0 // Restart the brick in Firmware update mode
108 #define SETBUNDLEID 0xA1 // Set Bundle ID for mode 2
109 #define SETBUNDLESEEDID 0xA2 // Set bundle seed ID for mode 2
128 #define SYSTEM_REPLY 0x03 // System command reply
129 #define SYSTEM_REPLY_ERROR 0x05 // System command reply error
138 #define UNKNOWN_HANDLE 0x01
139 #define HANDLE_NOT_READY 0x02
140 #define CORRUPT_FILE 0x03
141 #define NO_HANDLES_AVAILABLE 0x04
142 #define NO_PERMISSION 0x05
143 #define ILLEGAL_PATH 0x06
144 #define FILE_EXITS 0x07
145 #define END_OF_FILE 0x08
146 #define SIZE_ERROR 0x09
147 #define UNKNOWN_ERROR 0x0A
148 #define ILLEGAL_FILENAME 0x0B
149 #define ILLEGAL_CONNECTION 0x0C
659 #define DIRECT_COMMAND_REPLY 0x00 // Direct command, reply required
660 #define DIRECT_COMMAND_NO_REPLY 0x80 // Direct command, reply not required
690 #define DIRECT_REPLY 0x02 // Direct command reply
691 #define DIRECT_REPLY_ERROR 0x04 // Direct command reply error
932 #define DIR_CMD_REPLY_WITH_BUSY 0x0F // Direct command, reply required
933 #define DIR_CMD_NO_REPLY_WITH_BUSY 0x8F // Direct command, reply not required
953 #define MAX_MSG_SIZE 1024
954 #define NO_OF_MAILBOXES 30
955 #define MAILBOX_CONTENT_SIZE 250
956 #define USB_CMD_IN_REP_SIZE 1024
957 #define USB_CMD_OUT_REP_SIZE 1024
1046 #define SIZEOF_BEGINLIST 6
1062 #define SIZEOF_RPLYBEGINLIST 12
1074 #define SIZEOF_CONTINUELIST 7
1087 #define SIZEOF_RPLYCONTINUELIST 8
1099 #define SIZEOF_BEGINGETFILE 6
1115 #define SIZEOF_RPLYBEGINGETFILE 12
1127 #define SIZEOF_CONTINUEGETFILE 7
1143 #define SIZEOF_RPLYCONTINUEGETFILE 12
1155 #define SIZEOF_BEGINREAD 6
1171 #define SIZEOF_RPLYBEGINREAD 12
1183 #define SIZEOF_CONTINUEREAD 7
1195 #define SIZEOF_RPLYCONTINUEREAD 8
1204 #define SIZEOF_LISTHANDLES 4
1215 #define SIZEOF_RPLYLISTHANDLES 7
1225 #define SIZEOF_REMOVEFILE 4
1235 #define SIZEOF_RPLYREMOVEFILE 7
1245 #define SIZEOF_MAKEDIR 4
1255 #define SIZEOF_RPLYMAKEDIR 7
1265 #define SIZEOF_CLOSEHANDLE 5
1276 #define SIZEOF_RPLYCLOSEHANDLE 8
1291 #define SIZEOF_BEGINDL 10
1302 #define SIZEOF_RPLYBEGINDL 8
1313 #define SIZEOF_CONTINUEDL 7
1324 #define SIZEOF_RPLYCONTINUEDL 8
1335 #define SIZEOF_WRITEMAILBOX 7
1343 #define SIZEOF_WRITETOMAILBOXPAYLOAD 2
1356 #define SIZEOF_BLUETOOTHPIN 7
1370 #define SIZEOF_RPLYBLUETOOTHPIN 7
1380 #define SIZEOF_BUNDLEID 6
1390 #define SIZEOF_RPLYBUNDLEID 7
1400 #define SIZEOF_BUNDLESEEDID 6
1410 #define SIZEOF_RPLYBUNDLESEEDID 7
1505 char Name[vmFILENAMESIZE];
1589 #if (HARDWARE == SIMULATION)
1591 #define ComInstance (*gComInstance)
void cComOpenMailBox(void)
opMAILBOX_OPEN byte code
SLONG DATA32
VM Type for 4 byte signed value.
UBYTE cComGetBtStatus(void)
void cComReadyMailBox(void)
opMAILBOX_READY byte code
void cComReadMailBox(void)
opMAILBOX_READ byte code
RESULT cComGetDeviceInfo(DATA8 Length, UBYTE *pInfo)
RESULT cComSetDeviceType(DATA8 Layer, DATA8 Port, DATA8 Type, DATA8 Mode)
unsigned int ULONG
Basic Type used to symbolise 32 bit unsigned values.
RESULT cComGetDeviceData(DATA8 Layer, DATA8 Port, DATA8 Length, DATA8 *pType, DATA8 *pMode, DATA8 *pData)
RESULT cComSetDeviceInfo(DATA8 Length, UBYTE *pInfo)
void cComCloseMailBox(void)
opMAILBOX_CLOSE byte code
void cComWriteMailBox(void)
opMAILBOX_WRITE byte code
#define MAILBOX_CONTENT_SIZE
void cComTestMailBox(void)
opMAILBOX_TEST byte code
void cComReady(void)
opCOM_READY byte code
UBYTE cComGetWifiStatus(void)
void cComSet(void)
opCOM_SET byte code
unsigned char UBYTE
Basic Type used to symbolise 8 bit unsigned values.
#define USB_CMD_IN_REP_SIZE
struct dirent ** namelist
COM_GLOBALS * gComInstance
void cComGetBrickName(DATA8 Length, DATA8 *pBrickName)
void cComTxUpdate(UBYTE ChNo)
unsigned short UWORD
Basic Type used to symbolise 16 bit unsigned values.
UBYTE IMGDATA
Image base type.
DATA8 cComGetUsbStatus(void)
ULONG Length
Total down load length.
void cComGet(void)
opCOM_GET byte code
void setComInstance(COM_GLOBALS *_Instance)
SBYTE DATA8
VM Type for 1 byte signed value.
COM_GLOBALS * getComInstance()
void cComTest(void)
opCOM_TEST byte code
void cComWrite(void)
opCOM_WRITE byte code
void cComRead(void)
opCOM_READ byte code