I messed up the merge, so pushing it over to another repo so I don't lose it. Will tidy up and remove later
Dependencies: BufferedSerial FatFileSystemCpp mbed
VIPSSerialProtocol.h
- Committer:
- AndyA
- Date:
- 22 months ago
- Revision:
- 84:8094a1e64ecf
- Parent:
- 82:ee6eed2a51bd
File content as of revision 84:8094a1e64ecf:
#ifndef __VIPSSERIALPROTOCOL_H__ #define __VIPSSERIALPROTOCOL_H__ #include "PosSource.h" #include "mbed.h" #include "position.h" #include "BufferedSerial.h" #include "LTCApp.h" extern const char* VIPSStatusMessages[]; struct UserSettings_s; class VIPSSerial : public PosSource { public: VIPSSerial(const PinName Tx, const PinName Rx); virtual void run(void); // VIPS specific Rx/Tx static void getCRC(void *data, int len, void *checksum); virtual void sendQueued(void); virtual void sendDirectTX(unsigned char* data, int dataLen); virtual int getWaitingBuffer(unsigned char **TXBuffer, int *bytesToSend); virtual void sendQuiet(void); private: void onSerialRx(void); void processRxMessage(); bool checkCRC(unsigned char* data); void sendResponse(unsigned char function, unsigned char* data, int dataLen); void queueResponse(unsigned char function, unsigned char* data, int dataLen); void sendAck(unsigned char function); void sendNack(unsigned char function); void sendVBOXTime(); void parsePostionInput_legacy(); void parsePostionInput_mocap(); void onTxTimeout(); bool checkNewPacketRC(unsigned char* data); int messagePrt; int messageLength; int statusMessage; bool newFormatMsg; int queueLen; //VIPSSerial* self; }; #endif