From 545123536853398d5e397244830fe0258987d316 Mon Sep 17 00:00:00 2001 From: Dominik Westner Date: Mon, 9 Nov 2020 20:20:21 +0100 Subject: [PATCH] Nikwest (#100) * fixed tipo: RepititionAllowed * fixed typo: frameRecieved * fixed typo: individualAddressDuplication * fixed typo: induvidualAddress * fixded Typo: InduvidualAddress Co-authored-by: Dominik Westner --- examples/knx-linux-coupler/main.cpp | 2 +- examples/knx-linux/main.cpp | 2 +- examples/knx-usb/src/main.cpp | 2 +- src/knx/bau07B0.cpp | 2 +- src/knx/bau_systemB.cpp | 4 +-- src/knx/cemi_frame.cpp | 4 +-- src/knx/cemi_server.cpp | 2 +- src/knx/data_link_layer.cpp | 10 +++--- src/knx/data_link_layer.h | 2 +- src/knx/device_object.cpp | 6 ++-- src/knx/device_object.h | 6 ++-- src/knx/ip_data_link_layer.cpp | 4 +-- src/knx/ip_parameter_object.cpp | 4 +-- src/knx/knx_types.h | 4 +-- src/knx/network_layer_coupler.cpp | 50 ++++++++++++++-------------- src/knx/network_layer_device.cpp | 14 ++++---- src/knx/rf_data_link_layer.cpp | 6 ++-- src/knx/secure_application_layer.cpp | 28 ++++++++-------- src/knx/tpuart_data_link_layer.cpp | 4 +-- src/knx_facade.h | 4 +-- 20 files changed, 80 insertions(+), 80 deletions(-) diff --git a/examples/knx-linux-coupler/main.cpp b/examples/knx-linux-coupler/main.cpp index ac564d2..f8d7082 100644 --- a/examples/knx-linux-coupler/main.cpp +++ b/examples/knx-linux-coupler/main.cpp @@ -51,7 +51,7 @@ void setup() srand((unsigned int)time(NULL)); knx.readMemory(); - if (knx.induvidualAddress() == 0) + if (knx.individualAddress() == 0) knx.progMode(true); if (knx.configured()) diff --git a/examples/knx-linux/main.cpp b/examples/knx-linux/main.cpp index a416220..b48c160 100644 --- a/examples/knx-linux/main.cpp +++ b/examples/knx-linux/main.cpp @@ -97,7 +97,7 @@ void setup() srand((unsigned int)time(NULL)); knx.readMemory(); - if (knx.induvidualAddress() == 0) + if (knx.individualAddress() == 0) knx.progMode(true); if (knx.configured()) diff --git a/examples/knx-usb/src/main.cpp b/examples/knx-usb/src/main.cpp index cb48937..f9c01b7 100644 --- a/examples/knx-usb/src/main.cpp +++ b/examples/knx-usb/src/main.cpp @@ -75,7 +75,7 @@ void setup(void) // read adress table, association table, groupobject table and parameters from eeprom knx.readMemory(); - if (knx.induvidualAddress() == 0) + if (knx.individualAddress() == 0) knx.progMode(true); diff --git a/src/knx/bau07B0.cpp b/src/knx/bau07B0.cpp index 279ee11..2dadc75 100644 --- a/src/knx/bau07B0.cpp +++ b/src/knx/bau07B0.cpp @@ -139,7 +139,7 @@ bool Bau07B0::isAckRequired(uint16_t address, bool isGrpAddr) } // Also ACK for our own individual address - if (address == _deviceObj.induvidualAddress()) + if (address == _deviceObj.individualAddress()) return true; return false; diff --git a/src/knx/bau_systemB.cpp b/src/knx/bau_systemB.cpp index a94cf29..e36656e 100644 --- a/src/knx/bau_systemB.cpp +++ b/src/knx/bau_systemB.cpp @@ -441,7 +441,7 @@ void BauSystemB::individualAddressReadIndication(HopCountType hopType, const Sec void BauSystemB::individualAddressWriteIndication(HopCountType hopType, const SecurityControl &secCtrl, uint16_t newaddress) { if (_deviceObj.progMode()) - _deviceObj.induvidualAddress(newaddress); + _deviceObj.individualAddress(newaddress); } void BauSystemB::individualAddressSerialNumberWriteIndication(Priority priority, HopCountType hopType, const SecurityControl &secCtrl, uint16_t newIndividualAddress, @@ -450,7 +450,7 @@ void BauSystemB::individualAddressSerialNumberWriteIndication(Priority priority, // If the received serial number matches our serial number // then store the received new individual address in the device object if (!memcmp(knxSerialNumber, _deviceObj.propertyData(PID_SERIAL_NUMBER), 6)) - _deviceObj.induvidualAddress(newIndividualAddress); + _deviceObj.individualAddress(newIndividualAddress); } void BauSystemB::individualAddressSerialNumberReadIndication(Priority priority, HopCountType hopType, const SecurityControl &secCtrl, uint8_t* knxSerialNumber) diff --git a/src/knx/cemi_frame.cpp b/src/knx/cemi_frame.cpp index 7e0d31a..b58b1f2 100644 --- a/src/knx/cemi_frame.cpp +++ b/src/knx/cemi_frame.cpp @@ -219,12 +219,12 @@ void CemiFrame::frameType(FrameFormat type) Repetition CemiFrame::repetition() const { - return (Repetition)(_ctrl1[0] & RepititionAllowed); + return (Repetition)(_ctrl1[0] & RepetitionAllowed); } void CemiFrame::repetition(Repetition rep) { - _ctrl1[0] &= ~RepititionAllowed; + _ctrl1[0] &= ~RepetitionAllowed; _ctrl1[0] |= rep; } diff --git a/src/knx/cemi_server.cpp b/src/knx/cemi_server.cpp index bd9a8b3..983d6dc 100644 --- a/src/knx/cemi_server.cpp +++ b/src/knx/cemi_server.cpp @@ -18,7 +18,7 @@ CemiServer::CemiServer(BauSystemB& bau) { // The cEMI server will hand out the device address + 1 to the cEMI client (e.g. ETS), // so that the device and the cEMI client/server connection(tunnel) can operate simultaneously. - _clientAddress = _bau.deviceObject().induvidualAddress() + 1; + _clientAddress = _bau.deviceObject().individualAddress() + 1; } void CemiServer::dataLinkLayer(DataLinkLayer& layer) diff --git a/src/knx/data_link_layer.cpp b/src/knx/data_link_layer.cpp index 3412e61..b75c1ec 100644 --- a/src/knx/data_link_layer.cpp +++ b/src/knx/data_link_layer.cpp @@ -25,7 +25,7 @@ void DataLinkLayer::dataRequestFromTunnel(CemiFrame& frame) frame.messageCode(L_data_ind); // Send to local stack - frameRecieved(frame); + frameReceived(frame); // Send to KNX medium sendFrame(frame); @@ -82,7 +82,7 @@ void DataLinkLayer::dataConReceived(CemiFrame& frame, bool success) frame.messageCode(backupMsgCode); } -void DataLinkLayer::frameRecieved(CemiFrame& frame) +void DataLinkLayer::frameReceived(CemiFrame& frame) { AckType ack = frame.ack(); AddressType addrType = frame.addressType(); @@ -91,7 +91,7 @@ void DataLinkLayer::frameRecieved(CemiFrame& frame) FrameFormat type = frame.frameType(); Priority priority = frame.priority(); NPDU& npdu = frame.npdu(); - uint16_t ownAddr = _deviceObject.induvidualAddress(); + uint16_t ownAddr = _deviceObject.individualAddress(); SystemBroadcast systemBroadcast = frame.systemBroadcast(); #ifdef USE_CEMI_SERVER @@ -103,7 +103,7 @@ void DataLinkLayer::frameRecieved(CemiFrame& frame) #endif if (source == ownAddr) - _deviceObject.induvidualAddressDuplication(true); + _deviceObject.individualAddressDuplication(true); if (addrType == GroupAddress && destination == 0) { @@ -126,7 +126,7 @@ bool DataLinkLayer::sendTelegram(NPDU & npdu, AckType ack, uint16_t destinationA frame.sourceAddress(sourceAddr); frame.addressType(addrType); frame.priority(priority); - frame.repetition(RepititionAllowed); + frame.repetition(RepetitionAllowed); frame.systemBroadcast(systemBroadcast); if (npdu.octetCount() <= 15) diff --git a/src/knx/data_link_layer.h b/src/knx/data_link_layer.h index 3fbaa1e..9e4d688 100644 --- a/src/knx/data_link_layer.h +++ b/src/knx/data_link_layer.h @@ -32,7 +32,7 @@ class DataLinkLayer virtual DptMedium mediumType() const = 0; protected: - void frameRecieved(CemiFrame& frame); + void frameReceived(CemiFrame& frame); void dataConReceived(CemiFrame& frame, bool success); bool sendTelegram(NPDU& npdu, AckType ack, uint16_t destinationAddr, AddressType addrType, uint16_t sourceAddr, FrameFormat format, Priority priority, SystemBroadcast systemBroadcast); virtual bool sendFrame(CemiFrame& frame) = 0; diff --git a/src/knx/device_object.cpp b/src/knx/device_object.cpp index d62e672..a58a561 100644 --- a/src/knx/device_object.cpp +++ b/src/knx/device_object.cpp @@ -113,12 +113,12 @@ uint16_t DeviceObject::saveSize() return 2 + InterfaceObject::saveSize(); } -uint16_t DeviceObject::induvidualAddress() +uint16_t DeviceObject::individualAddress() { return _ownAddress; } -void DeviceObject::induvidualAddress(uint16_t value) +void DeviceObject::individualAddress(uint16_t value) { _ownAddress = value; } @@ -129,7 +129,7 @@ void DeviceObject::induvidualAddress(uint16_t value) #define SAFE_STATE 0x8 -void DeviceObject::induvidualAddressDuplication(bool value) +void DeviceObject::individualAddressDuplication(bool value) { Property* prop = property(PID_DEVICE_CONTROL); uint8_t data; diff --git a/src/knx/device_object.h b/src/knx/device_object.h index 12e6c8a..092fdfd 100644 --- a/src/knx/device_object.h +++ b/src/knx/device_object.h @@ -12,10 +12,10 @@ public: const uint8_t* restore(const uint8_t* buffer) override; uint16_t saveSize() override; - uint16_t induvidualAddress(); - void induvidualAddress(uint16_t value); + uint16_t individualAddress(); + void individualAddress(uint16_t value); - void induvidualAddressDuplication(bool value); + void individualAddressDuplication(bool value); bool verifyMode(); void verifyMode(bool value); bool progMode(); diff --git a/src/knx/ip_data_link_layer.cpp b/src/knx/ip_data_link_layer.cpp index 9954356..d599187 100644 --- a/src/knx/ip_data_link_layer.cpp +++ b/src/knx/ip_data_link_layer.cpp @@ -58,7 +58,7 @@ void IpDataLinkLayer::loop() case RoutingIndication: { KnxIpRoutingIndication routingIndication(buffer, len); - frameRecieved(routingIndication.frame()); + frameReceived(routingIndication.frame()); break; } case SearchRequest: @@ -79,7 +79,7 @@ void IpDataLinkLayer::loop() void IpDataLinkLayer::enabled(bool value) { // _print("own address: "); -// _println(_deviceObject.induvidualAddress()); +// _println(_deviceObject.individualAddress()); if (value && !_enabled) { _platform.setupMultiCast(_ipParameters.propertyValue(PID_ROUTING_MULTICAST_ADDRESS), KNXIP_MULTICAST_PORT); diff --git a/src/knx/ip_parameter_object.cpp b/src/knx/ip_parameter_object.cpp index 8366faf..d894dab 100644 --- a/src/knx/ip_parameter_object.cpp +++ b/src/knx/ip_parameter_object.cpp @@ -26,12 +26,12 @@ IpParameterObject::IpParameterObject(DeviceObject& deviceObject, Platform& platf return 1; } // TODO: get property of deviceobject and use it - pushWord(io->_deviceObject.induvidualAddress(), data); + pushWord(io->_deviceObject.individualAddress(), data); return 1; }, [](IpParameterObject* io, uint16_t start, uint8_t count, const uint8_t* data) -> uint8_t { - io->_deviceObject.induvidualAddress(getWord(data)); + io->_deviceObject.individualAddress(getWord(data)); return 1; }), new DataProperty(PID_IP_ASSIGNMENT_METHOD, true, PDT_UNSIGNED_CHAR, 1, ReadLv3 | WriteLv3), diff --git a/src/knx/knx_types.h b/src/knx/knx_types.h index 3f8b291..8a5ca15 100644 --- a/src/knx/knx_types.h +++ b/src/knx/knx_types.h @@ -22,7 +22,7 @@ enum AckType enum AddressType { - InduvidualAddress = 0, + IndividualAddress = 0, GroupAddress = 0x80, }; @@ -95,7 +95,7 @@ enum Repetition { NoRepitiion = 0, WasRepeated = 0, - RepititionAllowed = 0x20, + RepetitionAllowed = 0x20, WasNotRepeated = 0x20, }; diff --git a/src/knx/network_layer_coupler.cpp b/src/knx/network_layer_coupler.cpp index 968f499..038d455 100644 --- a/src/knx/network_layer_coupler.cpp +++ b/src/knx/network_layer_coupler.cpp @@ -10,7 +10,7 @@ NetworkLayerCoupler::NetworkLayerCoupler(DeviceObject &deviceObj, NetworkLayer(deviceObj, layer), _netLayerEntities { {*this, kPrimaryIfIndex}, {*this, kSecondaryIfIndex} } { - _currentAddress = deviceObj.induvidualAddress(); + _currentAddress = deviceObj.individualAddress(); evaluateCouplerType(); } @@ -43,11 +43,11 @@ void NetworkLayerCoupler::rtObjSecondary(RouterObject& rtObjSecondary) void NetworkLayerCoupler::evaluateCouplerType() { // Check coupler mode - if ((_deviceObj.induvidualAddress() & 0x00FF) == 0x00) + if ((_deviceObj.individualAddress() & 0x00FF) == 0x00) { // Device is a router // Check if line coupler or backbone coupler - if ((_deviceObj.induvidualAddress() & 0x0F00) == 0x0) + if ((_deviceObj.individualAddress() & 0x0F00) == 0x0) { // Device is a backbone coupler -> individual address: x.0.0 _couplerType = BackboneCoupler; @@ -99,7 +99,7 @@ bool NetworkLayerCoupler::isRoutedIndividualAddress(uint16_t individualAddress) // too. A typical use case is the protection of a Subnetwork that is located outside a building) // Also ACK for our own individual address - if (individualAddress == _deviceObj.induvidualAddress()) + if (individualAddress == _deviceObj.individualAddress()) return true; // use 2 for now @@ -158,7 +158,7 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, { // TODO: improve: we have to be notified about anything that might affect routing decision // Ugly: we could ALWAYS evaluate coupler type for every received frame - if (_currentAddress != _deviceObj.induvidualAddress()) + if (_currentAddress != _deviceObj.individualAddress()) { evaluateCouplerType(); } @@ -172,8 +172,8 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, * Z high nibble of high order octet of the Destination Address, i.e. Area Address * ZS high order octet of the Destination Address, i.e. hierarchy information part: Area Address + Line Address */ - uint16_t ownSNA = _deviceObj.induvidualAddress() & 0xFF00; // Own subnetwork address (area + line) - uint16_t ownAA = _deviceObj.induvidualAddress() & 0xF000; // Own area address + uint16_t ownSNA = _deviceObj.individualAddress() & 0xFF00; // Own subnetwork address (area + line) + uint16_t ownAA = _deviceObj.individualAddress() & 0xF000; // Own area address uint16_t ZS = destination & 0xFF00; // destination subnetwork address (area + line) uint16_t Z = destination & 0xF000; // destination area address uint16_t D = destination & 0x00FF; // destination device address (without subnetwork part) @@ -198,7 +198,7 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, } else { // ROUTE_XXX - sendMsgHopCount(ack, AddressType::InduvidualAddress, destination, npdu, priority, Broadcast, srcIfIndex, source); + sendMsgHopCount(ack, AddressType::IndividualAddress, destination, npdu, priority, Broadcast, srcIfIndex, source); } return; } @@ -209,7 +209,7 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, if (ZS != ownSNA) { // ROUTE_XXX - sendMsgHopCount(ack, AddressType::InduvidualAddress, destination, npdu, priority, Broadcast, srcIfIndex, source); + sendMsgHopCount(ack, AddressType::IndividualAddress, destination, npdu, priority, Broadcast, srcIfIndex, source); } else if (D == 0) { @@ -229,7 +229,7 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, { // if destination is not within our subnet then send via primary interface, else via secondary interface uint8_t destIfidx = (ZS != ownSNA) ? kPrimaryIfIndex : kSecondaryIfIndex; - _netLayerEntities[destIfidx].sendDataRequest(npdu, ack, destination, source, priority, AddressType::InduvidualAddress, Broadcast); + _netLayerEntities[destIfidx].sendDataRequest(npdu, ack, destination, source, priority, AddressType::IndividualAddress, Broadcast); return; } } @@ -254,7 +254,7 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, else { // ROUTE_XXX - sendMsgHopCount(ack, AddressType::InduvidualAddress, destination, npdu, priority, Broadcast, srcIfIndex, source); + sendMsgHopCount(ack, AddressType::IndividualAddress, destination, npdu, priority, Broadcast, srcIfIndex, source); } return; } @@ -265,7 +265,7 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, if (Z != ownAA) { // ROUTE_XXX - sendMsgHopCount(ack, AddressType::InduvidualAddress, destination, npdu, priority, Broadcast, srcIfIndex, source); + sendMsgHopCount(ack, AddressType::IndividualAddress, destination, npdu, priority, Broadcast, srcIfIndex, source); } else if(SD == 0) { @@ -285,7 +285,7 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, { // if destination is not within our area then send via primary interface, else via secondary interface uint8_t destIfidx = (Z != ownAA) ? kPrimaryIfIndex : kSecondaryIfIndex; - _netLayerEntities[destIfidx].sendDataRequest(npdu, ack, destination, source, priority, AddressType::InduvidualAddress, Broadcast); + _netLayerEntities[destIfidx].sendDataRequest(npdu, ack, destination, source, priority, AddressType::IndividualAddress, Broadcast); return; } } @@ -294,7 +294,7 @@ void NetworkLayerCoupler::routeDataIndividual(AckType ack, uint16_t destination, void NetworkLayerCoupler::dataIndication(AckType ack, AddressType addrType, uint16_t destination, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source, uint8_t srcIfIdx) { // routing for individual addresses - if (addrType == InduvidualAddress) + if (addrType == IndividualAddress) { routeDataIndividual(ack, destination, npdu, priority, source, srcIfIdx); return; @@ -324,9 +324,9 @@ void NetworkLayerCoupler::dataConfirm(AckType ack, AddressType addrType, uint16_ HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter; // Check if received frame is an echo from our sent frame, we are a normal device in this case - if (source == _deviceObj.induvidualAddress()) + if (source == _deviceObj.individualAddress()) { - if (addrType == InduvidualAddress) + if (addrType == IndividualAddress) { _transportLayer.dataIndividualConfirm(ack, destination, hopType, priority, npdu.tpdu(), status); return; @@ -365,7 +365,7 @@ void NetworkLayerCoupler::broadcastConfirm(AckType ack, FrameFormat format, Prio HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter; // Check if received frame is an echo from our sent frame, we are a normal device in this case - if (source == _deviceObj.induvidualAddress()) + if (source == _deviceObj.individualAddress()) { _transportLayer.dataBroadcastConfirm(ack, hopType, priority, npdu.tpdu(), status); } @@ -386,7 +386,7 @@ void NetworkLayerCoupler::systemBroadcastIndication(AckType ack, FrameFormat for void NetworkLayerCoupler::systemBroadcastConfirm(AckType ack, FrameFormat format, Priority priority, uint16_t source, NPDU& npdu, bool status, uint8_t srcIfIdx) { // Check if received frame is an echo from our sent frame, we are a normal device in this case - if (source == _deviceObj.induvidualAddress()) + if (source == _deviceObj.individualAddress()) { HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter; _transportLayer.dataSystemBroadcastConfirm(ack, hopType, npdu.tpdu(), priority, status); @@ -408,7 +408,7 @@ void NetworkLayerCoupler::dataIndividualRequest(AckType ack, uint16_t destinatio // print.print("-> NL "); // tpdu.apdu().printPDU(); //} - routeDataIndividual(ack, destination, npdu, priority, _deviceObj.induvidualAddress(), kLocalIfIndex); + routeDataIndividual(ack, destination, npdu, priority, _deviceObj.individualAddress(), kLocalIfIndex); } void NetworkLayerCoupler::dataGroupRequest(AckType ack, uint16_t destination, HopCountType hopType, Priority priority, TPDU& tpdu) @@ -423,10 +423,10 @@ void NetworkLayerCoupler::dataGroupRequest(AckType ack, uint16_t destination, Ho // If the group address is in the filter table, then we route it to the primary side too if (isGroupAddressInFilterTable(destination)) { - _netLayerEntities[kPrimaryIfIndex].sendDataRequest(npdu, ack, destination, _deviceObj.induvidualAddress(), priority, GroupAddress, Broadcast); + _netLayerEntities[kPrimaryIfIndex].sendDataRequest(npdu, ack, destination, _deviceObj.individualAddress(), priority, GroupAddress, Broadcast); } // We send it to our sub line in any case - _netLayerEntities[kSecondaryIfIndex].sendDataRequest(npdu, ack, destination, _deviceObj.induvidualAddress(), priority, GroupAddress, Broadcast); + _netLayerEntities[kSecondaryIfIndex].sendDataRequest(npdu, ack, destination, _deviceObj.individualAddress(), priority, GroupAddress, Broadcast); } void NetworkLayerCoupler::dataBroadcastRequest(AckType ack, HopCountType hopType, Priority priority, TPDU& tpdu) @@ -438,8 +438,8 @@ void NetworkLayerCoupler::dataBroadcastRequest(AckType ack, HopCountType hopType else npdu.hopCount(hopCount()); - _netLayerEntities[kPrimaryIfIndex].sendDataRequest(npdu, ack, 0, _deviceObj.induvidualAddress(), priority, GroupAddress, Broadcast); - _netLayerEntities[kSecondaryIfIndex].sendDataRequest(npdu, ack, 0, _deviceObj.induvidualAddress(), priority, GroupAddress, Broadcast); + _netLayerEntities[kPrimaryIfIndex].sendDataRequest(npdu, ack, 0, _deviceObj.individualAddress(), priority, GroupAddress, Broadcast); + _netLayerEntities[kSecondaryIfIndex].sendDataRequest(npdu, ack, 0, _deviceObj.individualAddress(), priority, GroupAddress, Broadcast); } void NetworkLayerCoupler::dataSystemBroadcastRequest(AckType ack, HopCountType hopType, Priority priority, TPDU& tpdu) @@ -451,6 +451,6 @@ void NetworkLayerCoupler::dataSystemBroadcastRequest(AckType ack, HopCountType h else npdu.hopCount(hopCount()); - _netLayerEntities[kPrimaryIfIndex].sendDataRequest(npdu, ack, 0, _deviceObj.induvidualAddress(), priority, GroupAddress, SysBroadcast); - _netLayerEntities[kSecondaryIfIndex].sendDataRequest(npdu, ack, 0, _deviceObj.induvidualAddress(), priority, GroupAddress, SysBroadcast); + _netLayerEntities[kPrimaryIfIndex].sendDataRequest(npdu, ack, 0, _deviceObj.individualAddress(), priority, GroupAddress, SysBroadcast); + _netLayerEntities[kSecondaryIfIndex].sendDataRequest(npdu, ack, 0, _deviceObj.individualAddress(), priority, GroupAddress, SysBroadcast); } diff --git a/src/knx/network_layer_device.cpp b/src/knx/network_layer_device.cpp index 704daac..53e6266 100644 --- a/src/knx/network_layer_device.cpp +++ b/src/knx/network_layer_device.cpp @@ -29,7 +29,7 @@ void NetworkLayerDevice::dataIndividualRequest(AckType ack, uint16_t destination // print.print("-> NL "); // tpdu.apdu().printPDU(); //} - _netLayerEntities[kInterfaceIndex].sendDataRequest(npdu, ack, destination, _deviceObj.induvidualAddress(), priority, InduvidualAddress, Broadcast); + _netLayerEntities[kInterfaceIndex].sendDataRequest(npdu, ack, destination, _deviceObj.individualAddress(), priority, IndividualAddress, Broadcast); } void NetworkLayerDevice::dataGroupRequest(AckType ack, uint16_t destination, HopCountType hopType, Priority priority, TPDU& tpdu) @@ -41,7 +41,7 @@ void NetworkLayerDevice::dataGroupRequest(AckType ack, uint16_t destination, Hop else npdu.hopCount(hopCount()); - _netLayerEntities[kInterfaceIndex].sendDataRequest(npdu, ack, destination, _deviceObj.induvidualAddress(), priority, GroupAddress, Broadcast); + _netLayerEntities[kInterfaceIndex].sendDataRequest(npdu, ack, destination, _deviceObj.individualAddress(), priority, GroupAddress, Broadcast); } void NetworkLayerDevice::dataBroadcastRequest(AckType ack, HopCountType hopType, Priority priority, TPDU& tpdu) @@ -53,7 +53,7 @@ void NetworkLayerDevice::dataBroadcastRequest(AckType ack, HopCountType hopType, else npdu.hopCount(hopCount()); - _netLayerEntities[kInterfaceIndex].sendDataRequest(npdu, ack, 0, _deviceObj.induvidualAddress(), priority, GroupAddress, Broadcast); + _netLayerEntities[kInterfaceIndex].sendDataRequest(npdu, ack, 0, _deviceObj.individualAddress(), priority, GroupAddress, Broadcast); } void NetworkLayerDevice::dataSystemBroadcastRequest(AckType ack, HopCountType hopType, Priority priority, TPDU& tpdu) @@ -69,16 +69,16 @@ void NetworkLayerDevice::dataSystemBroadcastRequest(AckType ack, HopCountType ho else npdu.hopCount(hopCount()); - _netLayerEntities[kInterfaceIndex].sendDataRequest(npdu, ack, 0, _deviceObj.induvidualAddress(), priority, GroupAddress, broadcastType); + _netLayerEntities[kInterfaceIndex].sendDataRequest(npdu, ack, 0, _deviceObj.individualAddress(), priority, GroupAddress, broadcastType); } void NetworkLayerDevice::dataIndication(AckType ack, AddressType addrType, uint16_t destination, FrameFormat format, NPDU& npdu, Priority priority, uint16_t source, uint8_t srcIfIdx) { HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter; - if (addrType == InduvidualAddress) + if (addrType == IndividualAddress) { - if (destination != _deviceObj.induvidualAddress()) + if (destination != _deviceObj.individualAddress()) return; _transportLayer.dataIndividualIndication(destination, hopType, priority, source, npdu.tpdu()); @@ -96,7 +96,7 @@ void NetworkLayerDevice::dataIndication(AckType ack, AddressType addrType, uint1 void NetworkLayerDevice::dataConfirm(AckType ack, AddressType addressType, uint16_t destination, FrameFormat format, Priority priority, uint16_t source, NPDU& npdu, bool status, uint8_t srcIfIdx) { HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter; - if (addressType == InduvidualAddress) + if (addressType == IndividualAddress) { _transportLayer.dataIndividualConfirm(ack, destination, hopType, priority, npdu.tpdu(), status); return; diff --git a/src/knx/rf_data_link_layer.cpp b/src/knx/rf_data_link_layer.cpp index fb3b3be..7dedd8f 100644 --- a/src/knx/rf_data_link_layer.cpp +++ b/src/knx/rf_data_link_layer.cpp @@ -187,7 +187,7 @@ void RfDataLinkLayer::frameBytesReceived(uint8_t* rfPacketBuf, uint16_t length) // Get data link layer frame number (LFN field) from L/NPCI.LFN (bit 3..1) uint8_t lfn = (_buffer[8] & 0x0E) >> 1; // Get address type from L/NPCI.LFN (bit 7) - AddressType addressType = (_buffer[8] & 0x80) ? GroupAddress:InduvidualAddress; + AddressType addressType = (_buffer[8] & 0x80) ? GroupAddress:IndividualAddress; // Get routing counter from L/NPCI.LFN (bit 6..4) and map to hop count in Ctrl2.b6-4 uint8_t hopCount = (_buffer[8] & 0x70) >> 4; // Get AddrExtensionType from L/NPCI.LFN (bit 7) and map to system broadcast flag in Ctrl1.b4 @@ -233,7 +233,7 @@ void RfDataLinkLayer::frameBytesReceived(uint8_t* rfPacketBuf, uint16_t length) print(" data: "); printHex(" data: ", _buffer, newLength); */ - frameRecieved(frame); + frameReceived(frame); } } } @@ -246,7 +246,7 @@ void RfDataLinkLayer::enabled(bool value) { _enabled = true; print("ownaddr "); - println(_deviceObject.induvidualAddress(), HEX); + println(_deviceObject.individualAddress(), HEX); } else { diff --git a/src/knx/secure_application_layer.cpp b/src/knx/secure_application_layer.cpp index 69bad03..d1ecdcf 100644 --- a/src/knx/secure_application_layer.cpp +++ b/src/knx/secure_application_layer.cpp @@ -307,7 +307,7 @@ void SecureApplicationLayer::dataGroupRequest(AckType ack, HopCountType hopType, if (secCtrl.dataSecurity != DataSecurity::none) { - apdu.frame().sourceAddress(_deviceObj.induvidualAddress()); + apdu.frame().sourceAddress(_deviceObj.individualAddress()); apdu.frame().destinationAddress(_addrTab->getGroupAddress(tsap)); apdu.frame().addressType(GroupAddress); @@ -330,7 +330,7 @@ void SecureApplicationLayer::dataBroadcastRequest(AckType ack, HopCountType hopT if (secCtrl.dataSecurity != DataSecurity::none) { - apdu.frame().sourceAddress(_deviceObj.induvidualAddress()); + apdu.frame().sourceAddress(_deviceObj.individualAddress()); apdu.frame().destinationAddress(0x0000); apdu.frame().addressType(GroupAddress); apdu.frame().systemBroadcast(Broadcast); @@ -354,7 +354,7 @@ void SecureApplicationLayer::dataSystemBroadcastRequest(AckType ack, HopCountTyp if (secCtrl.dataSecurity != DataSecurity::none) { - apdu.frame().sourceAddress(_deviceObj.induvidualAddress()); + apdu.frame().sourceAddress(_deviceObj.individualAddress()); apdu.frame().destinationAddress(0x0000); apdu.frame().addressType(GroupAddress); apdu.frame().systemBroadcast(SysBroadcast); @@ -378,9 +378,9 @@ void SecureApplicationLayer::dataIndividualRequest(AckType ack, HopCountType hop if (secCtrl.dataSecurity != DataSecurity::none) { - apdu.frame().sourceAddress(_deviceObj.induvidualAddress()); + apdu.frame().sourceAddress(_deviceObj.individualAddress()); apdu.frame().destinationAddress(destination); - apdu.frame().addressType(InduvidualAddress); + apdu.frame().addressType(IndividualAddress); uint16_t secureApduLength = apdu.length() + 3 + 6 + 4; // 3(TPCI,APCI,SCF) + sizeof(seqNum) + apdu.length() + 4 CemiFrame secureFrame(secureApduLength); @@ -401,9 +401,9 @@ void SecureApplicationLayer::dataConnectedRequest(uint16_t tsap, Priority priori if (secCtrl.dataSecurity != DataSecurity::none) { - apdu.frame().sourceAddress(_deviceObj.induvidualAddress()); + apdu.frame().sourceAddress(_deviceObj.individualAddress()); apdu.frame().destinationAddress(_transportLayer->getConnectionAddress()); - apdu.frame().addressType(InduvidualAddress); + apdu.frame().addressType(IndividualAddress); uint16_t secureApduLength = apdu.length() + 3 + 6 + 4; // 3(TPCI,APCI,SCF) + sizeof(seqNum) + apdu.length() + 4 CemiFrame secureFrame(secureApduLength); @@ -568,7 +568,7 @@ uint64_t SecureApplicationLayer::lastValidSequenceNumber(bool toolAccess, uint16 if (toolAccess) { // TODO: check if we really have to support multiple tools at the same time - if (srcAddr == _deviceObj.induvidualAddress()) + if (srcAddr == _deviceObj.individualAddress()) return _sequenceNumberToolAccess; return _lastValidSequenceNumberTool; } @@ -621,7 +621,7 @@ void SecureApplicationLayer::sendSyncRequest(uint16_t dstAddr, bool dstAddrIsGro print("sendSyncRequest: TPCI: "); println(tpci, HEX); - if(secure(request.data() + APDU_LPDU_DIFF, kSecureSyncRequest, _deviceObj.induvidualAddress(), dstAddr, dstAddrIsGroupAddr, tpci, asdu, sizeof(asdu), secCtrl, systemBcast)) + if(secure(request.data() + APDU_LPDU_DIFF, kSecureSyncRequest, _deviceObj.individualAddress(), dstAddr, dstAddrIsGroupAddr, tpci, asdu, sizeof(asdu), secCtrl, systemBcast)) { println("SyncRequest: "); request.apdu().printPDU(); @@ -681,7 +681,7 @@ void SecureApplicationLayer::sendSyncResponse(uint16_t dstAddr, bool dstAddrIsGr print("sendSyncResponse: TPCI: "); println(tpci, HEX); - if(secure(response.data() + APDU_LPDU_DIFF, kSecureSyncResponse, _deviceObj.induvidualAddress(), dstAddr, dstAddrIsGroupAddr, tpci, asdu, sizeof(asdu), secCtrl, systemBcast)) + if(secure(response.data() + APDU_LPDU_DIFF, kSecureSyncResponse, _deviceObj.individualAddress(), dstAddr, dstAddrIsGroupAddr, tpci, asdu, sizeof(asdu), secCtrl, systemBcast)) { _lastSyncRes = millis(); @@ -823,7 +823,7 @@ bool SecureApplicationLayer::decrypt(uint8_t* plainApdu, uint16_t plainApduLengt if (service == kSecureDataPdu) { - if (srcAddr != _deviceObj.induvidualAddress()) + if (srcAddr != _deviceObj.individualAddress()) { uint64_t expectedSeqNumber = lastValidSequenceNumber(toolAccess, srcAddr) + 1; @@ -847,7 +847,7 @@ bool SecureApplicationLayer::decrypt(uint8_t* plainApdu, uint16_t plainApduLengt if (!memcmp(knxSerialNumber, _deviceObj.propertyData(PID_SERIAL_NUMBER), 6)) { uint8_t emptySerialNumber[6] = {0}; - if (systemBroadcast || dstAddr != _deviceObj.induvidualAddress() || !memcmp(knxSerialNumber, emptySerialNumber, 6)) + if (systemBroadcast || dstAddr != _deviceObj.individualAddress() || !memcmp(knxSerialNumber, emptySerialNumber, 6)) return false; } @@ -970,7 +970,7 @@ bool SecureApplicationLayer::decrypt(uint8_t* plainApdu, uint16_t plainApduLengt // prevent a sync.req sent by us to trigger sync notification, this happens if we provide our own tool key // for decryption above - if (syncReq && (srcAddr == _deviceObj.induvidualAddress())) + if (syncReq && (srcAddr == _deviceObj.individualAddress())) return false; if (syncReq) @@ -986,7 +986,7 @@ bool SecureApplicationLayer::decrypt(uint8_t* plainApdu, uint16_t plainApduLengt } else { - if (srcAddr == _deviceObj.induvidualAddress()) + if (srcAddr == _deviceObj.individualAddress()) { print("Update our next "); print(toolAccess ? "tool access" : ""); diff --git a/src/knx/tpuart_data_link_layer.cpp b/src/knx/tpuart_data_link_layer.cpp index e719bc2..c56f98f 100644 --- a/src/knx/tpuart_data_link_layer.cpp +++ b/src/knx/tpuart_data_link_layer.cpp @@ -424,7 +424,7 @@ void TpUartDataLinkLayer::frameBytesReceived(uint8_t* buffer, uint16_t length) //printHex("=>", buffer, length); CemiFrame frame(buffer, length); - frameRecieved(frame); + frameReceived(frame); } void TpUartDataLinkLayer::dataConBytesReceived(uint8_t* buffer, uint16_t length, bool success) @@ -444,7 +444,7 @@ void TpUartDataLinkLayer::enabled(bool value) { _enabled = true; print("ownaddr "); - println(_deviceObject.induvidualAddress(), HEX); + println(_deviceObject.individualAddress(), HEX); } else { diff --git a/src/knx_facade.h b/src/knx_facade.h index e35334a..c2a9c5d 100644 --- a/src/knx_facade.h +++ b/src/knx_facade.h @@ -160,9 +160,9 @@ template class KnxFacade : private SaveRestore _bau.writeMemory(); } - uint16_t induvidualAddress() + uint16_t individualAddress() { - return _bau.deviceObject().induvidualAddress(); + return _bau.deviceObject().individualAddress(); } void loop()