Errors to be solved in data reading and controller operations.
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
|
||||
|
||||
ArduinoDH::ArduinoDH(object_id_t objectId, object_id_t comIF, CookieIF *cookie) :
|
||||
DeviceHandlerBase(objectId, comIF, cookie) {
|
||||
DeviceHandlerBase(objectId, comIF, cookie)/*, foundId(&bufferId), foundLen(&bufferLen)*/ {
|
||||
mode = _MODE_START_UP;
|
||||
}
|
||||
|
||||
@ -77,7 +77,6 @@ void ArduinoDH::fillCommandAndReplyMap() {
|
||||
|
||||
ReturnValue_t ArduinoDH::scanForReply(const uint8_t *start, size_t len,
|
||||
DeviceCommandId_t *foundId, size_t *foundLen) {
|
||||
//using namespace testdevice;
|
||||
|
||||
/* 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
|
||||
@ -89,25 +88,23 @@ ReturnValue_t ArduinoDH::scanForReply(const uint8_t *start, size_t len,
|
||||
} else {
|
||||
commandSent = false;
|
||||
}*/
|
||||
|
||||
/*len = 2034;
|
||||
start = *buffer;*/
|
||||
|
||||
foundId = &bufferID;
|
||||
foundLen = &len;
|
||||
|
||||
// start character: '['
|
||||
if (*start == 91 ){
|
||||
// buffer length: 2034 bytes
|
||||
if (*foundLen == len){
|
||||
return APERIODIC_REPLY;
|
||||
}
|
||||
else{
|
||||
//foundId = &bufferID;
|
||||
//foundLen = &foundLen;
|
||||
|
||||
*foundLen = 2034;
|
||||
|
||||
// check validity
|
||||
if (len == *foundLen){
|
||||
// start character: '['
|
||||
if (*start == 91 ){
|
||||
return APERIODIC_REPLY;
|
||||
} else{
|
||||
return DeviceHandlerIF::LENGTH_MISSMATCH;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return RETURN_FAILED;
|
||||
} else {
|
||||
return IGNORE_REPLY_DATA;
|
||||
//break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,10 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
DeviceCommandId_t bufferID = 0x01;
|
||||
/*DeviceCommandId_t bufferId = 0x01;
|
||||
size_t bufferLen = 2034;
|
||||
DeviceCommandId_t *foundId;
|
||||
size_t *foundLen;*/
|
||||
|
||||
//testdevice::TestDataSet dataset;
|
||||
//! This is used to reset the dataset after a commanded change has been made.
|
||||
|
Reference in New Issue
Block a user