LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
c_com.h File Reference
#include <sys/types.h>
#include <dirent.h>
#include "lms2012.h"

Go to the source code of this file.

Data Structures

struct  COMCMD
 
struct  COMRPL
 
struct  DIRCMD
 
struct  SYSCMDB
 
struct  SYSCMDBUPL
 
struct  SYSCMDCUPL
 
struct  SYSCMDC
 
struct  BEGIN_LIST
 
struct  RPLY_BEGIN_LIST
 
struct  CONTINUE_LIST
 
struct  RPLY_CONTINUE_LIST
 
struct  BEGIN_GET_FILE
 
struct  RPLY_BEGIN_GET_FILE
 
struct  CONTINUE_GET_FILE
 
struct  RPLY_CONTINUE_GET_FILE
 
struct  BEGIN_READ
 
struct  RPLY_BEGIN_READ
 
struct  CONTINUE_READ
 
struct  RPLY_CONTINUE_READ
 
struct  LIST_HANDLES
 
struct  RPLY_LIST_HANDLES
 
struct  REMOVE_FILE
 
struct  RPLY_REMOVE_FILE
 
struct  MAKE_DIR
 
struct  RPLY_MAKE_DIR
 
struct  CLOSE_HANDLE
 
struct  RPLY_CLOSE_HANDLE
 
struct  BEGIN_DL
 
struct  RPLY_BEGIN_DL
 
struct  CONTINUE_DL
 
struct  RPLY_CONTINUE_DL
 
struct  WRITE_MAILBOX
 
struct  WRITE_MAILBOX_PAYLOAD
 
struct  BLUETOOTH_PIN
 
struct  RPLY_BLUETOOTH_PIN
 
struct  BUNDLE_ID
 
struct  RPLY_BUNDLE_ID
 
struct  BUNDLE_SEED_ID
 
struct  RPLY_BUNDLE_SEED_ID
 
struct  FIL
 
struct  TXBUF
 
struct  RXBUF
 
struct  MAILBOX
 
struct  COM_GLOBALS
 

Macros

#define DIR_CMD_REPLY_WITH_BUSY   0x0F
 
#define DIR_CMD_NO_REPLY_WITH_BUSY   0x8F
 
#define MAX_MSG_SIZE   1024
 
#define NO_OF_MAILBOXES   30
 
#define MAILBOX_CONTENT_SIZE   250
 
#define USB_CMD_IN_REP_SIZE   1024
 
#define USB_CMD_OUT_REP_SIZE   1024
 
#define SIZEOF_BEGINLIST   6
 
#define SIZEOF_RPLYBEGINLIST   12
 
#define SIZEOF_CONTINUELIST   7
 
#define SIZEOF_RPLYCONTINUELIST   8
 
#define SIZEOF_BEGINGETFILE   6
 
#define SIZEOF_RPLYBEGINGETFILE   12
 
#define SIZEOF_CONTINUEGETFILE   7
 
#define SIZEOF_RPLYCONTINUEGETFILE   12
 
#define SIZEOF_BEGINREAD   6
 
#define SIZEOF_RPLYBEGINREAD   12
 
#define SIZEOF_CONTINUEREAD   7
 
#define SIZEOF_RPLYCONTINUEREAD   8
 
#define SIZEOF_LISTHANDLES   4
 
#define SIZEOF_RPLYLISTHANDLES   7
 
#define SIZEOF_REMOVEFILE   4
 
#define SIZEOF_RPLYREMOVEFILE   7
 
#define SIZEOF_MAKEDIR   4
 
#define SIZEOF_RPLYMAKEDIR   7
 
#define SIZEOF_CLOSEHANDLE   5
 
#define SIZEOF_RPLYCLOSEHANDLE   8
 
#define SIZEOF_BEGINDL   10
 
#define SIZEOF_RPLYBEGINDL   8
 
#define SIZEOF_CONTINUEDL   7
 
#define SIZEOF_RPLYCONTINUEDL   8
 
#define SIZEOF_WRITEMAILBOX   7
 
#define SIZEOF_WRITETOMAILBOXPAYLOAD   2
 
#define SIZEOF_BLUETOOTHPIN   7
 
