#include <DspFtdiVNC1.h>
Public Types | |
| enum | teReceiveState { INIT, WAIT_PROMPT, WAIT_DATA, WAIT_DATA_PROMPT, IDLE } |
Public Member Functions | |
| tcFtdiParser (tcDspFtdiVNC1 *apVNC1, MBX_Handle ahMbx) | |
| Constructor. | |
| void | ReceiveThread () |
| Receive thread. | |
| void | SetCurrentCommand (tsCommandMbxData *mpData) |
| Set the current command being proccessed by the receive parser. | |
| bool | ParseBuffer (char *apBuffer, int anLength) |
| Parses a buffer received from the FTDI chip. | |
| bool | ParseSectorRead (char *apBuffer, int anLength) |
| Parses a sector read. | |
| void | Reset () |
| bool | SendCommandAndWaitData (tsCommandMbxData &data) |
| Sends a command and waits for the response or a timeout. | |
| int | RxPos () const |
| bool | Enable (bool abEnable) |
| Enables the receive thread. | |
Public Attributes | |
| bool | mbStarted |
Static Public Attributes | |
| static const int | max_msg_size = 1024 |
Protected Attributes | |
| teReceiveState | meRxState |
| char * | mpRxBuffer |
| char * | mpDataStart |
| int | mnExpectedData |
| int | mnDataBytes |
| int | mnRxErrors |
| int | mnRxPos |
| int | mnStatePos |
| bool | mbErrorAllowed |
| MBX_Handle | mhMbx |
| tsCommandMbxData * | mpResponseData |
| tcDspFtdiVNC1 * | mpVNC1 |
| volatile bool | mbEnabled |
| Enable parsing (set to false for debug commands). | |
| tcDspFtdiVNC1::tcFtdiParser::tcFtdiParser | ( | tcDspFtdiVNC1 * | apVNC1, | |
| MBX_Handle | ahMbx | |||
| ) |
Constructor.
| [in] | apVNC1 | pointer to the VNC1L object |
| [in] | ahMbx | pointer to the mailbox object |
| void tcDspFtdiVNC1::tcFtdiParser::ReceiveThread | ( | ) |
Receive thread.
Sends commands from the mailbox and parses the response.
We could drop a command here, but this is only in debug mode anyway ... carpe dium!
| void tcDspFtdiVNC1::tcFtdiParser::SetCurrentCommand | ( | tsCommandMbxData * | apData | ) |
Set the current command being proccessed by the receive parser.
| [in] | apData | pointer to the command data |
| bool tcDspFtdiVNC1::tcFtdiParser::ParseBuffer | ( | char * | apBuffer, | |
| int | anLength | |||
| ) |
Parses a buffer received from the FTDI chip.
| [in] | apBuffer | Buffer to parse |
| [in] | anLength | Length of buffer in bytes |
| bool tcDspFtdiVNC1::tcFtdiParser::ParseSectorRead | ( | char * | apBuffer, | |
| int | anLength | |||
| ) |
Parses a sector read.
| [in] | apBuffer | Buffer to parse, received in response to a sector read |
| [in] | anLength | Length of buffer in bytes |
| void MityDSP::tcDspFtdiVNC1::tcFtdiParser::Reset | ( | ) | [inline] |
| bool tcDspFtdiVNC1::tcFtdiParser::SendCommandAndWaitData | ( | tsCommandMbxData & | arData | ) |
Sends a command and waits for the response or a timeout.
| [in] | arData | pointer to the command data |
| int MityDSP::tcDspFtdiVNC1::tcFtdiParser::RxPos | ( | ) | const [inline] |
| bool tcDspFtdiVNC1::tcFtdiParser::Enable | ( | bool | abEnable | ) |
Enables the receive thread.
| [in] | abEnable | true if parser is enabled |
const int MityDSP::tcDspFtdiVNC1::tcFtdiParser::max_msg_size = 1024 [static] |
char* MityDSP::tcDspFtdiVNC1::tcFtdiParser::mpRxBuffer [protected] |
char* MityDSP::tcDspFtdiVNC1::tcFtdiParser::mpDataStart [protected] |
int MityDSP::tcDspFtdiVNC1::tcFtdiParser::mnExpectedData [protected] |
int MityDSP::tcDspFtdiVNC1::tcFtdiParser::mnDataBytes [protected] |
int MityDSP::tcDspFtdiVNC1::tcFtdiParser::mnRxErrors [protected] |
int MityDSP::tcDspFtdiVNC1::tcFtdiParser::mnRxPos [protected] |
int MityDSP::tcDspFtdiVNC1::tcFtdiParser::mnStatePos [protected] |
bool MityDSP::tcDspFtdiVNC1::tcFtdiParser::mbErrorAllowed [protected] |
MBX_Handle MityDSP::tcDspFtdiVNC1::tcFtdiParser::mhMbx [protected] |
volatile bool MityDSP::tcDspFtdiVNC1::tcFtdiParser::mbEnabled [protected] |
Enable parsing (set to false for debug commands).