This commit is contained in:
Nanosonde 2020-05-29 18:14:59 +02:00
parent 73a0989a3b
commit 2d70750378
2 changed files with 31 additions and 31 deletions

View File

@ -118,7 +118,7 @@ void ApplicationLayer::dataBroadcastIndication(HopCountType hopType, Priority pr
break; break;
} }
default: default:
#if (defined(USE_TP)||defined(USE_IP)) #if (MEDIUM_TYPE == 5)||(MEDIUM_TYPE == 0)
dataSystemBroadcastIndication(hopType, priority, source, apdu); dataSystemBroadcastIndication(hopType, priority, source, apdu);
#else #else
print("Broadcast-indication: unhandled APDU-Type: "); print("Broadcast-indication: unhandled APDU-Type: ");
@ -163,7 +163,7 @@ void ApplicationLayer::dataBroadcastConfirm(AckType ack, HopCountType hopType, P
break; break;
} }
default: default:
#if (defined(USE_TP)||defined(USE_IP)) #if (MEDIUM_TYPE == 5)||(MEDIUM_TYPE == 0)
dataSystemBroadcastConfirm(hopType, priority, apdu, status); dataSystemBroadcastConfirm(hopType, priority, apdu, status);
#else #else
print("Broadcast-confirm: unhandled APDU-Type: "); print("Broadcast-confirm: unhandled APDU-Type: ");
@ -206,14 +206,14 @@ void ApplicationLayer::dataSystemBroadcastIndication(HopCountType hopType, Prior
break; break;
} }
default: default:
#if !(defined(USE_TP)||defined(USE_IP)) #if (MEDIUM_TYPE == 5)||(MEDIUM_TYPE == 0)
// For open media (e.g. PL, RF) // For closed media
print("SystemBroadcast-indication: unhandled APDU-Type: "); print("Broadcast-indication: unhandled APDU-Type: ");
println(apdu.type()); println(apdu.type());
#else #else
// For closed media // For open media (e.g. PL, RF)
print("Broadcast-indication: unhandled APDU-Type: "); print("SystemBroadcast-indication: unhandled APDU-Type: ");
println(apdu.type()); println(apdu.type());
#endif #endif
break; break;
} }
@ -252,14 +252,14 @@ void ApplicationLayer::dataSystemBroadcastConfirm(HopCountType hopType, Priority
break; break;
} }
default: default:
#if !(defined(USE_TP)||defined(USE_IP)) #if (MEDIUM_TYPE == 5)||(MEDIUM_TYPE == 0)
// For open media (e.g. PL, RF) // For closed media
print("SystemBroadcast-confirm: unhandled APDU-Type: "); print("Broadcast-confirm: unhandled APDU-Type: ");
println(apdu.type()); println(apdu.type());
#else #else
// For closed media // For open media (e.g. PL, RF)
print("Broadcast-confirm: unhandled APDU-Type: "); print("SystemBroadcast-confirm: unhandled APDU-Type: ");
println(apdu.type()); println(apdu.type());
#endif #endif
break; break;
} }

View File

@ -45,10 +45,10 @@ void DataLinkLayer::systemBroadcastRequest(AckType ack, FrameFormat format, Prio
{ {
// System Broadcast requests will always be transmitted as broadcast with KNX serial number for open media (e.g. RF medium) // System Broadcast requests will always be transmitted as broadcast with KNX serial number for open media (e.g. RF medium)
// See 3.2.5 p.22 // See 3.2.5 p.22
#if !(defined(USE_TP)||defined(USE_IP)) #if (MEDIUM_TYPE == 5)||(MEDIUM_TYPE == 0)
sendTelegram(npdu, ack, 0, GroupAddress, format, priority, SysBroadcast);
#else
sendTelegram(npdu, ack, 0, GroupAddress, format, priority, Broadcast); sendTelegram(npdu, ack, 0, GroupAddress, format, priority, Broadcast);
#else
sendTelegram(npdu, ack, 0, GroupAddress, format, priority, SysBroadcast);
#endif #endif
} }
@ -78,13 +78,13 @@ void DataLinkLayer::dataConReceived(CemiFrame& frame, bool success)
if (addrType == GroupAddress && destination == 0) if (addrType == GroupAddress && destination == 0)
{ {
#if !(defined(USE_TP)||defined(USE_IP)) #if (MEDIUM_TYPE == 5)||(MEDIUM_TYPE == 0)
if (systemBroadcast == SysBroadcast) (void) systemBroadcast; // not used
_networkLayer.systemBroadcastConfirm(ack, type, priority, source, npdu, success); _networkLayer.broadcastConfirm(ack, type, priority, source, npdu, success);
else
_networkLayer.broadcastConfirm(ack, type, priority, source, npdu, success);
#else #else
(void) systemBroadcast; // not used if (systemBroadcast == SysBroadcast)
_networkLayer.systemBroadcastConfirm(ack, type, priority, source, npdu, success);
else
_networkLayer.broadcastConfirm(ack, type, priority, source, npdu, success); _networkLayer.broadcastConfirm(ack, type, priority, source, npdu, success);
#endif #endif
} }
@ -119,14 +119,14 @@ void DataLinkLayer::frameRecieved(CemiFrame& frame)
if (addrType == GroupAddress && destination == 0) if (addrType == GroupAddress && destination == 0)
{ {
#if !(defined(USE_TP)||defined(USE_IP)) #if (MEDIUM_TYPE == 5)||(MEDIUM_TYPE == 0)
if (systemBroadcast == SysBroadcast)
_networkLayer.systemBroadcastIndication(ack, type, npdu, priority, source);
else
_networkLayer.broadcastIndication(ack, type, npdu, priority, source);
#else
(void) systemBroadcast; // not used (void) systemBroadcast; // not used
_networkLayer.broadcastIndication(ack, type, npdu, priority, source); _networkLayer.broadcastIndication(ack, type, npdu, priority, source);
#else
if (systemBroadcast == SysBroadcast)
_networkLayer.systemBroadcastIndication(ack, type, npdu, priority, source);
else
_networkLayer.broadcastIndication(ack, type, npdu, priority, source);
#endif #endif
} }
else else