From 6436c86e0c53d9fbd83d883f76cbd8a267b6428e Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Mon, 7 Feb 2022 20:50:53 +0200 Subject: Implement initial PoC for Kodi --- m4p/m4p.go | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 m4p/m4p.go (limited to 'm4p/m4p.go') diff --git a/m4p/m4p.go b/m4p/m4p.go new file mode 100644 index 0000000..07f78a5 --- /dev/null +++ b/m4p/m4p.go @@ -0,0 +1,46 @@ +package m4p + +import "time" + +// Protocol constants. +const ( + protocolVersion = 1 + keepaliveTimeout = 3 * time.Second + clientKeepaliveInterval = 2 * time.Second +) + +// Magic remote keycodes. +const ( + KeyWheelPressed = 13 + KeyChannelUp = 33 + KeyChannelDown = 34 + KeyLeft = 37 + KeyUp = 38 + KeyRight = 39 + KeyDown = 40 + Key0 = 48 + Key1 = 49 + Key2 = 50 + Key3 = 51 + Key4 = 52 + Key5 = 53 + Key6 = 54 + Key7 = 55 + Key8 = 56 + Key9 = 57 + KeyRed = 403 + KeyGreen = 404 + KeyYellow = 405 + KeyBlue = 406 + KeyBack = 461 +) + +// DefaultFilters used for remote updates. +var DefaultFilters = []string{ + "returnValue", + "deviceId", + "coordinate", + "gyroscope", + "acceleration", + "quaternion", +} -- cgit v1.2.3