Skip to content

Commit

Permalink
Add network field to metadata (#286)
Browse files Browse the repository at this point in the history
* Update hpr_gwmp_worker.erl

* Fix hpr_protocol_gwmp_SUITE

---------

Co-authored-by: Macpie <[email protected]>
  • Loading branch information
jpmeijers and macpie authored Feb 13, 2024
1 parent 8536cf4 commit c9547e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/protocols/gwmp/hpr_gwmp_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ packet_up_to_push_data(Up, GatewayTime, GatewayLocation) ->
Name = erlang:list_to_binary(hpr_utils:gateway_name(PubKeyBin)),

BaseMeta = #{
network => <<"helium_iot">>,
gateway_id => B58,
gateway_name => Name,
regi => hpr_packet_up:region(Up)
Expand Down
2 changes: 2 additions & 0 deletions test/hpr_protocol_gwmp_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ verify_push_data(PacketUp, PushDataBinary) ->
<<"time">> => fun erlang:is_binary/1,
<<"tmst">> => hpr_packet_up:timestamp(PacketUp) band 16#FFFF_FFFF,
<<"meta">> => #{
<<"network">> => <<"helium_iot">>,
<<"gateway_id">> => erlang:list_to_binary(
libp2p_crypto:bin_to_b58(PubKeyBin)
),
Expand Down Expand Up @@ -826,6 +827,7 @@ verify_push_data_with_location(PacketUp, PushDataBinary, IndexString) ->
<<"time">> => fun erlang:is_binary/1,
<<"tmst">> => hpr_packet_up:timestamp(PacketUp) band 16#FFFF_FFFF,
<<"meta">> => #{
<<"network">> => <<"helium_iot">>,
<<"gateway_id">> => erlang:list_to_binary(
libp2p_crypto:bin_to_b58(PubKeyBin)
),
Expand Down

0 comments on commit c9547e9

Please sign in to comment.