anchor.diff:  %% @end
   -spec cast(pid(), dbus_message()) -> ok | {error, term()}.
   cast(Conn, #dbus_message{}=Msg) when is_pid(Conn) ->
  -    gen_fsm:send_event(Conn, Msg).
  +    gen_statem:cast(Conn, Msg).
   
   
   %% @doc Launch authentication on this connection
  
positive.code: %% @end
  -spec set_controlling_process(Connection :: pid(), Client :: pid()) -> ok | {error, unauthorized}.
  set_controlling_process(Conn, Client) ->
      gen_fsm:sync_send_all_state_event(Conn, {set_controlling_process, Client}).
  
  %%
  %% gen_fsm callbacks
  
negative.code: 	    {next_state, waiting_for_agreee, State}
      end;
  
  handle_event(info, {received, Bin}, waiting_for_agree, State) ->
      ?debug("Unknown command waiting for agree unix fd : ~s", [Bin]),
      {next_state, waiting_for_agree, State};
  
  handle_event({call, From}, {call, _}, waiting_for_agree, _State) ->
      gen_statem:reply(From, {error, authentication_needed}),
      keep_state_and_data;
  
  handle_event({call, {_Pid, Tag}=From}, auth, waiting_for_agree, #state{waiting=Waiting}=State) ->
      gen_statem:reply(From, {ok, {self(), Tag}}),
      {keep_state, State#state{waiting=[From|Waiting]}};
  
  %% STATE: authenticated
  handle_event(info, {received, Data}, authenticated, #state{buf=Buf}=State) ->
      BufAndData = <<Buf/binary, Data/binary>>,
      case dbus_marshaller:unmarshal_data(BufAndData) of
          {ok, Msgs, Rest} ->
  