Skip to content

Commit

Permalink
Macpie/eui fixes (#917)
Browse files Browse the repository at this point in the history
* Fix logs and and ws event

* Better log line
  • Loading branch information
macpie authored Mar 1, 2023
1 parent a9822bf commit 12d9b7a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
8 changes: 8 additions & 0 deletions config/sys.config
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
{{lager_file_backend, "router.log"}, [{application, router}], info},
{{lager_file_backend, "router.log"}, [{module, router_console_api}], info},
{{lager_file_backend, "router.log"}, [{module, router_device_routing}], info},

{{lager_file_backend, "router.log"}, [{module, helium_packet_service}], info},
{{lager_file_backend, "router.log"}, [{module, helium_router_service}], info},
{{lager_file_backend, "router.log"}, [{module, router_ics_eui_worker}], info},
{{lager_file_backend, "router.log"}, [{module, router_ics_route_get_euis_handler}], info},
{{lager_file_backend, "router.log"}, [{module, router_ics_skf_list_handler}], info},
{{lager_file_backend, "router.log"}, [{module, router_ics_skf_worker}], info},

{{lager_file_backend, "state_channel.log"}, [{module, router_sc_worker}], info},
{
{lager_file_backend, "state_channel.log"},
Expand Down
8 changes: 8 additions & 0 deletions config/sys.config.src
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@
{{lager_file_backend, "router.log"}, [{application, router}], info},
{{lager_file_backend, "router.log"}, [{module, router_console_api}], info},
{{lager_file_backend, "router.log"}, [{module, router_device_routing}], info},

{{lager_file_backend, "router.log"}, [{module, helium_packet_service}], info},
{{lager_file_backend, "router.log"}, [{module, helium_router_service}], info},
{{lager_file_backend, "router.log"}, [{module, router_ics_eui_worker}], info},
{{lager_file_backend, "router.log"}, [{module, router_ics_route_get_euis_handler}], info},
{{lager_file_backend, "router.log"}, [{module, router_ics_skf_list_handler}], info},
{{lager_file_backend, "router.log"}, [{module, router_ics_skf_worker}], info},

{{lager_file_backend, "state_channel.log"}, [{module, router_sc_worker}], info},
{
{lager_file_backend, "state_channel.log"},
Expand Down
2 changes: 1 addition & 1 deletion src/apis/router_console_ws_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ handle_info(
{noreply, State};
%% Device remove
handle_info(
{ws_message, <<"device:all">>, <<"device:all:remove:devices">>, #{<<"devices">> := DeviceIDs}},
{ws_message, <<"device:all">>, <<"device:all:delete:devices">>, #{<<"devices">> := DeviceIDs}},
#state{db = DB, cf = CF} = State
) ->
catch router_ics_eui_worker:remove(DeviceIDs),
Expand Down
12 changes: 11 additions & 1 deletion src/grpc/router_ics_eui_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,17 @@ update_euis(List, State) ->
fun({Action, EUIPairs}) ->
lists:foreach(
fun(EUIPair) ->
lager:info("~p ~p", [Action, EUIPair]),
lager:info("~p app_eui=~s (~w) dev_eui=~s (~w)", [
Action,
lorawan_utils:binary_to_hex(<<
(EUIPair#iot_config_eui_pair_v1_pb.app_eui):64/integer-unsigned-big
>>),
EUIPair#iot_config_eui_pair_v1_pb.app_eui,
lorawan_utils:binary_to_hex(<<
(EUIPair#iot_config_eui_pair_v1_pb.dev_eui):64/integer-unsigned-big
>>),
EUIPair#iot_config_eui_pair_v1_pb.dev_eui
]),
ok = update_euis(Action, EUIPair, Stream, State)
end,
EUIPairs
Expand Down

0 comments on commit 12d9b7a

Please sign in to comment.