mirror of
https://github.com/thelsing/knx.git
synced 2025-01-07 00:05:47 +01:00
Rename DataSecurity enums; conflict with Wifimanager
This commit is contained in:
parent
eab31e7808
commit
2aecc213ff
@ -25,44 +25,44 @@ build_flags =
|
||||
|
||||
|
||||
;--- ESP8266 -----------------------------------------------
|
||||
#[env:nodemcuv2_ip]
|
||||
#platform = espressif8266
|
||||
#board = nodemcuv2
|
||||
#framework = arduino
|
||||
#lib_deps =
|
||||
# WifiManager@0.15.0
|
||||
# knx
|
||||
[env:nodemcuv2_ip]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
framework = arduino
|
||||
lib_deps =
|
||||
WifiManager
|
||||
knx
|
||||
|
||||
#build_flags =
|
||||
# -DMASK_VERSION=0x57B0
|
||||
# -Wno-unknown-pragmas
|
||||
build_flags =
|
||||
-DMASK_VERSION=0x57B0
|
||||
-Wno-unknown-pragmas
|
||||
|
||||
#[env:nodemcuv2_tp]
|
||||
#platform = espressif8266
|
||||
#board = nodemcuv2
|
||||
#framework = arduino
|
||||
#lib_deps =
|
||||
# WifiManager@0.15.0
|
||||
# knx
|
||||
[env:nodemcuv2_tp]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
framework = arduino
|
||||
lib_deps =
|
||||
WifiManager@0.15.0
|
||||
knx
|
||||
|
||||
#build_flags =
|
||||
# -DMASK_VERSION=0x07B0
|
||||
# -Wno-unknown-pragmas
|
||||
build_flags =
|
||||
-DMASK_VERSION=0x07B0
|
||||
-Wno-unknown-pragmas
|
||||
|
||||
;---------------------------------------------------------
|
||||
|
||||
|
||||
;--- ESP32 -----------------------------------------------
|
||||
#[env:esp32dev_ip]
|
||||
#platform = espressif32
|
||||
#board = esp32dev
|
||||
#framework = arduino
|
||||
#lib_deps =
|
||||
# knx
|
||||
[env:esp32dev_ip]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
||||
framework = arduino
|
||||
lib_deps =
|
||||
knx
|
||||
|
||||
#build_flags =
|
||||
# -DMASK_VERSION=0x57B0
|
||||
# -Wno-unknown-pragmas
|
||||
build_flags =
|
||||
-DMASK_VERSION=0x57B0
|
||||
-Wno-unknown-pragmas
|
||||
|
||||
[env:esp32dev_tp]
|
||||
platform = espressif32
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "bits.h"
|
||||
#include <stdio.h>
|
||||
|
||||
const SecurityControl ApplicationLayer::noSecurity {.toolAccess=false, .dataSecurity=DataSecurity::none};
|
||||
const SecurityControl ApplicationLayer::noSecurity {.toolAccess=false, .dataSecurity=DataSecurity::None};
|
||||
|
||||
ApplicationLayer::ApplicationLayer(BusAccessUnit& bau) : _bau(bau)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ class ApplicationLayer
|
||||
void associationTableObject(AssociationTableObject& assocTable);
|
||||
|
||||
// from transport layer
|
||||
// Note: without data secure feature, the application layer is just used with SecurtyControl.dataSecurity = none
|
||||
// Note: without data secure feature, the application layer is just used with SecurtyControl.dataSecurity = None
|
||||
// hooks that can be implemented by derived class (e.g. SecureApplicationLayer)
|
||||
|
||||
#pragma region Transport - Layer - Callbacks
|
||||
|
@ -79,7 +79,7 @@ void BauSystemBDevice::sendNextGroupTelegram()
|
||||
// Get security flags from Security Interface Object for this group object
|
||||
goSecurity.dataSecurity = _secIfObj.getGroupObjectSecurity(asap);
|
||||
#else
|
||||
goSecurity.dataSecurity = DataSecurity::none;
|
||||
goSecurity.dataSecurity = DataSecurity::None;
|
||||
#endif
|
||||
|
||||
if (flag == WriteRequest && go.transmitEnable())
|
||||
|
@ -204,9 +204,9 @@ enum ApduType
|
||||
|
||||
enum DataSecurity
|
||||
{
|
||||
none,
|
||||
auth,
|
||||
authConf
|
||||
None,
|
||||
Auth,
|
||||
AuthConf
|
||||
};
|
||||
|
||||
struct SecurityControl
|
||||
|
@ -305,7 +305,7 @@ void SecureApplicationLayer::dataGroupRequest(AckType ack, HopCountType hopType,
|
||||
|
||||
println("dataGroupRequest");
|
||||
|
||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
||||
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||
{
|
||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||
apdu.frame().destinationAddress(_addrTab->getGroupAddress(tsap));
|
||||
@ -328,7 +328,7 @@ void SecureApplicationLayer::dataBroadcastRequest(AckType ack, HopCountType hopT
|
||||
{
|
||||
println("dataBroadcastRequest");
|
||||
|
||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
||||
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||
{
|
||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||
apdu.frame().destinationAddress(0x0000);
|
||||
@ -352,7 +352,7 @@ void SecureApplicationLayer::dataSystemBroadcastRequest(AckType ack, HopCountTyp
|
||||
{
|
||||
println("dataSystemBroadcastRequest");
|
||||
|
||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
||||
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||
{
|
||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||
apdu.frame().destinationAddress(0x0000);
|
||||
@ -376,7 +376,7 @@ void SecureApplicationLayer::dataIndividualRequest(AckType ack, HopCountType hop
|
||||
{
|
||||
println("dataIndividualRequest");
|
||||
|
||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
||||
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||
{
|
||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||
apdu.frame().destinationAddress(destination);
|
||||
@ -399,7 +399,7 @@ void SecureApplicationLayer::dataConnectedRequest(uint16_t tsap, Priority priori
|
||||
{
|
||||
println("dataConnectedRequest");
|
||||
|
||||
if (secCtrl.dataSecurity != DataSecurity::none)
|
||||
if (secCtrl.dataSecurity != DataSecurity::None)
|
||||
{
|
||||
apdu.frame().sourceAddress(_deviceObj.individualAddress());
|
||||
apdu.frame().destinationAddress(_transportLayer->getConnectionAddress());
|
||||
@ -593,7 +593,7 @@ void SecureApplicationLayer::updateLastValidSequence(bool toolAccess, uint16_t r
|
||||
|
||||
void SecureApplicationLayer::sendSyncRequest(uint16_t dstAddr, bool dstAddrIsGroupAddr, const SecurityControl &secCtrl, bool systemBcast)
|
||||
{
|
||||
if (secCtrl.dataSecurity != DataSecurity::authConf)
|
||||
if (secCtrl.dataSecurity != DataSecurity::AuthConf)
|
||||
{
|
||||
println("sync.req is always sent with auth+conf!");
|
||||
return;
|
||||
@ -655,7 +655,7 @@ void SecureApplicationLayer::sendSyncRequest(uint16_t dstAddr, bool dstAddrIsGro
|
||||
|
||||
void SecureApplicationLayer::sendSyncResponse(uint16_t dstAddr, bool dstAddrIsGroupAddr, const SecurityControl &secCtrl, uint64_t remoteNextSeqNum, bool systemBcast)
|
||||
{
|
||||
if (secCtrl.dataSecurity != DataSecurity::authConf)
|
||||
if (secCtrl.dataSecurity != DataSecurity::AuthConf)
|
||||
{
|
||||
println("sync.res is always sent with auth+conf!");
|
||||
return;
|
||||
@ -797,7 +797,7 @@ bool SecureApplicationLayer::decrypt(uint8_t* plainApdu, uint16_t plainApduLengt
|
||||
}
|
||||
|
||||
secCtrl.toolAccess = toolAccess;
|
||||
secCtrl.dataSecurity = authOnly ? DataSecurity::auth : DataSecurity::authConf;
|
||||
secCtrl.dataSecurity = authOnly ? DataSecurity::Auth : DataSecurity::AuthConf;
|
||||
|
||||
bool syncReq = service == kSecureSyncRequest;
|
||||
bool syncRes = service == kSecureSyncResponse;
|
||||
@ -1052,7 +1052,7 @@ bool SecureApplicationLayer::secure(uint8_t* buffer, uint16_t service, uint16_t
|
||||
uint8_t* apdu, uint16_t apduLength, const SecurityControl& secCtrl, bool systemBcast)
|
||||
{
|
||||
bool toolAccess = secCtrl.toolAccess;
|
||||
bool confidentiality = secCtrl.dataSecurity == DataSecurity::authConf;
|
||||
bool confidentiality = secCtrl.dataSecurity == DataSecurity::AuthConf;
|
||||
|
||||
if (toolAccess)
|
||||
{
|
||||
|
@ -550,10 +550,10 @@ DataSecurity SecurityInterfaceObject::getGroupObjectSecurity(uint16_t index)
|
||||
// write access flags, approved spec. AN158, p.97
|
||||
bool conf = (data[0] & 2) == 2;
|
||||
bool auth = (data[0] & 1) == 1;
|
||||
return conf ? DataSecurity::authConf : auth ? DataSecurity::auth : DataSecurity::none;
|
||||
return conf ? DataSecurity::AuthConf : auth ? DataSecurity::Auth : DataSecurity::None;
|
||||
}
|
||||
|
||||
return DataSecurity::none;
|
||||
return DataSecurity::None;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user