anchor.diff:              next_state(StateName, State#state{station_count = SC - 1})
       end;
   
  -handle_event(_Event, StateName, State) ->
  +handle_event({Msg, Seq, Elements, Header}, StateName, State) ->
  +    lager:warning("in ~s got unexpexted: ~p",
  +		  [StateName, {Msg, Seq, Elements, Header}]),
       next_state(StateName, State).
   
  -%%--------------------------------------------------------------------
  -%% @private
  -%% @doc
  -%% Whenever a gen_fsm receives an event sent using
  -%% gen_fsm:sync_send_all_state_event/[2,3], this function is called
  -%% to handle the event.
  -%%
  -%% @spec handle_sync_event(Event, From, StateName, State) ->
  -%%                   {next_state, NextStateName, NextState} |
  -%%                   {next_state, NextStateName, NextState, Timeout} |
  -%%                   {reply, Reply, NextStateName, NextState} |
  -%%                   {reply, Reply, NextStateName, NextState, Timeout} |
  -%%                   {stop, Reason, NewState} |
  -%%                   {stop, Reason, Reply, NewState}
  -%% @end
  -%%--------------------------------------------------------------------
  -
  -handle_sync_event(get_state, _From, StateName, State) ->
  -    reply({ok, State}, StateName, State);
  -
  -handle_sync_event({set_ssid, {RadioId, WlanId} = WlanIdent, SSID, SuppressSSID},
  +handle_call(get_state, From, StateName, State) ->
  +    reply(From, {ok, State}, StateName, State);
  +
  +handle_call({set_ssid, {RadioId, WlanId} = WlanIdent, SSID, SuppressSSID},
   		  From, run, #state{config = Config0} = State0) ->
       Settings = [{ssid, SSID}, {suppress_ssid, SuppressSSID}],
       Config = capwap_config:update_wlan_config(RadioId, WlanId, Settings, Config0),
  
positive.code:             {stop, normal, State#state{session=Session}}
      end;
  
  
  listen(timeout, State) ->
      {stop, normal, State}.
  
  idle({keep_alive, _DataPath, _WTPDataChannelAddress, Header, PayLoad}, State) ->
      lager:warning("in IDLE got unexpected keep_alive: ~p", [{Header, PayLoad}]),
      next_state(idle, State);
  
  idle(timeout, State) ->
      lager:info("timeout in IDLE -> stop"),
      {stop, normal, State};
  
  idle({discovery_request, Seq, Elements, #capwap_header{
  				radio_id = RadioId, wb_id = WBID, flags = Flags}},
       State) ->
      RespElements = ac_info(discover, Elements),
      Header = #capwap_header{radio_id = RadioId, wb_id = WBID, flags = Flags},
      State1 = send_response(Header, discovery_response, Seq, RespElements, State),
      next_state(idle, State1);
  
  idle({join_request, Seq, Elements, #capwap_header{
  			   radio_id = RadioId, wb_id = WBID, flags = Flags}},
       State0 = #state{ctrl_channel_address = WTPControlChannelAddress,
  		     session = Session, id = CommonName,
  		     config = Config0}) ->
  
negative.code: 		    end, State, Radios),
      next_state(run, State1);
  
  run(cast, {del_station, BSS, MAC}, State0) ->
      Wlan = get_wlan_by_bss(BSS, State0),
      State = internal_del_station(Wlan, MAC, State0),
      next_state(run, State);
  
  run(cast, {send_80211, BSS, Data}, State) ->
      Wlan = get_wlan_by_bss(BSS, State),
      internal_send_80211_station(Wlan, Data, State),
      next_state(run, State);
  
  run(cast, {firmware_download, DownloadLink, Sha}, State) ->
      Flags = [{frame,'802.3'}],
      ReqElements = [#firmware_download_information{
          sha256_image_hash = Sha,
  