= fpanels - Go library for Logitech/Saitek flight panels :toc:
NOTE: This is work in progress. The code is useable, but not much tested. The API may still change. The library has been verified to work on Linux and Windows. On macOS 11.1 I get a "bad access" error code.
This library provides code for interfacing with the following Logitech/Saitek devices:
Multiple devices of the same type is not supported. For example, you will not be able to interact with two radio panels.
== The panels
=== Flight switch panel
The flight switch panel has:
The USB vendor:product ID for the panel is 06a3:0d67.
==== Landing gear LEDs
The landing gear LEDs can be enabled by sending a one byte USB control message to the device as follows:
Enabling both the red and green LED gives a yellow color.
==== Switches
The state of the switches can be obtained by a three byte USB bulk read on endpoint 1. The bits the bytes are as follows:
Byte 1 00000001 BAT 00000010 ALT 00000100 AVIONICS 00001000 FUEL 00010000 DE-ICE 00100000 PITOT 01000000 COWL 10000000 PANEL
Byte 2 00000001 BEACON 00000010 NAV 00000100 STROBE 00001000 TAXI 00010000 LANDING 00100000 OFF 01000000 R 10000000 L
=== Flight multi panel
The flight multi panel has:
The text on the left on the segment display is not controllable. The text shows the function of the selection switch. When IAS, HDG or CRS is selected, then only three numbers can be shown on the top row and the bottom row is blank.
When VS or ALT is selected, then both rows can show 5 numbers each. The bottom row can additionally show dashes.
The USB vendor:product ID for the panel 06a3:0d06.
==== Segment display and button LEDs
The segment display and button LEDs are controlled by sending an 11 byte USB control message to the device. The first five bytes are for the top row, the second five for the bottom row and the 11th byte controls the button LEDs. The Logitech software sends 12 bytes, but no function has been found for the 12th byte. The 12th byte is always sent as 0xff.
The 10 numbers on the segment display are encoded as follows:
If 0x0f is set for all 10 numbers then the display is turned off, including the text on the left of the numbers.
Other values outside the range 0-9 will also turn off the number. The Logitech software uses 0x0f.
The 11th byte for the push button LEDs are encoded as follows:
==== Switches, buttons and encoders
The state of the switches can be obtained by a three byte USB bulk read on endpont 1. The bits the bytes are as follows:
Byte 1 00000001 ALT 00000010 VS 00000100 IAS 00001000 HDG 00010000 CRS 00100000 Encoder cw 01000000 Encoder ccw 10000000 AP
Byte 2 00000001 HDG 00000010 NAV 00000100 IAS 00001000 ALT 00010000 VS 00100000 APR 01000000 REV 10000000 Throttle ARM
=== Flight radio panel
The flight radio panel has:
The segment displays can show numbers or dash in each position. In addition a dot can be displayed in combination with a number.
The vendor:prduct ID for the panel is 06a3:0d05.
==== Segment displays
The segment displays are controlled by sending a 22 byte USB control message to the device, 5 bytes per display, in the following order: top left, top right, bottom left, bottom right.
The 20 display numbers are encoded as follows:
Two additional bytes have to be sent for it to work on Windows, i.e, 22 bytes in total. These remaining two bytes can be sent as zero.
==== Switches, buttons and encoders
The state of the switches can be obtained by a three byte USB bulk read on endpoint 1. The bits in the bytes are as follows:
Byte 1 00000001 1 COM1 00000010 1 COM2 00000100 1 NAV1 00001000 1 NAV2 00010000 1 ADF 00100000 1 DME 01000000 1 XPDR 10000000 2 COM1
Byte 2 00000001 2 COM2 00000010 2 NAV1 00000100 2 NAV2 00001000 2 ADF 00010000 2 DME 00100000 2 XPDR 01000000 1 ACT/STDBY 10000000 2 ACT/STDBY