Skip to content

Commit a58014c

Browse files
author
CI
committed
Sync to GitHub
1 parent debfb2e commit a58014c

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

lib/bacnet/stack/transport/ethernet_transport.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ defmodule BACnet.Stack.Transport.EthernetTransport do
452452

453453
defp decode_packet(data, dst_mac, _src_mac) do
454454
bvlc =
455-
if(dst_mac == get_broadcast_address(self()),
455+
if(dst_mac == @broadcast_addr,
456456
do: :original_broadcast,
457457
else: :original_unicast
458458
)

lib/bacnet/stack/transport/ipv4_transport.ex

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,11 @@ defmodule BACnet.Stack.Transport.IPv4Transport do
618618
{:noreply, state}
619619
end
620620

621+
@doc false
622+
def handle_cast(_cast, %State{} = state) do
623+
{:noreply, state}
624+
end
625+
621626
@doc false
622627
def handle_info({:udp, _port, source_addr, sender_port, _data}, %State{} = state)
623628
when state.local_ip == source_addr and state.local_port == sender_port do
@@ -655,7 +660,7 @@ defmodule BACnet.Stack.Transport.IPv4Transport do
655660
# If we have already determined that this is a packet from us, we can ignore the check here,
656661
# the result of this operation is not used
657662
is_packet_from_non_broadcast_socket =
658-
if !is_packet_from_us and state.broadcast_rcv_port != nil and
663+
if not is_packet_from_us and state.broadcast_rcv_port != nil and
659664
state.broadcast_rcv_port != rcv_port do
660665
case getifaddrs() do
661666
{:ok, ifs} ->
@@ -748,6 +753,10 @@ defmodule BACnet.Stack.Transport.IPv4Transport do
748753
{:noreply, state}
749754
end
750755

756+
def handle_info(_msg, %State{} = state) do
757+
{:noreply, state}
758+
end
759+
751760
#### BACnet/IP Frame Parsing ####
752761

753762
# Do not accept NPCI with hopcount = 0, this signifies a non-conformant BACnet router

0 commit comments

Comments
 (0)