Skip to content

Commit

Permalink
Update h3 index in gwmp to be the hex string version (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie authored Dec 13, 2023
1 parent 7ecd30a commit 4cc0f92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/protocols/gwmp/hpr_gwmp_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ packet_up_to_push_data(Up, GatewayTime, GatewayLocation) ->
BaseMeta;
{H3Index, Lat, Long} ->
BaseMeta#{
gateway_h3index => erlang:integer_to_binary(H3Index),
gateway_h3index => erlang:list_to_binary(h3:to_string(H3Index)),
gateway_lat => hpr_utils:format_coord(Lat),
gateway_long => hpr_utils:format_coord(Long)
}
Expand Down
2 changes: 1 addition & 1 deletion test/hpr_protocol_gwmp_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ verify_push_data_with_location(PacketUp, PushDataBinary, IndexString) ->
<<"regi">> => erlang:atom_to_binary(
hpr_packet_up:region(PacketUp)
),
<<"gateway_h3index">> => erlang:integer_to_binary(ExpectedIndex),
<<"gateway_h3index">> => erlang:list_to_binary(IndexString),
<<"gateway_lat">> => hpr_utils:format_coord(ExpectedLat),
<<"gateway_long">> => hpr_utils:format_coord(ExpectedLong)
}
Expand Down

0 comments on commit 4cc0f92

Please sign in to comment.