The printing of the sensor data has been commented out. Errors in the device handler and controller tasks.
This commit is contained in:
@ -101,25 +101,20 @@ ReturnValue_t ArduinoComIF::initializeInterface(CookieIF *cookie) {
|
||||
|
||||
Cookie->Serial_port_number = serial_port;
|
||||
|
||||
sif::debug<<"\nDEBUG_COMIF: debug0-IF"<<std::endl;
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t ArduinoComIF::sendMessage(CookieIF *cookie,
|
||||
const uint8_t *sendData, size_t sendLen) {
|
||||
sif::debug<<"\nDEBUG_COMIF: debug1-IF"<<std::endl;
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t ArduinoComIF::getSendSuccess(CookieIF *cookie) {
|
||||
sif::debug<<"\nDEBUG_COMIF: debug2-IF"<<std::endl;
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t ArduinoComIF::requestReceiveMessage(CookieIF *cookie,
|
||||
size_t requestLen) {
|
||||
sif::debug<<"\nDEBUG_COMIF: debug3-IF"<<std::endl;
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
@ -134,8 +129,6 @@ ReturnValue_t ArduinoComIF::readReceivedMessage(CookieIF *cookie,
|
||||
// which employ 8 different buffer array.
|
||||
// At the end these 8 arrays are concatenated in
|
||||
// the main buffer array read_buf.
|
||||
|
||||
sif::debug<<"\nDEBUG_COMIF: start of copy received data in the buffer"<<std::endl;
|
||||
|
||||
uint8_t read_buf[2034]; // 2034 bytes from SPC serial output
|
||||
uint8_t read_buf1[255]; // 255 bytes
|
||||
|
@ -82,7 +82,7 @@ ReturnValue_t ArduinoDH::scanForReply(const uint8_t *start, size_t len,
|
||||
/* Unless a command was sent explicitely, we don't expect any replies and ignore
|
||||
the packet. On a real device, there might be replies which are sent without a previous
|
||||
command. */
|
||||
sif::debug<<"\nDEBUG_DH: scan for reply"<<std::endl;
|
||||
//sif::debug<<"DEBUG_DH: scan for reply"<<std::endl;
|
||||
/*if (not commandSent) {
|
||||
sif::debug<<" DH: scan for reply2"<<std::endl;
|
||||
return DeviceHandlerBase::IGNORE_FULL_PACKET;
|
||||
@ -114,7 +114,7 @@ ReturnValue_t ArduinoDH::scanForReply(const uint8_t *start, size_t len,
|
||||
ReturnValue_t ArduinoDH::interpretDeviceReply(DeviceCommandId_t id,
|
||||
const uint8_t *packet) {
|
||||
|
||||
sif::debug<<"\nDEBUG_DH: interprete for reply"<<std::endl;
|
||||
//sif::debug<<"DEBUG_DH: interprete for reply"<<std::endl;
|
||||
// The data stored in the read buffer are here copied in the variables with the SPC format.
|
||||
// After copying, the data of temperature, environment and accelerometer are stored in three separated vectors.
|
||||
|
||||
@ -157,7 +157,7 @@ ReturnValue_t ArduinoDH::interpretDeviceReply(DeviceCommandId_t id,
|
||||
|
||||
// All data are here printed to monitor from the three vectors of data measurements.
|
||||
|
||||
printf(
|
||||
/*printf(
|
||||
"\n***********************************************************************************************\n");
|
||||
printf("TEMPERATURE parameters are: ");
|
||||
|
||||
@ -169,8 +169,8 @@ ReturnValue_t ArduinoDH::interpretDeviceReply(DeviceCommandId_t id,
|
||||
printf("\nTemperature: %f", vecTemp[i].temperature);
|
||||
printf("\nTimestamp: %u", vecTemp[i].Timestamp);
|
||||
printf("\nEnd: %7s", vecTemp[i].end_string);
|
||||
}
|
||||
printf(
|
||||
}*/
|
||||
/*printf(
|
||||
"\n\n***********************************************************************************************\n");
|
||||
printf("ENVIRONMENTAL parameters are: ");
|
||||
|
||||
@ -262,7 +262,7 @@ ReturnValue_t ArduinoDH::interpretDeviceReply(DeviceCommandId_t id,
|
||||
printf("\nEnd: %7s", vecAcc[3 * k + 2].end_string);
|
||||
}
|
||||
|
||||
std::cout << "\n\nEnd reading data.\n" << std::endl;
|
||||
std::cout << "\n\nEnd reading data.\n" << std::endl;*/
|
||||
|
||||
// The data are here written to the data pool where they would be available to be used for other objects
|
||||
|
||||
@ -270,41 +270,49 @@ ReturnValue_t ArduinoDH::interpretDeviceReply(DeviceCommandId_t id,
|
||||
|
||||
PoolVector <float, 36> TempValueVec(datapool::Temperature_value, &ArduinoDataSet, PoolVariableIF::VAR_WRITE);
|
||||
for (int i = 0; i < 36; i++) {
|
||||
memcpy(&TempValueVec, &vecTemp[27 * i + 11], 4);
|
||||
memcpy(&TempValueVec[i], &vecTemp[27 * i + 11], 4);
|
||||
}
|
||||
ArduinoDataSet.commit(PoolVariableIF::VALID);
|
||||
|
||||
/*
|
||||
PoolVector <unsigned int, 36> TempTimeVec(datapool::Temperature_Timestamp, &ArduinoDataSet, PoolVariableIF::VAR_WRITE);
|
||||
for (int i = 0; i < 36; i++) {
|
||||
memcpy(&TempTimeVec, &vecTemp[27 * i + 15], 4);
|
||||
memcpy(&TempTimeVec[i], &vecTemp[27 * i + 15], 4);
|
||||
}
|
||||
ArduinoDataSet.commit(PoolVariableIF::VALID);
|
||||
|
||||
sif::debug<<"\nDEBUG_DHi: End of copy to datapool"<<std::endl;
|
||||
|
||||
PoolVector <float, 9> EnvValueVec(datapool::Environmental_value, &ArduinoDataSet, PoolVariableIF::VAR_WRITE);
|
||||
for (int j = 0; j < 9; j++) {
|
||||
memcpy(&EnvValueVec, &vecEnv[27 * (36 + j) + 11], 4);
|
||||
memcpy(&EnvValueVec[j], &vecEnv[27 * (36 + j) + 11], 4);
|
||||
}
|
||||
ArduinoDataSet.commit(PoolVariableIF::VALID);
|
||||
|
||||
PoolVector <unsigned int, 9> EnvTimeVec(datapool::Environmental_Timestamp, &ArduinoDataSet, PoolVariableIF::VAR_WRITE);
|
||||
for (int j = 0; j < 9; j++) {
|
||||
memcpy(&EnvTimeVec, &vecEnv[27 * (36 + j) + 15], 4);
|
||||
memcpy(&EnvTimeVec[j], &vecEnv[27 * (36 + j) + 15], 4);
|
||||
}
|
||||
ArduinoDataSet.commit(PoolVariableIF::VALID);
|
||||
|
||||
sif::debug<<"\nDEBUG_DHj: End of copy to datapool"<<std::endl;
|
||||
|
||||
PoolVector <float, 15> AccValueVec(datapool::Accelerometer_value, &ArduinoDataSet, PoolVariableIF::VAR_WRITE);
|
||||
for (int k = 0; k < 15; k++) {
|
||||
memcpy(&AccValueVec, &vecAcc[27 * (36 + 9) + 91 * k + 11], 36);
|
||||
memcpy(&AccValueVec[k], &vecAcc[27 * (36 + 9) + 91 * k + 11], 36);
|
||||
sif::debug<<"\nDEBUG_DHk1: End of copy to datapool"<<std::endl;
|
||||
}
|
||||
ArduinoDataSet.commit(PoolVariableIF::VALID);
|
||||
|
||||
PoolVector <unsigned int, 15> AccTimeVec(datapool::Accelerometer_Timestamp, &ArduinoDataSet, PoolVariableIF::VAR_WRITE);
|
||||
for (int k = 0; k < 15; k++) {
|
||||
memcpy(&AccTimeVec, &vecAcc[27 * (36 + 9) + 91 * k + 47], 36);
|
||||
memcpy(&AccTimeVec[k], &vecAcc[27 * (36 + 9) + 91 * k + 47], 36);
|
||||
sif::debug<<"\nDEBUG_DHk2: End of copy to datapool"<<std::endl;
|
||||
}
|
||||
ArduinoDataSet.commit(PoolVariableIF::VALID);
|
||||
*/
|
||||
|
||||
sif::debug<<"\nDEBUG_DH: End of copy to datapool"<<std::endl;
|
||||
//sif::debug<<"DEBUG_DH: End of copy to datapool"<<std::endl;
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user