anchor.diff:  	      timestamp = TimeStamp,
   	      gpsatc = <<"$GPSACP: 154750.000,5207.6688N,01137.8028E,0.7,62.4,2,196.4,45.7,24.7,030914,09">>}],
       IEs = lists:flatten(lists:duplicate(NoIEs, IE)),
  -    do_transition(State, control, run, {wtp_event_request, IEs}, async, req, {wtp_event_response, From});
  -
  -run({add_station, _}, _From, State = #state{wifi_up = false}) ->
  -    {reply, wait_for_wifi, run, State};
  -
  -run({add_station, Mac}, From, State = #state{mac = WTPMac,
  -					      wifi_up = true}) ->
  +    {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}, {add_station, _}, run, #data{wifi_up = false}) ->
  +    {keep_state_and_data, {reply, From, wait_for_wifi}};
  +
  +handle_event({call, From}, {add_station, Mac}, run,
  +	     Data = #data{mac = WTPMac, wifi_up = true}) ->
       Unknown = 0,
       FromDS = 0,
       ToDS=0,
  
positive.code: 		  end,
  
      Msg = {Header, {ReqType, SeqNumToUse, IEs}},
      {Packet, CtrlStreamState1} = capwap_stream:encode(control, Msg, CtrlStreamState0),
      lager:debug("in do_transition, ~p to send: ~p", [ReqType, Packet]),
  
      do_transition(State#state{ctrl_stream = CtrlStreamState1}, control,
  		  NextState, {packet, Packet}, Mode, RespSeq, UserCallback);
  
  %% send packet and make state transition
  %% mode = async | udp_sync
  %% udp_sync: forces udp usage when otherwise capwapa-dtls would be used
  do_transition(State=#state{remote_mode = RemoteMode,
  			   request_pending=undefined},
  	      Type, NextState, {packet, Packet},
  	      Mode, RespSeq, UserCallback) ->
      State0 = case Mode of
  		 udp_sync ->
  		     S1 = send_capwap(State#state{remote_mode = false}, Type, Packet),
  		     S1#state{remote_mode = RemoteMode};
  		 _ ->
  		     send_capwap(State, Type, Packet)
  	     end,
      State1 = case UserCallback of
  		 undefined ->
  		     State0;
  		 {RespType, From} ->
  		     State0#state{request_pending={RespType,From}}
  	     end,
      case {Type, Mode, RespSeq} of
  	{control, udp_sync, _} ->
  	    Resp = recv_capwap(State1#state{remote_mode = false}),
  	    DecResp = capwap_packet:decode(control, Resp),
  	    {resp, DecResp, bump_seqno(State1)};
  	{_, _, {resp, _}} ->
  	    {next_state, NextState, State1};
  	{control, _, req} ->
  	    {next_state, NextState, bump_seqno(State1)};
  	{data, _, req} ->
  	    {next_state, NextState, State1}
      end.
  
  create_default_ies() ->
  
negative.code: 	   #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">>}],
      {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,
  