anchor.diff:  
   -behaviour(ranch_protocol).
   
  +-include("em_records.hrl").
  +
   %% API
   -export([start_link/4]).
   -export([init/4]).
  
positive.code: parse_course(Course) ->
    list_to_float(binary_to_list(Course)).
  
  parse_validity(Validity) when is_binary(Validity) ->
    binary_to_atom(Validity, utf8).
  
  test() ->
  
negative.code:   case Transport:recv(Socket, 0, 5000) of
      {ok, Data} ->
        em_logger:info("[packet] unit: ip = '~s' data: ~s", [em_hardware:resolve(Socket), Data]),
        {Imei, PositionModel} = parse(Data),
        case em_data_manager:get_device_by_uid(Imei) of
          {error, _Reason} ->
            em_logger:info("[packet] unit: ip = '~s' unknown device with imei = '~s'", [em_hardware:resolve(Socket), Imei]),
            Transport:close(Socket);
          {ok, Object} ->
            Position = PositionModel#position{
              deviceId = Object#device.id,
              protocol = atom_to_binary(Protocol, utf8),
              attributes = maps:merge(PositionModel#position.attributes, #{
                ?KEY_IP => em_hardware:resolve(Socket)
              })
            },
            em_logger:info("save message => unit: ip = '~s' id = '~w' imei = '~s' position: ~w", [em_hardware:resolve(Socket), Object#device.id, Imei, Position]),
            em_data_manager:create_position(Object, Position),
            loop(State#state{device = Object})
        end;
      _ ->
  