Skip to content

Commit cfbf505

Browse files
committed
Make hpr_timestamp_ms a binary to support semtech bridge
1 parent d2c77e4 commit cfbf505

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/protocols/gwmp/hpr_gwmp_worker.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ packet_up_to_push_data(Up, Timestamp, GatewayLocation) ->
251251
gateway_id => B58,
252252
gateway_name => Name,
253253
regi => hpr_packet_up:region(Up),
254-
hpr_timestamp_ms => Timestamp
254+
hpr_timestamp_ms => erlang:integer_to_binary(Timestamp)
255255
},
256256
%% NOTE: everything in meta needs to be string -> string.
257257
Meta =

test/hpr_protocol_gwmp_SUITE.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ verify_push_data(PacketUp, PushDataBinary) ->
802802
<<"regi">> => erlang:atom_to_binary(
803803
hpr_packet_up:region(PacketUp)
804804
),
805-
<<"hpr_timestamp_ms">> => fun erlang:is_integer/1
805+
<<"hpr_timestamp_ms">> => fun erlang:is_binary/1
806806
}
807807
}
808808
]
@@ -850,7 +850,7 @@ verify_push_data_with_location(PacketUp, PushDataBinary, IndexString) ->
850850
<<"gateway_h3index">> => erlang:list_to_binary(IndexString),
851851
<<"gateway_lat">> => hpr_utils:format_coord(ExpectedLat),
852852
<<"gateway_long">> => hpr_utils:format_coord(ExpectedLong),
853-
<<"hpr_timestamp_ms">> => fun erlang:is_integer/1
853+
<<"hpr_timestamp_ms">> => fun erlang:is_binary/1
854854
}
855855
}
856856
]

0 commit comments

Comments
 (0)