From df05a70f90a1486a86a4156b1b0d68c94f2098b4 Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Fri, 8 Feb 2019 08:38:56 +0100 Subject: Add support for using multiple generated versions - added CheckCompatibility for checking if given messages are compatible - generating Messages global for easier usage of compatibility check - added ReconnectInterval and MaxReconnectAttempts for reconnecting - added Failed state that is sent after exceeding max reconnect attempts Change-Id: I1062ba453f22657c1a2a31aa64cb103ef1223b0f Signed-off-by: Ondrej Fabry --- core/control_ping.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/control_ping.go') diff --git a/core/control_ping.go b/core/control_ping.go index 904068a..cd447b7 100644 --- a/core/control_ping.go +++ b/core/control_ping.go @@ -7,6 +7,16 @@ var ( msgControlPingReply api.Message = new(ControlPingReply) ) +// SetControlPing sets the control ping message used by core. +func SetControlPing(m api.Message) { + msgControlPing = m +} + +// SetControlPingReply sets the control ping reply message used by core. +func SetControlPingReply(m api.Message) { + msgControlPingReply = m +} + type ControlPing struct{} func (*ControlPing) GetMessageName() string { @@ -34,3 +44,8 @@ func (*ControlPingReply) GetCrcString() string { func (*ControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } + +func init() { + api.RegisterMessage((*ControlPing)(nil), "ControlPing") + api.RegisterMessage((*ControlPingReply)(nil), "ControlPingReply") +} -- cgit 1.2.3-korg