anchor.diff:      KeepAliveInterval = proplists:get_value(keepalive_interval, Opts, 60),
       RetryInterval = proplists:get_value(retry_interval, Opts, 10),
       ProtoVer = proplists:get_value(proto_version, Opts, ?MQTT_PROTO_MAJOR),
  +    InfoFun = proplists:get_value(info_fun, Opts, {fun(_,_) -> ok end, []}),
   
       {Transport, TransportOpts} = proplists:get_value(transport, Opts, {gen_tcp, []}),
   
       State = #state{host = Host, port = Port, proto_version=ProtoVer,
  -		   username = Username, password = Password, client=ClientId, mod=Mod,
  -           clean_session=CleanSession, last_will_topic=LWTopic, last_will_msg=LWMsg, last_will_qos=LWQos,
  -           reconnect_timeout=case ReconnectTimeout of undefined -> undefined; _ -> 1000 * ReconnectTimeout end,
  -           keepalive_interval=1000 * KeepAliveInterval,
  -           retry_interval=1000* RetryInterval, transport={Transport, TransportOpts}},
  +        username = Username, password = Password, client=ClientId, mod=Mod,
  +        clean_session=CleanSession, last_will_topic=LWTopic, last_will_msg=LWMsg, last_will_qos=LWQos,
  +        reconnect_timeout=case ReconnectTimeout of undefined -> undefined; _ -> 1000 * ReconnectTimeout end,
  +        keepalive_interval=1000 * KeepAliveInterval,
  +        retry_interval=1000* RetryInterval, transport={Transport, TransportOpts},
  +        info_fun=InfoFun},
       Res = wrap_res(connecting, init, [Args], State),
       gen_fsm:send_event_after(0, connect),
       Res.
  
positive.code:     {next_state, connected, State};
  
  connected(ping, #state{transport={Transport, _}, sock=Sock,
                         waiting_acks=WAcks, keepalive_interval=Int} = State) ->
      send_ping(Transport, Sock),
      Ref = gen_fsm:send_event_after(Int, ping),
      {next_state, connected,
       State#state{waiting_acks=store(ping, Ref, WAcks)}};
  
  connected(disconnect, State=#state{transport={Transport, _}, sock=Sock}) ->
      send_disconnect(Transport, Sock),
      {next_state, connected, State};
  
  connected(maybe_reconnect, #state{reconnect_timeout=Timeout, transport={Transport, _}} = State) ->
      case Timeout of
          undefined ->
              {stop, normal, State};
          _ ->
              Transport:close(State#state.sock),
              gen_fsm:send_event_after(Timeout, connect),
              wrap_res(connecting, on_disconnect, [], State#state{sock=undefined})
      end;
  
  connected(_Event, State) ->
  
negative.code:     {next_state, connected, send_publish(MsgId, Topic, Payload, QoS, true, State)};
  
  connected({retry, Key}, #state{transport={Transport,_}, sock=Sock, waiting_acks=WAcks,
      retry_interval=RetryInterval} = State) ->
      case dict:find(Key, WAcks) of
          error ->
              {next_state, connected, State};
  