anchor.diff:  	   #gps_last_acquired_position{
   	      timestamp = TimeStamp,
   	      gpsatc = <<"$GPSACP: 154750.000,5207.6688N,01137.8028E,0.7,62.4,2,196.4,45.7,24.7,030914,09">>}],
  -    do_transition(State, control, run, {wtp_event_request, IEs}, async, req, {wtp_event_response, From});
  -
  -run({send_wwan_statistics, NoIEs}, From, State) ->
  +    {data, DataNew, Actions} =
  +	do_transition(Data, control, {wtp_event_request, IEs},
  +		      async, req, {wtp_event_response, From}),
  +    {keep_state, DataNew, Actions};
  +
  +handle_event({call, From}, {send_wwan_statistics, NoIEs}, run, Data) ->
       TimeStamp = timestamp(),
       IE = [#tp_wtp_wwan_statistics{
   	      latency = 5,
  
positive.code:     ].
  
  timestamp() ->
      {Mega, Secs, _} = now(),
      Mega*1000000 + Secs.
  
  handle_incoming(Response = {#capwap_header{},
  			    {wtp_event_response, _, _RemoteSeq, _IEs}},
  		run, control,
  		State = #state{request_pending={wtp_event_response, From}}) ->
      reply_test(State, From, {ok, Response}, run);
  
  handle_incoming(Response = {#capwap_header{},
  			    {join_response, _, _RemoteSeq, _IEs}},
  		discovery, control,
  		State = #state{request_pending={join_response, From}}) ->
      reply_test(State, From, {ok, Response}, join);
  
  handle_incoming(Response = {#capwap_header{},
  			    {configuration_status_response, _, _RemoteSeq, IEs}},
                  join,
                  control,
                  State = #state{request_pending={configuration_status_response, From}}) ->
      #timers{echo_request = EchoTimer} = lists:keyfind(timers, 1, IEs),
      reply_test(State#state{echo_request_timeout = EchoTimer}, From, {ok, Response}, configure);
  
  handle_incoming(Request = {#capwap_header{},
  			   {ieee_802_11_wlan_configuration_request, _, RemoteSeq, _WlanConfigIEs}} = Req,
  		StateName,
  		control,
  		State = #state{owner = Owner, request_pending = RP}) ->
      lager:debug("Got expected wlan_config_request in ~p: ~p", [StateName, Req]),
      Owner ! Request,
      State0 = State#state{wifi_up = true},
      {next_state, StateName, State1} = do_transition(State0#state{request_pending = undefined},
  						    control, StateName,
  						    {ieee_802_11_wlan_configuration_response,[#result_code{}]},
  						    async, {resp, RemoteSeq}, undefined),
      {next_state, StateName, State1#state{request_pending = RP}};
  
  handle_incoming(Request = {#capwap_header{},
  			   {station_configuration_request, _, RemoteSeq, _StationConfigIEs}} = Req,
  		run,
  		control,
  		State = #state{request_pending = {add_station_resp, From}}) ->
      lager:debug("got expected station_config_request: ~p", [Req]),
      {next_state, run, State0} = reply_test(State, From, {ok, Request}, run),
      do_transition(State0, control, run,
  		  {station_configuration_response, [#result_code{}]},
  		  async, {resp, RemoteSeq}, undefined);
  
  handle_incoming(Response = {_Header, {change_state_event_response, _, _, []}},
  		configure, control,
  		State= #state{capwap_wtp_session_id = CapwapWtpSessionId,
                        request_pending = {change_state_event_response, From},
                        options=Options})  ->
      %% establish dtls on data socket if remote_mode = true
      %% currently not in use (TODO add option for dtls usage on data socket)
      %% State0 = case State#state.remote_mode of
      %% 		 true ->
      %% 		     %% {ok, DataSocket} = ssl:connect(UdpDataSocket, make_ssl_options(State1)),
      %% 		     %% lager:info("successfull ssl handshake done for data socket", []),
      %% 		     %% ok = ssl:setopts(DataSocket, [{active, true}]),
      %% 		     State#state{data_socket = UdpDataSocket};
      %% 		 false ->
      %% 		     State
      %% 	     end,
      {next_state, run, State1} = reply_test(State, From, {ok, Response}, run),
  
      Flags = ['keep-alive', {frame,'802.3'}],
      KeepAliveIEs=[#session_id{session_id = CapwapWtpSessionId}],
      KeepAliveTimeout = proplists:get_value(data_keep_alive_timeout, Options, 30),
      do_transition(State1#state{keep_alive_timeout = KeepAliveTimeout}, data, run, {Flags, KeepAliveIEs});
  
  handle_incoming({Header, _} = Req, run, data, State) ->
      KeepAlive = proplists:get_bool('keep-alive', Header#capwap_header.flags),
      case KeepAlive of
  	true ->
  	    lager:debug("WTP ~p received keep-alive in RUN state! ~p", [State#state.ip, State#state.keep_alive_timeout]),
  	    {next_state, run, State};
  	false ->
  	    lager:warning("in ~p received a data response not expected: ~p", [run, Req]),
  	    {next_state, run, State}
      end;
  
  handle_incoming(Req,
  		StateName,
  		Type,
  		State) ->
      lager:warning("handle_incoming: in ~p received a ~p response not expected: ~p", [StateName, Type, Req]),
      {next_state, StateName, State}.
  
  make_ssl_options(#state{cert_dir = CertDir,
  			root_cert = RootCert}) ->
      [{active, once},
       {mode, binary},
  
negative.code: 	   #wtp_reboot_statistics{},
  	   #ieee_802_11_wtp_radio_information{radio_type = ['802.11g','802.11b']},
  	   #ieee_802_11_supported_rates{supported_rates = [130,132,139,150,12,18,24,36]},
  	   #ieee_802_11_multi_domain_capability{
  	      first_channel = 1,
  	      number_of_channels_ = 14,
  	      max_tx_power_level = 27}],
      {data, DataNew, Actions} =
  	do_transition(Data, control, {configuration_status_request, IEs},
  		      async, req, {configuration_status_response, From}),
      {keep_state, DataNew, Actions};
  
  handle_event({call, From}, send_change_state_event, configure, Data) ->
      IEs =[#radio_operational_state{state = enabled},
  	  #result_code{}],
      {data, DataNew, Actions} =
  	do_transition(Data, control, {change_state_event_request, IEs},
  		      async, req, {change_state_event_response, From}),
      {keep_state, DataNew, Actions};
  
  handle_event({timeout, echo_request}, _, run, Data) ->
      lager:debug("Echo Timeout in Run"),
      {data, DataNew, Actions} =
  	do_transition(Data, control, {echo_request, []}),
      {keep_state, DataNew, Actions};
  
  handle_event({timeout, keep_alive}, _, run,
  	     Data = #data{capwap_wtp_session_id = CapwapWtpSessionId}) ->
      lager:debug("keep-alive Timeout in Run"),
      Flags = ['keep-alive', {frame,'802.3'}],
      KeepAliveIEs=[#session_id{session_id = CapwapWtpSessionId}],
      {data, DataNew, Actions0} =
  	do_transition(Data, data, {Flags, KeepAliveIEs}),
      Actions = keep_alive_timer(DataNew) ++ Actions0,
      {keep_state, DataNew, Actions};
  
  handle_event({timeout, Timeout}, _, _State, _Data)
    when Timeout =:= echo_request; Timeout =:= keep_alive ->
      keep_state_and_data;
  
  handle_event({call, From}, send_wwan_statistics, run, Data) ->
      TimeStamp = timestamp(),
      IEs = [#tp_wtp_wwan_statistics{
  	      latency = 5,
  