gccDppConsole Test C++ SDK
1.0.0.0
DPP C++ Console Demonstration
|
00001 #pragma once 00002 #include <stdio.h> 00003 #include <string> 00004 #include <cctype> // std::toupper, std::tolower 00005 using namespace std; 00006 #include "DppConst.h" 00007 #include "DP5Protocol.h" 00008 00009 #define LINE_MAX 256 00010 #define DP4_PX4_OLD_CFG_SIZE 64 00011 #define DP5_MAX_CFG_SIZE 512 /// 512 + 8 Bytes (2 SYNC,2 PID,2 LEN,2 CHKSUM) 00012 #define Whitespace "\t\n\v\f\r\0x20" /// $ = Chr$(0) + Chr$(9) + Chr$(10) + Chr$(11) + Chr$(12) + Chr$(13) + Chr$(32) 00013 00014 typedef struct _CONFIG_OPTIONS 00015 { 00016 bool PC5_PRESENT; 00017 int DppType; 00018 string HwCfgDP5Out; 00019 bool SendCoarseFineGain; 00020 00021 } CONFIG_OPTIONS; 00022 00030 class CSendCommand 00031 { 00032 public: 00033 CSendCommand(void); 00034 ~CSendCommand(void); 00036 string MakeUpper(string myString); 00038 bool TestPacketCkSumOK(unsigned char Data[]); 00040 bool DP5_CMD(unsigned char Buffer[], TRANSMIT_PACKET_TYPE XmtCmd); 00042 bool DP5_CMD_Config(unsigned char Buffer[], TRANSMIT_PACKET_TYPE XmtCmd, CONFIG_OPTIONS CfgOptions); 00044 bool DP5_CMD_Data(unsigned char Buffer[], TRANSMIT_PACKET_TYPE XmtCmd, unsigned char DataOut[]); 00046 bool POUT_Buffer(Packet_Out POUT, unsigned char Buffer[]); 00048 string RemWhitespace(string strLine); 00050 string GetDP5CfgStr(string strFilename); 00051 string CreateResTestReadBackCmd(bool bSendCoarseFineGain, int DppType); 00053 string CreateFullReadBackCmd(bool PC5_PRESENT, int DppType); 00054 string CreateFullReadBackCmdMCA8000D(int DppType); 00056 string RemoveCmd(string strCmd, string strCfgData); 00058 string RemoveCmdByDeviceType(string strCfgDataIn, bool PC5_PRESENT, int DppType); 00060 string Remove_MCA8000D_Cmds(string strCfgDataIn, int DppType); 00062 bool CopyAsciiData(unsigned char Data[], string strCfg, long lLen); 00063 }; 00064