#define SIZEOF_RPLYBLUETOOTHPIN   7
 
#define SIZEOF_BUNDLEID   6
 
#define SIZEOF_RPLYBUNDLEID   7
 
#define SIZEOF_BUNDLESEEDID   6
 
#define SIZEOF_RPLYBUNDLESEEDID   7
 
#define ComInstance   (*gComInstance)
 

Typedefs

typedef UWORD CMDSIZE
 
typedef UWORD MSGCNT
 

Enumerations

enum  {
  USBDEV, USBHOST, BTSLAVE, BTMASTER1,
  BTMASTER2, BTMASTER3, BTMASTER4, BTMASTER5,
  BTMASTER6, BTMASTER7, WIFI, NO_OF_CHS
}
 
enum  {
  TXIDLE, TXFILEUPLOAD, TXGETFILE, TXLISTFILES,
  TXFOLDER, TXFILE, RXIDLE, RXFILEDL
}
 
enum  { SUBSTATE_IDLE, FILE_IN_PROGRESS_WAIT_FOR_REPLY, FILE_COMPLETE_WAIT_FOR_REPLY }
 
enum  { DIR_CMD_REPLY = 0x01, DIR_CMD_NOREPLY = 0x02, SYS_CMD_REPLY = 0x04, SYS_CMD_NOREPLY = 0x08 }
 

Functions

RESULT cComInit (void)
 
RESULT cComOpen (void)
 
RESULT cComClose (void)
 
RESULT cComExit (void)
 
void cComRead (void)
 opCOM_READ byte code More...
 
void cComWrite (void)
 opCOM_WRITE byte code More...
 
void cComGet (void)
 opCOM_GET byte code More...
 
void cComSet (void)
 opCOM_SET byte code More...
 
void cComUpdate (void)
 
void cComTxUpdate (UBYTE ChNo)
 
void cComRemove (void)
 
DATA8 cComGetUsbStatus (void)
 
UBYTE cComGetBtStatus (void)
 
UBYTE cComGetWifiStatus (void)
 
void cComReady (void)
 opCOM_READY byte code More...
 
void cComTest (void)
 opCOM_TEST byte code More...
 
void cComReadData (void)
 
void cComWriteData (void)
 
void cComWriteFile (void)
 
void cComOpenMailBox (void)
 opMAILBOX_OPEN byte code More...
 
void cComWriteMailBox (void)
 opMAILBOX_WRITE byte code More...
 
void cComReadMailBox (void)
 opMAILBOX_READ byte code More...
 
void cComTestMailBox (void)
 opMAILBOX_TEST byte code More...
 
void cComReadyMailBox (void)
 opMAILBOX_READY byte code More...
 
void cComCloseMailBox (void)
 opMAILBOX_CLOSE byte code More...
 
void cComGetBrickName (DATA8 Length, DATA8 *pBrickName)
 
DATA8 cComGetEvent (void)
 
RESULT cComSetDeviceInfo (DATA8 Length, UBYTE *pInfo)
 
RESULT cComGetDeviceInfo (DATA8 Length, UBYTE *pInfo)
 
RESULT cComSetDeviceType (DATA8 Layer, DATA8 Port, DATA8 Type, DATA8 Mode)
 
RESULT cComGetDeviceData (DATA8 Layer, DATA8 Port, DATA8 Length, DATA8 *pType, DATA8 *pMode, DATA8 *pData)
 
void setComInstance (COM_GLOBALS *_Instance)
 
COM_GLOBALSgetComInstance ()
 

Variables

COM_GLOBALSgComInstance
 

Macro Definition Documentation

#define ComInstance   (*gComInstance)

Definition at line 1591 of file c_com.h.

#define DIR_CMD_NO_REPLY_WITH_BUSY   0x8F

Definition at line 933 of file c_com.h.

#define DIR_CMD_REPLY_WITH_BUSY   0x0F

Definition at line 932 of file c_com.h.

#define MAILBOX_CONTENT_SIZE   250

Definition at line 955 of file c_com.h.

#define MAX_MSG_SIZE   1024

Definition at line 953 of file c_com.h.

#define NO_OF_MAILBOXES   30

Definition at line 954 of file c_com.h.

#define SIZEOF_BEGINDL   10

