mirror of
https://github.com/thelsing/knx.git
synced 2025-01-25 00:06:20 +01:00
Add PropertyValueExt* AL services. Handle master reset in AL service RESTART.
This commit is contained in:
parent
2463e6ffaf
commit
780001bd59
@ -467,6 +467,20 @@ void ApplicationLayer::restartRequest(AckType ack, Priority priority, HopCountTy
|
||||
individualSend(ack, hopType, priority, _connectedTsap, apdu, secCtrl);
|
||||
}
|
||||
|
||||
void ApplicationLayer::restartResponse(AckType ack, Priority priority, HopCountType hopType, const SecurityControl& secCtrl, uint8_t errorCode, uint16_t processTime)
|
||||
{
|
||||
CemiFrame frame(3);
|
||||
APDU& apdu = frame.apdu();
|
||||
apdu.type(Restart);
|
||||
uint8_t* data = apdu.data();
|
||||
data[0] |= (1 << 5) | 1; // Set response bit and a restart type of "master reset". Only the master reset sends a response.
|
||||
data[1] = errorCode;
|
||||
data[2] = processTime >> 8;
|
||||
data[3] = processTime & 0xFF;
|
||||
|
||||
individualSend(ack, hopType, priority, _connectedTsap, apdu, secCtrl);
|
||||
}
|
||||
|
||||
//TODO: ApplicationLayer::systemNetworkParameterReadRequest()
|
||||
void ApplicationLayer::systemNetworkParameterReadResponse(Priority priority, HopCountType hopType, const SecurityControl &secCtrl,
|
||||
uint16_t objectType, uint16_t propertyId,
|
||||
@ -549,6 +563,21 @@ void ApplicationLayer::propertyValueReadResponse(AckType ack, Priority priority,
|
||||
startIndex, data, length);
|
||||
}
|
||||
|
||||
void ApplicationLayer::propertyValueExtReadResponse(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl,
|
||||
uint16_t objectType, uint8_t objectInstance, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length)
|
||||
{
|
||||
propertyExtDataSend(PropertyValueExtResponse, ack, priority, hopType, asap, secCtrl, objectType, objectInstance, propertyId, numberOfElements,
|
||||
startIndex, data, length);
|
||||
}
|
||||
|
||||
void ApplicationLayer::propertyValueExtWriteConResponse(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl,
|
||||
uint16_t objectType, uint8_t objectInstance, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t returnCode)
|
||||
{
|
||||
uint8_t noOfElem = (returnCode != ReturnCodes::Success) ? 0 : numberOfElements;
|
||||
propertyExtDataSend(PropertyValueExtWriteConResponse, ack, priority, hopType, asap, secCtrl, objectType, objectInstance, propertyId, noOfElem,
|
||||
startIndex, &returnCode, 1);
|
||||
}
|
||||
|
||||
void ApplicationLayer::propertyValueWriteRequest(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl& secCtrl,
|
||||
uint8_t objectIndex, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t * data, uint8_t length)
|
||||
{
|
||||
@ -761,6 +790,33 @@ void ApplicationLayer::propertyDataSend(ApduType type, AckType ack, Priority pri
|
||||
dataIndividualRequest(ack, hopType, priority, asap, apdu, secCtrl);
|
||||
}
|
||||
|
||||
void ApplicationLayer::propertyExtDataSend(ApduType type, AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl& secCtrl,
|
||||
uint16_t objectType, uint8_t objectInstance, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length)
|
||||
{
|
||||
CemiFrame frame(9 + length);
|
||||
APDU& apdu = frame.apdu();
|
||||
apdu.type(type);
|
||||
uint8_t* apduData = apdu.data();
|
||||
apduData += 1;
|
||||
|
||||
apduData[0] = ((uint16_t)objectType) >> 8;
|
||||
apduData[1] = ((uint16_t)objectType) & 0xFF;
|
||||
apduData[2] = objectInstance >> 4;
|
||||
apduData[3] = ((objectInstance&0x0F) << 4) | (propertyId >> 8);
|
||||
apduData[4] = (propertyId & 0xFF);
|
||||
apduData[5] = numberOfElements;
|
||||
apduData[6] = (startIndex & 0x0FFF)>> 8;
|
||||
apduData[7] = startIndex & 0xFF;
|
||||
|
||||
if (length > 0)
|
||||
memcpy(apduData+8, data, length);
|
||||
|
||||
if (asap == _connectedTsap)
|
||||
dataConnectedRequest(asap, priority, apdu, secCtrl);
|
||||
else
|
||||
dataIndividualRequest(ack, hopType, priority, asap, apdu, secCtrl);
|
||||
}
|
||||
|
||||
void ApplicationLayer::groupValueSend(ApduType type, AckType ack, uint16_t asap, Priority priority, HopCountType hopType, const SecurityControl &secCtrl,
|
||||
uint8_t* data, uint8_t& dataLength)
|
||||
{
|
||||
@ -827,6 +883,11 @@ void ApplicationLayer::individualIndication(HopCountType hopType, Priority prior
|
||||
break;
|
||||
case Restart:
|
||||
{
|
||||
// These reserved bits must be 0
|
||||
uint8_t reservedBits = *data & 0x1e;
|
||||
if (reservedBits != 0)
|
||||
return;
|
||||
|
||||
// handle erase code for factory reset (setting FDSK again as toolkey, etc.)
|
||||
RestartType restartType = (RestartType) (*data & 0x3f);
|
||||
EraseCode eraseCode = EraseCode::Void;
|
||||
@ -865,6 +926,29 @@ void ApplicationLayer::individualIndication(HopCountType hopType, Priority prior
|
||||
startIndex, data + 5, apdu.length() - 5);
|
||||
break;
|
||||
}
|
||||
case PropertyValueExtRead:
|
||||
{
|
||||
ObjectType objectType = (ObjectType)(((data[1] & 0xff) << 8) | (data[2] & 0xff));
|
||||
uint8_t objectInstance = ((data[3] & 0xff) << 4) | ((data[4] & 0xff) >> 4);
|
||||
uint16_t propertyId = ((data[4] & 0xf) << 8) | (data[5] & 0xff);
|
||||
uint8_t numberOfElements = data[6];
|
||||
uint16_t startIndex = ((data[7] & 0xf) << 8) | (data[8] & 0xff);
|
||||
_bau.propertyValueExtReadIndication(priority, hopType, tsap, secCtrl, objectType, objectInstance, propertyId, numberOfElements, startIndex);
|
||||
break;
|
||||
}
|
||||
case PropertyValueExtWriteCon:
|
||||
case PropertyValueExtWriteUnCon:
|
||||
{
|
||||
ObjectType objectType = (ObjectType)(((data[1] & 0xff) << 8) | (data[2] & 0xff));
|
||||
uint8_t objectInstance = ((data[3] & 0xff) << 4) | ((data[4] & 0xff) >> 4);
|
||||
uint16_t propertyId = ((data[4] & 0xf) << 8) | (data[5] & 0xff);
|
||||
uint8_t numberOfElements = data[6];
|
||||
uint16_t startIndex = ((data[7] & 0xf) << 8) | (data[8] & 0xff);
|
||||
bool confirmed = (apdu.type() == PropertyValueExtWriteCon);
|
||||
_bau.propertyValueExtWriteIndication(priority, hopType, tsap, secCtrl, objectType, objectInstance, propertyId, numberOfElements, startIndex,
|
||||
data + 9, apdu.length() - 9, confirmed);
|
||||
break;
|
||||
}
|
||||
case FunctionPropertyCommand:
|
||||
_bau.functionPropertyCommandIndication(priority, hopType, tsap, secCtrl, data[1], data[2], &data[3], apdu.length() - 4); //TODO: check length
|
||||
break;
|
||||
|
@ -100,10 +100,15 @@ class ApplicationLayer
|
||||
void disconnectRequest(Priority priority);
|
||||
bool isConnected();
|
||||
void restartRequest(AckType ack, Priority priority, HopCountType hopType, const SecurityControl& secCtrl);
|
||||
void restartResponse(AckType ack, Priority priority, HopCountType hopType, const SecurityControl& secCtrl, uint8_t errorCode, uint16_t processTime);
|
||||
void propertyValueReadRequest(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl& secCtrl,
|
||||
uint8_t objectIndex, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex);
|
||||
void propertyValueReadResponse(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl& secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length);
|
||||
void propertyValueExtReadResponse(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl,
|
||||
uint16_t objectType, uint8_t objectInstance, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length);
|
||||
void propertyValueExtWriteConResponse(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl,
|
||||
uint16_t objectType, uint8_t objectInstance, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t returnCode);
|
||||
void propertyValueWriteRequest(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl& secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length);
|
||||
void functionPropertyStateResponse(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl,
|
||||
@ -179,6 +184,8 @@ class ApplicationLayer
|
||||
void propertyDataSend(ApduType type, AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl,
|
||||
uint8_t objectIndex, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data,
|
||||
uint8_t length);
|
||||
void propertyExtDataSend(ApduType type, AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl& secCtrl,
|
||||
uint16_t objectType, uint8_t objectInstance, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length);
|
||||
void memorySend(ApduType type, AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl& secCtrl, uint8_t number,
|
||||
uint16_t memoryAddress, uint8_t* memoryData);
|
||||
void userMemorySend(ApduType type, AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl& secCtrl,
|
||||
|
@ -106,6 +106,11 @@ void BusAccessUnit::propertyValueReadIndication(Priority priority, HopCountType
|
||||
{
|
||||
}
|
||||
|
||||
void BusAccessUnit::propertyValueExtReadIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex)
|
||||
{
|
||||
}
|
||||
|
||||
void BusAccessUnit::functionPropertyCommandIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex, uint8_t propertyId, uint8_t* data, uint8_t length)
|
||||
{
|
||||
}
|
||||
@ -138,6 +143,10 @@ void BusAccessUnit::propertyValueWriteIndication(Priority priority, HopCountType
|
||||
{
|
||||
}
|
||||
|
||||
void BusAccessUnit::propertyValueExtWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length, bool confirmed)
|
||||
{
|
||||
}
|
||||
|
||||
void BusAccessUnit::propertyDescriptionReadLocalConfirm(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex, uint8_t propertyId, uint8_t propertyIndex, bool status)
|
||||
{
|
||||
}
|
||||
|
@ -48,6 +48,8 @@ class BusAccessUnit
|
||||
uint8_t objectIndex, uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, bool status);
|
||||
virtual void propertyValueReadIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex);
|
||||
virtual void propertyValueExtReadIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex);
|
||||
virtual void functionPropertyCommandIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length);
|
||||
virtual void functionPropertyStateIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
@ -64,6 +66,8 @@ class BusAccessUnit
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length, bool status);
|
||||
virtual void propertyValueWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length);
|
||||
virtual void propertyValueExtWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length, bool confirmed);
|
||||
virtual void propertyDescriptionReadLocalConfirm(AckType ack, Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl,
|
||||
uint8_t objectIndex, uint8_t propertyId, uint8_t propertyIndex, bool status);
|
||||
virtual void propertyDescriptionReadIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl,
|
||||
|
@ -12,6 +12,7 @@ enum NmReadSerialNumberType
|
||||
};
|
||||
|
||||
static constexpr auto kFunctionPropertyResultBufferMaxSize = 64;
|
||||
static constexpr auto kRestartProcessTime = 3;
|
||||
|
||||
BauSystemB::BauSystemB(Platform& platform): _memory(platform, _deviceObj), _addrTable(_memory),
|
||||
_assocTable(_memory), _groupObjTable(_memory), _appProgram(_memory),
|
||||
@ -158,18 +159,47 @@ bool BauSystemB::configured()
|
||||
return _configured;
|
||||
}
|
||||
|
||||
void BauSystemB::masterReset(EraseCode eraseCode, uint8_t channel)
|
||||
uint8_t BauSystemB::masterReset(EraseCode eraseCode, uint8_t channel)
|
||||
{
|
||||
static constexpr uint8_t successCode = 0x00; // Where does this come from? It is the code for "success".
|
||||
static constexpr uint8_t invalidEraseCode = 0x02; // Where does this come from? It is the error code for "unspported erase code".
|
||||
|
||||
switch (eraseCode)
|
||||
{
|
||||
case EraseCode::ConfimrmedRestart:
|
||||
case EraseCode::ConfirmedRestart:
|
||||
{
|
||||
println("Confirmed restart requested.");
|
||||
break;
|
||||
return successCode;
|
||||
}
|
||||
case EraseCode::ResetAP:
|
||||
{
|
||||
// TODO: increase download counter except for confirmed restart (PID_DOWNLOAD_COUNTER)
|
||||
println("ResetAP requested.");
|
||||
return successCode;
|
||||
}
|
||||
case EraseCode::ResetIA:
|
||||
{
|
||||
// TODO: increase download counter except for confirmed restart (PID_DOWNLOAD_COUNTER)
|
||||
println("ResetAP requested.");
|
||||
return successCode;
|
||||
}
|
||||
case EraseCode::ResetLinks:
|
||||
{
|
||||
// TODO: increase download counter except for confirmed restart (PID_DOWNLOAD_COUNTER)
|
||||
println("ResetLinks requested.");
|
||||
return successCode;
|
||||
}
|
||||
case EraseCode::ResetParam:
|
||||
{
|
||||
// TODO: increase download counter except for confirmed restart (PID_DOWNLOAD_COUNTER)
|
||||
println("ResetParam requested.");
|
||||
return successCode;
|
||||
}
|
||||
case EraseCode::FactoryReset:
|
||||
case EraseCode::FactoryResetWithoutIA:
|
||||
{
|
||||
// TODO: increase download counter except for confirmed restart (PID_DOWNLOAD_COUNTER)
|
||||
|
||||
#ifdef USE_DATASECURE
|
||||
print("Factory reset requested. type: ");
|
||||
println(eraseCode == EraseCode::FactoryReset ? "FactoryReset with IA" : "FactoryReset without IA");
|
||||
@ -177,13 +207,13 @@ void BauSystemB::masterReset(EraseCode eraseCode, uint8_t channel)
|
||||
// and disable security mode
|
||||
_secIfObj.factoryReset();
|
||||
#endif
|
||||
break;
|
||||
return successCode;
|
||||
}
|
||||
default:
|
||||
{
|
||||
print("Unhandled erase code: ");
|
||||
println(eraseCode, HEX);
|
||||
break;
|
||||
return invalidEraseCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -222,12 +252,12 @@ void BauSystemB::restartRequestIndication(Priority priority, HopCountType hopTyp
|
||||
}
|
||||
else if (restartType == RestartType::MasterReset)
|
||||
{
|
||||
masterReset(eraseCode, channel);
|
||||
uint8_t errorCode = masterReset(eraseCode, channel);
|
||||
_appLayer.restartResponse(AckRequested, priority, hopType, secCtrl, errorCode, (errorCode == 0) ? kRestartProcessTime : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
println("Unhandled restart type");
|
||||
return;
|
||||
// Cannot happen as restartType is just one bit
|
||||
}
|
||||
|
||||
// Flush the EEPROM before resetting
|
||||
@ -279,6 +309,23 @@ void BauSystemB::propertyValueWriteIndication(Priority priority, HopCountType ho
|
||||
propertyValueReadIndication(priority, hopType, asap, secCtrl, objectIndex, propertyId, numberOfElements, startIndex);
|
||||
}
|
||||
|
||||
void BauSystemB::propertyValueExtWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length, bool confirmed)
|
||||
{
|
||||
uint8_t returnCode = ReturnCodes::Success;
|
||||
|
||||
InterfaceObject* obj = getInterfaceObject(objectType, objectInstance);
|
||||
if(obj)
|
||||
obj->writeProperty((PropertyID)propertyId, startIndex, data, numberOfElements);
|
||||
else
|
||||
returnCode = ReturnCodes::AddressVoid;
|
||||
|
||||
if (confirmed)
|
||||
{
|
||||
_appLayer.propertyValueExtWriteConResponse(AckRequested, priority, hopType, asap, secCtrl, objectType, objectInstance, propertyId, numberOfElements, startIndex, returnCode);
|
||||
}
|
||||
}
|
||||
|
||||
void BauSystemB::propertyValueReadIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex)
|
||||
{
|
||||
@ -301,7 +348,32 @@ void BauSystemB::propertyValueReadIndication(Priority priority, HopCountType hop
|
||||
size = 0;
|
||||
|
||||
_appLayer.propertyValueReadResponse(AckRequested, priority, hopType, asap, secCtrl, objectIndex, propertyId, elementCount,
|
||||
startIndex, data, size);
|
||||
startIndex, data, size);
|
||||
}
|
||||
|
||||
void BauSystemB::propertyValueExtReadIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex)
|
||||
{
|
||||
uint8_t size = 0;
|
||||
uint8_t elementCount = numberOfElements;
|
||||
InterfaceObject* obj = getInterfaceObject(objectType, objectInstance);
|
||||
if (obj)
|
||||
{
|
||||
uint8_t elementSize = obj->propertySize((PropertyID)propertyId);
|
||||
size = elementSize * numberOfElements;
|
||||
}
|
||||
else
|
||||
elementCount = 0;
|
||||
|
||||
uint8_t data[size];
|
||||
if(obj)
|
||||
obj->readProperty((PropertyID)propertyId, startIndex, elementCount, data);
|
||||
|
||||
if (elementCount == 0)
|
||||
size = 0;
|
||||
|
||||
_appLayer.propertyValueExtReadResponse(AckRequested, priority, hopType, asap, secCtrl, objectType, objectInstance, propertyId, elementCount,
|
||||
startIndex, data, size);
|
||||
}
|
||||
|
||||
void BauSystemB::functionPropertyCommandIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
@ -444,11 +516,12 @@ void BauSystemB::addSaveRestore(SaveRestore* obj)
|
||||
_memory.addSaveRestore(obj);
|
||||
}
|
||||
|
||||
bool BauSystemB::restartRequest(uint16_t asap, const SecurityControl &secCtrl)
|
||||
bool BauSystemB::restartRequest(uint16_t asap, const SecurityControl secCtrl)
|
||||
{
|
||||
if (_appLayer.isConnected())
|
||||
return false;
|
||||
_restartState = Connecting; // order important, has to be set BEFORE connectRequest
|
||||
_restartSecurity = secCtrl;
|
||||
_appLayer.connectRequest(asap, SystemPriority);
|
||||
_appLayer.deviceDescriptorReadRequest(AckRequested, SystemPriority, NetworkLayerParameter, asap, secCtrl, 0);
|
||||
return true;
|
||||
@ -486,7 +559,7 @@ void BauSystemB::nextRestartState()
|
||||
/* connection confirmed, we send restartRequest, but we wait a moment (sending ACK etc)... */
|
||||
if (millis() - _restartDelay > 30)
|
||||
{
|
||||
_appLayer.restartRequest(AckRequested, SystemPriority, NetworkLayerParameter, secCtrl);
|
||||
_appLayer.restartRequest(AckRequested, SystemPriority, NetworkLayerParameter, _restartSecurity);
|
||||
_restartState = Restarted;
|
||||
_restartDelay = millis();
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ class BauSystemB : protected BusAccessUnit
|
||||
void readMemory();
|
||||
void writeMemory();
|
||||
void addSaveRestore(SaveRestore* obj);
|
||||
bool restartRequest(uint16_t asap, const SecurityControl &secCtrl);
|
||||
void masterReset(EraseCode eraseCode, uint8_t channel);
|
||||
bool restartRequest(uint16_t asap, const SecurityControl secCtrl);
|
||||
uint8_t masterReset(EraseCode eraseCode, uint8_t channel);
|
||||
|
||||
void propertyValueRead(ObjectType objectType, uint8_t objectInstance, uint8_t propertyId,
|
||||
uint8_t& numberOfElements, uint16_t startIndex,
|
||||
@ -57,16 +57,20 @@ class BauSystemB : protected BusAccessUnit
|
||||
uint8_t propertyId, uint8_t propertyIndex) override;
|
||||
void propertyValueWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length) override;
|
||||
void propertyValueExtWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length, bool confirmed);
|
||||
void propertyValueReadIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex) override;
|
||||
void propertyValueExtReadIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex) override;
|
||||
void functionPropertyCommandIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length);
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length) override;
|
||||
void functionPropertyStateIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, uint8_t objectIndex,
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length);
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length) override;
|
||||
void functionPropertyExtCommandIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length);
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length) override;
|
||||
void functionPropertyExtStateIndication(Priority priority, HopCountType hopType, uint16_t asap, const SecurityControl &secCtrl, ObjectType objectType, uint8_t objectInstance,
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length);
|
||||
uint8_t propertyId, uint8_t* data, uint8_t length) override;
|
||||
void individualAddressReadIndication(HopCountType hopType, const SecurityControl &secCtrl) override;
|
||||
void individualAddressWriteIndication(HopCountType hopType, const SecurityControl &secCtrl, uint16_t newaddress) override;
|
||||
void individualAddressSerialNumberWriteIndication(Priority priority, HopCountType hopType, const SecurityControl &secCtrl, uint16_t newIndividualAddress,
|
||||
@ -117,5 +121,6 @@ class BauSystemB : protected BusAccessUnit
|
||||
NetworkLayer _netLayer;
|
||||
bool _configured = true;
|
||||
RestartState _restartState = Idle;
|
||||
SecurityControl _restartSecurity;
|
||||
uint32_t _restartDelay = 0;
|
||||
};
|
||||
|
@ -155,6 +155,13 @@ enum ApduType
|
||||
|
||||
// Application Layer Services on Point-to-point Connection-Oriented Communication Mode (mandatory)
|
||||
// Application Layer Services on Point-to-point Connectionless Communication Mode (either optional or mandatory)
|
||||
PropertyValueExtRead = 0x1CC,
|
||||
PropertyValueExtResponse = 0x1CD,
|
||||
PropertyValueExtWriteCon = 0x1CE,
|
||||
PropertyValueExtWriteConResponse = 0x1CF,
|
||||
PropertyValueExtWriteUnCon = 0x1D0,
|
||||
PropertyExtDescriptionRead = 0x1D2,
|
||||
PropertyExtDescriptionResponse = 0x1D3,
|
||||
FunctionPropertyExtCommand = 0x1D4,
|
||||
FunctionPropertyExtState = 0x1D5,
|
||||
FunctionPropertyExtStateResponse = 0x1D6,
|
||||
@ -208,7 +215,7 @@ enum RestartType
|
||||
enum EraseCode
|
||||
{
|
||||
Void = 0x00,
|
||||
ConfimrmedRestart = 0x01,
|
||||
ConfirmedRestart = 0x01,
|
||||
FactoryReset = 0x02,
|
||||
ResetIA = 0x03,
|
||||
ResetAP = 0x04,
|
||||
|
@ -86,6 +86,8 @@ enum PropertyID
|
||||
PID_VERSION = 25,
|
||||
PID_MCB_TABLE = 27,
|
||||
PID_ERROR_CODE = 28,
|
||||
PID_OBJECT_INDEX = 29,
|
||||
PID_DOWNLOAD_COUNTER = 30,
|
||||
|
||||
/** Properties in the Device Object */
|
||||
PID_ROUTING_COUNT = 51,
|
||||
|
Loading…
Reference in New Issue
Block a user