diff --git a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.cpp b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.cpp index 76c1d6a..7d92ce8 100644 --- a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.cpp +++ b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.cpp @@ -69,9 +69,9 @@ ecmcSocketCAN::ecmcSocketCAN(char* configStr, //syncPdo_ = NULL; //heartPdo_ = NULL; //basicConfSdo_ = NULL; - testDevice_ = NULL; - testMaster_ = NULL; - cycleCounter_ = 0; + //testDevice_ = NULL; + //testMaster_ = NULL; + //cycleCounter_ = 0; deviceCounter_ = 0; masterDev_ = NULL; for(int i = 0; iaddSDO(0x583, // 0x580 + CobId - 0x603, // 0x600 + Cobid - DIR_READ, - 0x2640, // Object dictionary index - 0x0, // Object dictionary subindex - 56, - 7000, - "analogValues"); - - //testPdo_ = new ecmcCANOpenPDO( writeBuffer_, 0x183,DIR_READ,8,10000,0,exeSampleTimeMs_, cfgDbgMode_); - testDevice_->addPDO(0x183, - DIR_READ, - 8, - 10000, - 0, - "status"); - - - - testMaster_= new ecmcCANOpenMaster(writeBuffer_,1,exeSampleTimeMs_,1000,1000,1000,"linuxMaster",cfgDbgMode_); + //testDevice_ = new ecmcCANOpenDevice(writeBuffer_,3,exeSampleTimeMs_,"pmu905",cfgDbgMode_); +// + ////testSdo_ = new ecmcCANOpenSDO( writeBuffer_, 0x583,0x603,DIR_READ,0x2640,0,56,7000,exeSampleTimeMs_, cfgDbgMode_); + //testDevice_->addSDO(0x583, // 0x580 + CobId + // 0x603, // 0x600 + Cobid + // DIR_READ, + // 0x2640, // Object dictionary index + // 0x0, // Object dictionary subindex + // 56, + // 7000, + // "analogValues"); +// + ////testPdo_ = new ecmcCANOpenPDO( writeBuffer_, 0x183,DIR_READ,8,10000,0,exeSampleTimeMs_, cfgDbgMode_); + //testDevice_->addPDO(0x183, + // DIR_READ, + // 8, + // 10000, + // 0, + // "status"); +// +// +// + //testMaster_= new ecmcCANOpenMaster(writeBuffer_,1,exeSampleTimeMs_,1000,1000,1000,"linuxMaster",cfgDbgMode_); // Test LSS heartbeat "master" signal. This makes the led on pmu905 to go to "Normal Communication" @@ -283,12 +283,12 @@ void ecmcSocketCAN::doReadWorker() { devices_[i]->newRxFrame(&rxmsg_); } - if(testDevice_) { - testDevice_->newRxFrame(&rxmsg_); - } - if(testMaster_) { - testMaster_->newRxFrame(&rxmsg_); - } +// if(testDevice_) { +// testDevice_->newRxFrame(&rxmsg_); +// } +// if(testMaster_) { +// testMaster_->newRxFrame(&rxmsg_); +// } //if(basicConfSdo_) { // basicConfSdo_->newRxFrame(&rxmsg_); @@ -379,12 +379,12 @@ void ecmcSocketCAN::execute() { // heartPdo_->execute(); // } - if(testMaster_) { - testMaster_->execute(); - } - if(testDevice_) { - testDevice_->execute(); - } +// if(testMaster_) { +// testMaster_->execute(); +// } +// if(testDevice_) { +// testDevice_->execute(); +// } for(int i = 0; i < deviceCounter_; i++){ devices_[i]->execute(); diff --git a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.h b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.h index 05f431f..bfefc05 100644 --- a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.h +++ b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.h @@ -129,12 +129,10 @@ class ecmcSocketCAN { int socketId_; struct sockaddr_can addr_; struct can_frame txmsgBuffer_[ECMC_CAN_MAX_WRITE_CMDS]; - int writeCmdCounter_; - int writeBusy_; - int lastWriteSumError_; + //int writeCmdCounter_; + //int writeBusy_; + //int lastWriteSumError_; int exeSampleTimeMs_; - - int deviceCounter_; ecmcSocketCANWriteBuffer *writeBuffer_; //ecmcCANOpenSDO *testSdo_; @@ -144,12 +142,13 @@ class ecmcSocketCAN { //ecmcCANOpenPDO *heartPdo_; //ecmcCANOpenSDO *basicConfSdo_; - ecmcCANOpenDevice *testDevice_; - ecmcCANOpenMaster *testMaster_; + //ecmcCANOpenDevice *testDevice_; + //ecmcCANOpenMaster *testMaster_; + int deviceCounter_; ecmcCANOpenDevice *devices_[ECMC_CAN_MAX_DEVICES]; ecmcCANOpenMaster *masterDev_; - int cycleCounter_; + //int cycleCounter_; }; #endif /* ECMC_SOCKETCAN_H_ */