Module Observer.Smartpower

Module that represents the abstract communication with a smartpower through sockets.

type station

Abstract type which represents the connection with a socket.

val create : string -> int -> station Lwt.t

create host port tries to reach the smartpower socket on host:port and creates a permanent connection. In case of error it raises UNIX exceptions. It is wrapped into an Lwt monad to handle the asynchrous I/O.

val delete : station Lwt.t -> unit Lwt.t

delete station closes the connection with the smartpower. It's always a success.

val observe : station Lwt.t -> Report.t Lwt.t

observe station returns a Report.t which represents the information gathered by the smartpower at one moment.