ctrl_link.h 1.0 KB

12345678910111213141516171819
  1. // ctrl_link.h -- the inverse of OpenPuck's rf_link.cpp: the CONTROLLER side of the puck link.
  2. //
  3. // rf_link.cpp (puck) advertises an E1 host frame, then POLLS the controller (E7 awake, E3 GET 0x45) and
  4. // decodes the controller's 0xF1 reply. Here we run the mirror image: we RX the puck's E1 (adopt its
  5. // advertised session base/prefix/channel when it matches a stored bond), then ANSWER its polls -- F1
  6. // carrying report 0x45 built from the Deck's input (report45.cpp), F3 to the E7 awake/version probe.
  7. //
  8. // No RF pairing handshake: pairing is done over USB (Steam writes both sides), reconnect is purely
  9. // "hear an E1 with my UUIDs -> adopt -> answer polls" -- the same model rf_link relies on.
  10. #pragma once
  11. #include <stdint.h>
  12. // connected bond index (-1 = searching) and the last time we heard a poll on the session address.
  13. extern int g_linkSlot;
  14. extern unsigned long g_linkAliveMs;
  15. void ctrlLinkTask();
  16. // connected AND recently polled (drives the Deck UI "available" indicator + neutral-report decision).
  17. bool ctrlLinkUp();