public static bool isPacketIdInBusyList(PacketId _id) { byte packetIdByte = _id.ToByteValue(); if (m_busyPacketIds.Count == 0) { return(false); } for (int i = 0; i < m_busyPacketIds.Count; i++) { if (m_busyPacketIds[i] == packetIdByte) { return(true); } } return(false); }
public static void removeFromBusyPacketIds(PacketId _id) { if (m_busyPacketIds.Count != 0) { byte id = _id.ToByteValue(); int toRemove = -1; for (int i = 0; i < m_busyPacketIds.Count; i++) { if (id == m_busyPacketIds[i]) { toRemove = 0; break; } } if (toRemove != -1) { m_busyPacketIds.Remove((byte)toRemove); } } }