diff --git a/Constants.cs b/Constants.cs index fb18c66..9aab7e4 100644 --- a/Constants.cs +++ b/Constants.cs @@ -178,11 +178,11 @@ namespace fnecore public const byte NET_TRANSFER_SUBFUNC_ACTIVITY = 0x01; // Activity Log Transfer public const byte NET_TRANSFER_SUBFUNC_DIAG = 0x02; // Diagnostic Log Transfer - public const byte NET_FUNC_ANNOUNCE = 0x91U; // Network Announce Function - public const byte NET_ANNC_SUBFUNC_GRP_AFFIL = 0x00U; // Announce Group Affiliation - public const byte NET_ANNC_SUBFUNC_UNIT_REG = 0x01U; // Announce Unit Registration - public const byte NET_ANNC_SUBFUNC_UNIT_DEREG = 0x02U; // Announce Unit Deregistration - public const byte NET_ANNC_SUBFUNC_AFFILS = 0x90U; // Update All Affiliations + public const byte NET_FUNC_ANNOUNCE = 0x91; // Network Announce Function + public const byte NET_ANNC_SUBFUNC_GRP_AFFIL = 0x00; // Announce Group Affiliation + public const byte NET_ANNC_SUBFUNC_UNIT_REG = 0x01; // Announce Unit Registration + public const byte NET_ANNC_SUBFUNC_UNIT_DEREG = 0x02; // Announce Unit Deregistration + public const byte NET_ANNC_SUBFUNC_AFFILS = 0x90; // Update All Affiliations /* ** Protocol Tags (as strings) diff --git a/FneBase.cs b/FneBase.cs index 101a8b8..75e3543 100644 --- a/FneBase.cs +++ b/FneBase.cs @@ -780,7 +780,7 @@ namespace fnecore // ensure payload type is correct if ((rtpHeader.PayloadType != Constants.DVMRtpPayloadType) && - (rtpHeader.PayloadType != Constants.DVMRtpControlPayloadType)) + (rtpHeader.PayloadType != Constants.DVMRtpPayloadType + 1)) { Log(LogLevel.ERROR, "Invalid RTP payload type received from network"); return null; diff --git a/FneMaster.cs b/FneMaster.cs index 7e17304..20a95cd 100644 --- a/FneMaster.cs +++ b/FneMaster.cs @@ -1121,7 +1121,7 @@ namespace fnecore case Constants.NET_FUNC_ANNOUNCE: { - else if (fneHeader.SubFunction == Constants.NET_ANNC_SUBFUNC_GRP_AFFIL) // Announce Group Affiliation + if (fneHeader.SubFunction == Constants.NET_ANNC_SUBFUNC_GRP_AFFIL) // Announce Group Affiliation { // can we do activity transfers? if (AllowActivityTransfer) @@ -1131,8 +1131,8 @@ namespace fnecore // validate peer (simple validation really if (peers[peerId].Connection && peers[peerId].EndPoint.ToString() == frame.Endpoint.ToString()) { - uint srcId = FneUtils.Bytes3ToUInt32(buffer, 0); - uint dstId = FneUtils.Bytes3ToUInt32(buffer, 3); + uint srcId = FneUtils.Bytes3ToUInt32(message, 0); + uint dstId = FneUtils.Bytes3ToUInt32(message, 3); if (UnitGroupAffiliation != null) UnitGroupAffiliation(peerId, srcId, dstId); } @@ -1149,7 +1149,7 @@ namespace fnecore // validate peer (simple validation really if (peers[peerId].Connection && peers[peerId].EndPoint.ToString() == frame.Endpoint.ToString()) { - uint srcId = FneUtils.Bytes3ToUInt32(buffer, 0); + uint srcId = FneUtils.Bytes3ToUInt32(message, 0); if (UnitRegistration != null) UnitRegistration(peerId, srcId); } @@ -1166,7 +1166,7 @@ namespace fnecore // validate peer (simple validation really) if (peers[peerId].Connection && peers[peerId].EndPoint.ToString() == frame.Endpoint.ToString()) { - uint srcId = FneUtils.Bytes3ToUInt32(buffer, 0); + uint srcId = FneUtils.Bytes3ToUInt32(message, 0); if (UnitDeregistration != null) UnitDeregistration(peerId, srcId); }