Definition at line 1291 of file c_com.h.

#define SIZEOF_BEGINGETFILE   6

Definition at line 1099 of file c_com.h.

#define SIZEOF_BEGINLIST   6

Definition at line 1046 of file c_com.h.

#define SIZEOF_BEGINREAD   6

Definition at line 1155 of file c_com.h.

#define SIZEOF_BLUETOOTHPIN   7

Definition at line 1356 of file c_com.h.

#define SIZEOF_BUNDLEID   6

Definition at line 1380 of file c_com.h.

#define SIZEOF_BUNDLESEEDID   6

Definition at line 1400 of file c_com.h.

#define SIZEOF_CLOSEHANDLE   5

Definition at line 1265 of file c_com.h.

#define SIZEOF_CONTINUEDL   7

Definition at line 1313 of file c_com.h.

#define SIZEOF_CONTINUEGETFILE   7

Definition at line 1127 of file c_com.h.

#define SIZEOF_CONTINUELIST   7

Definition at line 1074 of file c_com.h.

#define SIZEOF_CONTINUEREAD   7

Definition at line 1183 of file c_com.h.

#define SIZEOF_LISTHANDLES   4

Definition at line 1204 of file c_com.h.

#define SIZEOF_MAKEDIR   4

Definition at line 1245 of file c_com.h.

#define SIZEOF_REMOVEFILE   4

Definition at line 1225 of file c_com.h.

#define SIZEOF_RPLYBEGINDL   8

Definition at line 1302 of file c_com.h.

#define SIZEOF_RPLYBEGINGETFILE   12

Definition at line 1115 of file c_com.h.

#define SIZEOF_RPLYBEGINLIST   12

Definition at line 1062 of file c_com.h.

#define SIZEOF_RPLYBEGINREAD   12

Definition at line 1171 of file c_com.h.

#define SIZEOF_RPLYBLUETOOTHPIN   7

Definition at line 1370 of file c_com.h.

#define SIZEOF_RPLYBUNDLEID   7

Definition at line 1390 of file c_com.h.

#define SIZEOF_RPLYBUNDLESEEDID   7

Definition at line 1410 of file c_com.h.

#define SIZEOF_RPLYCLOSEHANDLE   8

Definition at line 1276 of file c_com.h.

#define SIZEOF_RPLYCONTINUEDL   8

Definition at line 1324 of file c_com.h.

#define SIZEOF_RPLYCONTINUEGETFILE   12

Definition at line 1143 of file c_com.h.

#define SIZEOF_RPLYCONTINUELIST   8

Definition at line 1087 of file c_com.h.

#define SIZEOF_RPLYCONTINUEREAD   8

Definition at line 1195 of file c_com.h.

#define SIZEOF_RPLYLISTHANDLES   7

Definition at line 1215 of file c_com.h.

#define SIZEOF_RPLYMAKEDIR   7

Definition at line 1255 of file c_com.h.

#define SIZEOF_RPLYREMOVEFILE   7

Definition at line 1235 of file c_com.h.

#define SIZEOF_WRITEMAILBOX   7

Definition at line 1335 of file c_com.h.

#define SIZEOF_WRITETOMAILBOXPAYLOAD   2

Definition at line 1343 of file c_com.h.

#define USB_CMD_IN_REP_SIZE   1024

Definition at line 956 of file c_com.h.

#define USB_CMD_OUT_REP_SIZE   1024

Definition at line 957 of file c_com.h.

Typedef Documentation

typedef UWORD CMDSIZE

Definition at line 960 of file c_com.h.

typedef UWORD MSGCNT

Definition at line 961 of file c_com.h.

Enumeration Type Documentation

anonymous enum
Enumerator
USBDEV 
USBHOST 
BTSLAVE 
BTMASTER1 
BTMASTER2 
BTMASTER3 
BTMASTER4 
BTMASTER5 
BTMASTER6 
BTMASTER7 
WIFI 
NO_OF_CHS 

Definition at line 937 of file c_com.h.

anonymous enum
Enumerator
TXIDLE 
TXFILEUPLOAD 
TXGETFILE 
TXLISTFILES 
TXFOLDER 
TXFILE 
RXIDLE 
RXFILEDL 

