View Source grisp_connect_client (grisp_connect v2.1.0)

Client to interact with grisp.io

This module contains a state machine to ensure connectivity with grisp.io. JsonRPC traffic is managed here.

Link to this section Summary

Functions

State connecting is used to establish a connection to grisp.io.

State waiting_ip is used to check the device has an IP address. The first time entering this state, the check will be performed right away. If the device do not have an IP address, it will wait a fixed amount of time and check again, without incrementing the retry counter.

Link to this section Types

-type data() :: #data{}.
-type on_error_fun() ::
    fun((data(),
         local | remote,
         Code :: atom() | integer(),
         Message :: undefined | binary(),
         Data :: term()) ->
            data()).
-type on_result_fun() :: fun((data(), Result :: term()) -> data()).

Link to this section Functions

Link to this function

code_change(Vsn, State, Data, Extra)

View Source
Link to this function

connected(EventType, OldState, Data)

View Source
Link to this function

connecting(EventType, OldState, Data)

View Source

State connecting is used to establish a connection to grisp.io.

Link to this function

idle(EventType, OldState, Data)

View Source
Link to this function

notify(Method, Type, Params)

View Source
Link to this function

request(Method, Type, Params)

View Source
Link to this function

terminate(Reason, State, Data)

View Source
Link to this function

waiting_ip(EventType, OldState, Data)

View Source

State waiting_ip is used to check the device has an IP address. The first time entering this state, the check will be performed right away. If the device do not have an IP address, it will wait a fixed amount of time and check again, without incrementing the retry counter.