forked from philtomson/mqtt_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmqtt_lwt.mli
34 lines (31 loc) · 1.08 KB
/
mqtt_lwt.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
type t = {
oc : Lwt_io.output Lwt_io.channel;
ic : Lwt_io.input Lwt_io.channel;
}
type conn_opts_t = {
clean_session : bool;
keep_alive_interval : float;
dup : bool;
qos : int;
retain : bool;
client_id : string;
username : string;
password : string;
will_message : string;
will_topic : string;
will_qos : int;
will_retain : bool;
}
val default_conn_opts : conn_opts_t
val process_publish_pkt : 'a -> ('a -> string -> string -> int -> unit Lwt.t) -> unit Lwt.t
val subscribe : ?qos:int -> topics:string list -> t -> unit Lwt.t
val unsubscribe : ?qos:int -> topics:string list -> t -> unit Lwt.t
val publish : ?dup:bool -> ?qos:int -> ?retain:bool -> topic:string ->
payload:string -> t -> unit Lwt.t
val publish_periodically : ?qos:int -> ?period:float -> topic:string ->
(unit -> string) -> t -> unit Lwt.t
val connect_socket : host:string -> port:int -> Lwt_unix.file_descr Lwt.t
val of_socket : Lwt_unix.file_descr -> t
val connect : t -> opts:conn_opts_t -> t Lwt.t
val run : t -> unit Lwt.t
val connect_to_broker : opts:conn_opts_t -> broker:string -> port:int -> t Lwt.t