Definition at line 1414 of file c_com.h.

anonymous enum
Enumerator
SUBSTATE_IDLE 
FILE_IN_PROGRESS_WAIT_FOR_REPLY 
FILE_COMPLETE_WAIT_FOR_REPLY 

Definition at line 1428 of file c_com.h.

anonymous enum
Enumerator
DIR_CMD_REPLY 
DIR_CMD_NOREPLY 
SYS_CMD_REPLY 
SYS_CMD_NOREPLY 

Definition at line 1437 of file c_com.h.

Function Documentation

RESULT cComClose ( void  )

Definition at line 213 of file c_com.c.

void cComCloseMailBox ( void  )

opMAILBOX_CLOSE byte code

Definition at line 3958 of file c_com.c.

RESULT cComExit ( void  )

Definition at line 233 of file c_com.c.

void cComGet ( void  )

opCOM_GET byte code

Definition at line 4208 of file c_com.c.

void cComGetBrickName ( DATA8  Length,
DATA8 pBrickName 
)

Definition at line 5583 of file c_com.c.

UBYTE cComGetBtStatus ( void  )

Definition at line 5557 of file c_com.c.

RESULT cComGetDeviceData ( DATA8  Layer,
DATA8  Port,
DATA8  Length,
DATA8 pType,
DATA8 pMode,
DATA8 pData 
)

Definition at line 268 of file c_com.c.

RESULT cComGetDeviceInfo ( DATA8  Length,
UBYTE pInfo 
)

Definition at line 256 of file c_com.c.

DATA8 cComGetEvent ( void  )

Definition at line 5589 of file c_com.c.

DATA8 cComGetUsbStatus ( void  )

Definition at line 2831 of file c_com.c.

UBYTE cComGetWifiStatus ( void  )

Definition at line 5563 of file c_com.c.

RESULT cComInit ( void  )

Definition at line 104 of file c_com.c.

RESULT cComOpen ( void  )

Definition at line 203 of file c_com.c.

void cComOpenMailBox ( void  )

opMAILBOX_OPEN byte code

Definition at line 3573 of file c_com.c.

void cComRead ( void  )

opCOM_READ byte code

Definition at line 3416 of file c_com.c.

void cComReadData ( void  )

Definition at line 3522 of file c_com.c.

void cComReadMailBox ( void  )

opMAILBOX_READ byte code

Definition at line 3781 of file c_com.c.

void cComReady ( void  )

opCOM_READY byte code

Definition at line 3281 of file c_com.c.

void cComReadyMailBox ( void  )

opMAILBOX_READY byte code

Definition at line 3923 of file c_com.c.

void cComRemove ( void  )

Definition at line 5516 of file c_com.c.

void cComSet ( void  )

opCOM_SET byte code

Definition at line 5045 of file c_com.c.

RESULT cComSetDeviceInfo ( DATA8  Length,
UBYTE pInfo 
)

Definition at line 249 of file c_com.c.

RESULT cComSetDeviceType ( DATA8  Layer,
DATA8  Port,
DATA8  Type,
DATA8  Mode 
)

Definition at line 262 of file c_com.c.

void cComTest ( void  )

opCOM_TEST byte code

Definition at line 3350 of file c_com.c.

void cComTestMailBox ( void  )

opMAILBOX_TEST byte code

Definition at line 3891 of file c_com.c.

void cComTxUpdate ( UBYTE  ChNo)

Definition at line 2837 of file c_com.c.

void cComUpdate ( void  )

Definition at line 2448 of file c_com.c.

void cComWrite ( void  )

opCOM_WRITE byte code

Definition at line 3472 of file c_com.c.

void cComWriteData ( void  )

Definition at line 3536 of file c_com.c.

void cComWriteFile ( void  )

Definition at line 3970 of file c_com.c.

void cComWriteMailBox ( void  )

opMAILBOX_WRITE byte code

Definition at line 3628 of file c_com.c.

COM_GLOBALS* getComInstance ( )

Definition at line 75 of file c_com.c.

void setComInstance ( COM_GLOBALS _Instance)

Definition at line 70 of file c_com.c.

Variable Documentation

COM_GLOBALS* gComInstance

Definition at line 68 of file c_com.c.