LMS 2012
|
#include "c_com.h"
#include "lms2012.h"
#include "c_bt.h"
#include "c_wifi.h"
#include "c_daisy.h"
#include "c_md5.h"
#include "c_i2c.h"
#include "c_output.h"
#include "c_memory.h"
Go to the source code of this file.
Macros | |
#define | USB_CABLE_DETECT_RATE 15000 |
#define | SIZEOFFILESIZE 8 |
Enumerations | |
enum | { FS_IDLE } |
Functions | |
void | setComInstance (COM_GLOBALS *_Instance) |
COM_GLOBALS * | getComInstance () |
UWORD | cComReadBuffer (UBYTE *pBuffer, UWORD Size) |
UWORD | cComWriteBuffer (UBYTE *pBuffer, UWORD Size) |
UBYTE | cComFindMailbox (UBYTE *pName, UBYTE *pNo) |
void | cComSetMusbHdrcMode (void) |
RESULT | cComInit (void) |
RESULT | cComOpen (void) |
RESULT | cComClose (void) |
RESULT | cComExit (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) |
UBYTE | cComCheckUsbCable (void) |
UBYTE | cComDirectCommand (UBYTE *pBuffer, UBYTE *pReply) |
void | cComCloseFileHandle (SLONG *pHandle) |
UBYTE | cComFreeHandle (DATA8 Handle) |
DATA8 | cComGetHandle (char *pName) |
UBYTE | cComGetNxtFile (DIR *pDir, UBYTE *pName) |
void | cComCreateBeginDl (TXBUF *pTxBuf, UBYTE *pName) |
void | cComCreateContinueDl (RXBUF *pRxBuf, TXBUF *pTxBuf) |
void | cComSystemReply (RXBUF *pRxBuf, TXBUF *pTxBuf) |
void | cComGetNameFromScandirList (struct dirent *NameList, char *pBuffer, ULONG *pNameLen, UBYTE *pFolder) |
UBYTE | cComCheckForSpace (char *pFullName, ULONG Size) |
void | cComSystemCommand (RXBUF *pRxBuf, TXBUF *pTxBuf) |
cSystemCommand More... | |
void | cComUpdate (void) |
DATA8 | cComGetUsbStatus (void) |
void | cComTxUpdate (UBYTE ChNo) |
void | cComReady (void) |
opCOM_READY byte code More... | |
void | cComTest (void) |
opCOM_TEST byte code More... | |
void | cComRead (void) |
opCOM_READ byte code More... | |
void | cComWrite (void) |
opCOM_WRITE byte code More... | |
void | cComReadData (void) |
void | cComWriteData (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 | cComWriteFile (void) |
void | cComGet (void) |
opCOM_GET byte code More... | |
void | cComSet (void) |
opCOM_SET byte code More... | |
void | cComRemove (void) |
UBYTE | cComGetBtStatus (void) |
UBYTE | cComGetWifiStatus (void) |
void | cComGetBrickName (DATA8 Length, DATA8 *pBrickName) |
DATA8 | cComGetEvent (void) |
Variables | |
COM_GLOBALS * | gComInstance |
UWORD | UsbConUpdate = 0 |
UBYTE | cComUsbDeviceConnected = FALSE |
cSystemCommand
Direct command -> When received -> if reply required -> ComInstance.ReplyStatus = DIR_CMD_REPLY | ---------—> if no reply required -> ComInstance.ReplyStatus = DIR_CMD_NOREPLY
VM reply to direct command -> if (ComInstance.ReplyStatus = DIR_CMD_REPLY) -> pTxBuf->Writing = 1 (VM always replies, after interp.) ComInstance.ReplyStatus = 0 | --------------—> if (ComInstance.ReplyStatus = DIR_CMD_NOREPLY) -> pTxBuf->Writing = 0 ComInstance.ReplyStatus = 0
System command -> if reply required -> ComInstance.ReplyStatus = SYS_CMD_REPLY -> if (pRxBuf->State = RXFILEDL) -> Do nothing | | | ---------------------—> if (pRxBuf->State != RXFILEDL) -> pTxBuf->Writing = 1 | ComInstance.ReplyStatus = 0 | --------------------—> If reply not req. -> ComInstance.ReplyStatus = SYS_CMD_NOREPLY -> if (pRxBuf->State = RXFILEDL) -> Do nothing | ---------------------—> if (pRxBuf->State != RXFILEDL) -> ComInstance.ReplyStatus = 0
CONTINUE_DOWNLOAD BEGIN_DOWNLOAD —> (Message size <= Buffer size) –> Write bytes to file | –> pRxBuf->State = RXIDLE | | ------------—> (Message size > Buffer Size) –> Write bytes from buffer –> pRxBuf->State = RXFILEDL
Buffer full —> if pRxBuf->State = RXFILEDL –> Yes -> write into buffer | | | ---------------—> if Remainig msg = 0 -> pRxBuf->State = RXIDLE | ---------------—> No -> Interprete as new command
COM_GLOBALS* getComInstance | ( | ) |
void setComInstance | ( | COM_GLOBALS * | _Instance | ) |
COM_GLOBALS* gComInstance |