libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
OgcLoggerUsbGecko.h
1/****************************************************************************
2 * Platform Abstraction Layer
3 * Daryl Borth 2026
4 * OgcLoggerUsbGecko.h
5 *
6 * USB Gecko backend over EXI, shared by GameCube and Wii (both expose the
7 * same EXI bus / memory card slots). Channel is config-driven
8 * (LogConfig::geckoChannel) rather than hardcoded, so a Gecko in slot A vs
9 * slot B is a config change, not a rebuild.
10 *
11 * This backend is a thin wrapper around libogc's own implementation
12 *
13 * Hot-plug: the adapter may be plugged in after startup, unplugged, or
14 * stall temporarily (host-side capture tool not reading).
15 ***************************************************************************/
16#pragma once
17
18#include "../Logger.h"
19#include "../Time.h"
20
24{
25 public:
26 bool init(const LogConfig & config) override;
27 void shutdown() override;
28 void write(LogLevel level, const char * line, size_t len) override;
29 const char * name() const override { return "USBGecko"; }
30
31 private:
34 bool probe();
35
36 int channel = 1;
37 bool attached = false;
38 bool probed = false;
39 Ticks lastProbe = 0;
40};
Abstract backend a Logger fans a formatted line out to.
Definition Logger.h:153
Log backend for a USB Gecko adapter over EXI, via usbgecko.c.
void shutdown() override
Releases whatever init() acquired.
void write(LogLevel level, const char *line, size_t len) override
Writes one already-formatted, newline-terminated line.
const char * name() const override
Short identifier for diagnostics (eg. "UDP", "File").
bool init(const LogConfig &config) override
Opens whatever handle/socket/file this backend needs, using only fields from config (nothing hardcode...
LogLevel
Severity of a single log call.
Definition Logger.h:45
Full runtime configuration for the Logger.
Definition Logger.h:101