Skip to content

Commit 6ab270e

Browse files
authored
Add hpr_timestamp_ms for gwmp protocol (#313)
1 parent dd9e890 commit 6ab270e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/protocols/gwmp/hpr_gwmp_worker.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ packet_up_to_push_data(Up, Timestamp, GatewayLocation) ->
250250
network => <<"helium_iot">>,
251251
gateway_id => B58,
252252
gateway_name => Name,
253-
regi => hpr_packet_up:region(Up)
253+
regi => hpr_packet_up:region(Up),
254+
hpr_timestamp_ms => Timestamp
254255
},
255256
%% NOTE: everything in meta needs to be string -> string.
256257
Meta =

test/hpr_protocol_gwmp_SUITE.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@ verify_push_data(PacketUp, PushDataBinary) ->
801801
),
802802
<<"regi">> => erlang:atom_to_binary(
803803
hpr_packet_up:region(PacketUp)
804-
)
804+
),
805+
<<"hpr_timestamp_ms">> => fun erlang:is_integer/1
805806
}
806807
}
807808
]
@@ -848,7 +849,8 @@ verify_push_data_with_location(PacketUp, PushDataBinary, IndexString) ->
848849
),
849850
<<"gateway_h3index">> => erlang:list_to_binary(IndexString),
850851
<<"gateway_lat">> => hpr_utils:format_coord(ExpectedLat),
851-
<<"gateway_long">> => hpr_utils:format_coord(ExpectedLong)
852+
<<"gateway_long">> => hpr_utils:format_coord(ExpectedLong),
853+
<<"hpr_timestamp_ms">> => fun erlang:is_integer/1
852854
}
853855
}
854856
]

0 commit comments

Comments
 (0)