diff --git a/apps/iot/src/mocker/iot_mock.erl b/apps/iot/src/mocker/iot_mock.erl index 2f42314..2b20efe 100644 --- a/apps/iot/src/mocker/iot_mock.erl +++ b/apps/iot/src/mocker/iot_mock.erl @@ -15,6 +15,15 @@ -export([insert_services/1]). -export([insert_endpoints/0, test_http/0, test_mysql/0, test_mqtt/0, test_influxdb/0]). +fun_x(LocationCode, Fields, Timestamp) -> + Data = #{ + <<"version">> => <<"1.0">>, + <<"location_code">> => LocationCode, + <<"ts">> => Timestamp, + <<"properties">> => Fields + }, + {ok, iolist_to_binary(jiffy:encode(Data, [force_utf8]))}. + test_influxdb() -> UUID = <<"device123123">>,