Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
gotthardp committed Sep 10, 2018
1 parent 344c344 commit 7f92ff9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lorawan_gw_router.erl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ handle_cast({downlink, {MAC, GWState}, DevAddr, TxQ, RFCh, PHYPayload}, #state{g
Dict2 = dict:store(MAC, Stats#gwstats{tx_times=[{TxQ#txq.freq, Time} | TxTimes]}, Dict),
{noreply, State#state{gateways=Dict2}};
error ->
lager:warning("Downlink request ignored. Gateway ~w not connected.", [MAC]),
lager:warning("Downlink request ignored. Gateway ~s not connected.", [lorawan_utils:binary_to_hex(MAC)]),
{noreply, State}
end;

Expand Down
8 changes: 4 additions & 4 deletions src/lorawan_mac.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ingest_frame(MAC, <<MType:3, _:3, 0:2, _/binary>> = PHYPayload) when byte_size(P
end),
Res;
ingest_frame(MAC, PHYPayload) ->
lager:warning("~s unknown frame protocol: ~p", [binary_to_hex(MAC), PHYPayload]),
lager:warning("gateway ~s received unknown frame protocol: ~p", [binary_to_hex(MAC), PHYPayload]),
ignore.

ingest_frame0(MAC, 2#000, <<_, AppEUI0:8/binary, DevEUI0:8/binary,
Expand Down Expand Up @@ -59,7 +59,7 @@ ingest_frame0(MAC, MType, <<_, DevAddr0:4/binary, ADR:1, ADRACKReq:1, ACK:1, _RF
ingest_data_frame(MAC, MType, Msg, FOpts, FRMPayload, MIC,
#frame{conf=Confirm, devaddr=DevAddr, adr=ADR, adr_ack_req=ADRACKReq, ack=ACK, fcnt=FCnt, port=Port});
ingest_frame0(MAC, MType, Msg, _MIC) ->
lager:warning("~s bad frame (mtype ~.2B): ~p", [binary_to_hex(MAC), MType, Msg]),
lager:warning("gateway ~s received bad frame (mtype ~.2B): ~p", [binary_to_hex(MAC), MType, Msg]),
ignore.

ingest_data_frame(_MAC, MType, Msg, FOpts, FRMPayload, MIC,
Expand Down Expand Up @@ -94,7 +94,7 @@ ingest_data_frame(_MAC, MType, Msg, FOpts, FRMPayload, MIC,
{ignore, Frame}
end;
ingest_data_frame(MAC, MType, _Msg, _FOpts, _FRMPayload, _MIC, #frame{devaddr=DevAddr}) ->
lager:warning("~s ~s downlink frame (mtype ~.2B)", [binary_to_hex(MAC), binary_to_hex(DevAddr), MType]),
lager:warning("gateway ~s received ~s downlink frame (mtype ~.2B)", [binary_to_hex(MAC), binary_to_hex(DevAddr), MType]),
ignore.

handle_join(MAC, #device{deveui=DevEUI, profile=ProfID}=Device, DevNonce) ->
Expand All @@ -106,7 +106,7 @@ handle_join(MAC, #device{deveui=DevEUI, profile=ProfID}=Device, DevNonce) ->
[] ->
{error, {device, DevEUI}, {unknown_group, GroupName}, aggregated};
[#group{can_join=false}] ->
lager:warning("~s join ignored from DevEUI ~s", [binary_to_hex(MAC), binary_to_hex(DevEUI)]),
lager:warning("gateway ~s ignored join from DevEUI ~s", [binary_to_hex(MAC), binary_to_hex(DevEUI)]),
ignore;
[#group{network=NetName, subid=SubID}] ->
case mnesia:read(network, NetName, read) of
Expand Down

0 comments on commit 7f92ff9

Please sign in to comment.