anchor.diff:  parse_course(Course) ->
     list_to_float(binary_to_list(Course)).
   
  -parse_validity(Validity) when is_binary(Validity) ->
  +parse_valid(Validity) when is_binary(Validity) ->
     binary_to_atom(Validity, utf8).
   
   test() ->
  
positive.code: 
  -behaviour(ranch_protocol).
  
  %% API
  -export([start_link/4]).
  -export([init/4]).
  
negative.code: % (echo -n -e "imei:123456789012345,help me,1201011201,,F,120100.000,A,6000.0000,N,13000.0000,E,0.00,;";) | nc -v localhost 5001
  parse(Data) when is_binary(Data) ->
    [Imei, Alarm, LocalDateTime, _, _Status, TimeUtc, Validity, Latitude, LatitudeType, Longitude, LongitudeType, Speed, _Course| _] = binary:split(Data, [<<",">>], [global]),
    {LongitudeDegrees, LatitudeDegrees} = parse_coordinates({{Longitude, LongitudeType}, {Latitude, LatitudeType}}),
    Position = #position{
      deviceTime = parse_date_time(LocalDateTime, TimeUtc),
      latitude = LatitudeDegrees,
      longitude = LongitudeDegrees,
      speed = parse_speed(Speed),
      course = 0,
      valid = parse_valid(Validity),
      attributes = #{
        ?KEY_ALARM => Alarm
      }
    },
    {parse_imei(Imei), Position}.
  
  parse_imei(ImeiData) when is_binary(ImeiData) ->
    [_, Imei|_] = binary:split(ImeiData, [<<":">>], [global]),
  