anchor.diff:              Message = "{\"bodySerial\":\"" ++ binary_to_list(ClientId) ++ "\",\"status\":true}",
               inets:start(),
               httpc:request(post,{Server,[],ContentType,Message},[],[]),
  -            io:format("client ~s connected, connack: ~w~n", [ClientId, ConnAck]);
  +            io:format("client ~s connected,api is called. connack: ~w~n", [ClientId, ConnAck]);
           true ->
               io:format("client ~s connected, connack: ~w~n", [ClientId, ConnAck])
       end,
  
positive.code: 
  -export([on_client_connected/3, on_client_disconnected/3]).
  
  -export([on_client_subscribe/4, on_client_unsubscribe/4]).
  
  -export([on_session_created/3, on_session_subscribed/4, on_session_unsubscribed/4, on_session_terminated/4]).
  
  -export([on_message_publish/2, on_message_delivered/4, on_message_acked/4]).
  
  %% Called when the plugin application start
  load(Env) ->
      emqttd:hook('client.connected', fun ?MODULE:on_client_connected/3, [Env]),
      emqttd:hook('client.disconnected', fun ?MODULE:on_client_disconnected/3, [Env]),
      emqttd:hook('client.subscribe', fun ?MODULE:on_client_subscribe/4, [Env]),
      emqttd:hook('client.unsubscribe', fun ?MODULE:on_client_unsubscribe/4, [Env]),
      emqttd:hook('session.created', fun ?MODULE:on_session_created/3, [Env]),
      emqttd:hook('session.subscribed', fun ?MODULE:on_session_subscribed/4, [Env]),
      emqttd:hook('session.unsubscribed', fun ?MODULE:on_session_unsubscribed/4, [Env]),
      emqttd:hook('session.terminated', fun ?MODULE:on_session_terminated/4, [Env]),
      emqttd:hook('message.publish', fun ?MODULE:on_message_publish/2, [Env]),
      emqttd:hook('message.delivered', fun ?MODULE:on_message_delivered/4, [Env]),
      emqttd:hook('message.acked', fun ?MODULE:on_message_acked/4, [Env]).
  
  on_client_connected(ConnAck, Client = #mqtt_client{client_id = ClientId}, _Env) ->
      A = binary_part(ClientId,{0,6}),B = <<"Nimbus">>,C = <<"nimbus">>,D = A/=B,E = A/=C,
  
negative.code:             Message = "{\"bodySerial\":\"" ++ binary_to_list(ClientId) ++ "\",\"status\":false}",
              inets:start(),
              httpc:request(post,{Server,[],ContentType,Message},[],[]),
              io:format("client ~s disconnected,api is called, reason: ~w~n", [ClientId, Reason]);
          true ->
              io:format("client ~s disconnected, reason: ~w~n", [ClientId, Reason])
      end,
      ok.
  
  %% Called when the plugin application stop
  unload() ->
      emqttd:unhook('client.connected', fun ?MODULE:on_client_connected/3),
      emqttd:unhook('client.disconnected', fun ?MODULE:on_client_disconnected/3).
  