From e3cc7ab2b1b424d3b0d3ecf0efea27d28530ed35 Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 23 Nov 2020 16:23:03 +0100 Subject: [PATCH] Add IsAlive() method on client --- emlid/client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/emlid/client.go b/emlid/client.go index 3b00c5c..4a92641 100644 --- a/emlid/client.go +++ b/emlid/client.go @@ -78,6 +78,14 @@ func (c *Client) Close() { c.conn = nil } +func (c *Client) IsAlive() bool { + if c.conn == nil { + return false + } + + return c.conn.IsAlive() +} + // Emit a new event with the given data func (c *Client) Emit(event string, data interface{}) error { // enc := json.NewEncoder(os.Stdout)