From 7f92ff9df244eb6a89b0a98b6987722c3c3f332f Mon Sep 17 00:00:00 2001 From: Petr Gotthard Date: Mon, 10 Sep 2018 18:10:24 +0200 Subject: [PATCH] Polish --- src/lorawan_gw_router.erl | 2 +- src/lorawan_mac.erl | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lorawan_gw_router.erl b/src/lorawan_gw_router.erl index 05384404..ab65d587 100644 --- a/src/lorawan_gw_router.erl +++ b/src/lorawan_gw_router.erl @@ -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; diff --git a/src/lorawan_mac.erl b/src/lorawan_mac.erl index 1bcb6138..9e94a189 100644 --- a/src/lorawan_mac.erl +++ b/src/lorawan_mac.erl @@ -27,7 +27,7 @@ ingest_frame(MAC, <> = 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, @@ -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, @@ -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) -> @@ -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