136 changes: 77 additions & 59 deletions Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp
Expand Up @@ -51,7 +51,7 @@ void ciface::Win32::Init(void* hwnd)

if (FAILED(CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED)))
{
ERROR_LOG(SERIALINTERFACE, "CoInitializeEx failed: %i", GetLastError());
ERROR_LOG_FMT(SERIALINTERFACE, "CoInitializeEx failed: {}", GetLastError());
return;
}
Common::ScopeGuard uninit([] { CoUninitialize(); });
Expand All @@ -65,25 +65,25 @@ void ciface::Win32::Init(void* hwnd)
ATOM window_class = RegisterClassEx(&window_class_info);
if (!window_class)
{
NOTICE_LOG(SERIALINTERFACE, "RegisterClassEx failed: %i", GetLastError());
NOTICE_LOG_FMT(SERIALINTERFACE, "RegisterClassEx failed: {}", GetLastError());
return;
}
Common::ScopeGuard unregister([&window_class] {
if (!UnregisterClass(MAKEINTATOM(window_class), GetModuleHandle(nullptr)))
ERROR_LOG(SERIALINTERFACE, "UnregisterClass failed: %i", GetLastError());
ERROR_LOG_FMT(SERIALINTERFACE, "UnregisterClass failed: {}", GetLastError());
});

message_window = CreateWindowEx(0, L"Message", nullptr, 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr,
nullptr, nullptr);
promise_guard.Exit();
if (!message_window)
{
ERROR_LOG(SERIALINTERFACE, "CreateWindowEx failed: %i", GetLastError());
ERROR_LOG_FMT(SERIALINTERFACE, "CreateWindowEx failed: {}", GetLastError());
return;
}
Common::ScopeGuard destroy([&] {
if (!DestroyWindow(message_window))
ERROR_LOG(SERIALINTERFACE, "DestroyWindow failed: %i", GetLastError());
ERROR_LOG_FMT(SERIALINTERFACE, "DestroyWindow failed: {}", GetLastError());
});

std::array<RAWINPUTDEVICE, 2> devices;
Expand All @@ -101,7 +101,7 @@ void ciface::Win32::Init(void* hwnd)
if (!RegisterRawInputDevices(devices.data(), static_cast<UINT>(devices.size()),
static_cast<UINT>(sizeof(decltype(devices)::value_type))))
{
ERROR_LOG(SERIALINTERFACE, "RegisterRawInputDevices failed: %i", GetLastError());
ERROR_LOG_FMT(SERIALINTERFACE, "RegisterRawInputDevices failed: {}", GetLastError());
return;
}

Expand All @@ -126,17 +126,18 @@ void ciface::Win32::PopulateDevices(void* hwnd)
s_done_populating.Reset();
PostMessage(s_message_window, WM_INPUT_DEVICE_CHANGE, 0, 0);
if (!s_done_populating.WaitFor(std::chrono::seconds(10)))
ERROR_LOG(SERIALINTERFACE, "win32 timed out when trying to populate devices");
ERROR_LOG_FMT(SERIALINTERFACE, "win32 timed out when trying to populate devices");
}
else
{
ERROR_LOG(SERIALINTERFACE, "win32 asked to populate devices, but device thread isn't running");
ERROR_LOG_FMT(SERIALINTERFACE,
"win32 asked to populate devices, but device thread isn't running");
}
}

void ciface::Win32::DeInit()
{
NOTICE_LOG(SERIALINTERFACE, "win32 DeInit");
NOTICE_LOG_FMT(SERIALINTERFACE, "win32 DeInit");
if (s_thread.joinable())
{
PostMessage(s_message_window, WM_DOLPHIN_STOP, 0, 0);
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
Expand Up @@ -253,8 +253,8 @@ static void AddDeviceNode(const char* devnode)
auto evdev_device = FindDeviceWithUniqueIDAndPhysicalLocation(uniq, phys);
if (evdev_device)
{
NOTICE_LOG(SERIALINTERFACE, "evdev combining devices with unique id: %s, physical location: %s",
uniq, phys);
NOTICE_LOG_FMT(SERIALINTERFACE,
"evdev combining devices with unique id: {}, physical location: {}", uniq, phys);

evdev_device->AddNode(devnode, fd, dev);

Expand Down Expand Up @@ -282,7 +282,7 @@ static void AddDeviceNode(const char* devnode)
static void HotplugThreadFunc()
{
Common::SetCurrentThreadName("evdev Hotplug Thread");
NOTICE_LOG(SERIALINTERFACE, "evdev hotplug thread started");
NOTICE_LOG_FMT(SERIALINTERFACE, "evdev hotplug thread started");

udev* const udev = udev_new();
Common::ScopeGuard udev_guard([udev] { udev_unref(udev); });
Expand Down Expand Up @@ -337,7 +337,7 @@ static void HotplugThreadFunc()
AddDeviceNode(devnode);
}
}
NOTICE_LOG(SERIALINTERFACE, "evdev hotplug thread stopped");
NOTICE_LOG_FMT(SERIALINTERFACE, "evdev hotplug thread stopped");
}

static void StartHotplugThread()
Expand Down
90 changes: 46 additions & 44 deletions Source/Core/InputCommon/DynamicInputTextureConfiguration.cpp
Expand Up @@ -40,7 +40,7 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st
File::OpenFStream(json_stream, json_file, std::ios_base::in);
if (!json_stream.is_open())
{
ERROR_LOG(VIDEO, "Failed to load dynamic input json file '%s'", json_file.c_str());
ERROR_LOG_FMT(VIDEO, "Failed to load dynamic input json file '{}'", json_file);
m_valid = false;
return;
}
Expand All @@ -50,19 +50,20 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st

if (!error.empty())
{
ERROR_LOG(VIDEO, "Failed to load dynamic input json file '%s' due to parse error: %s",
json_file.c_str(), error.c_str());
ERROR_LOG_FMT(VIDEO, "Failed to load dynamic input json file '{}' due to parse error: {}",
json_file, error);
m_valid = false;
return;
}

const picojson::value& output_textures_json = out.get("output_textures");
if (!output_textures_json.is<picojson::object>())
{
ERROR_LOG(VIDEO,
"Failed to load dynamic input json file '%s' because 'output_textures' is missing or "
"was not of type object",
json_file.c_str());
ERROR_LOG_FMT(
VIDEO,
"Failed to load dynamic input json file '{}' because 'output_textures' is missing or "
"was not of type object",
json_file);
m_valid = false;
return;
}
Expand Down Expand Up @@ -103,11 +104,11 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st

if (!image.is<std::string>() || !emulated_controls.is<picojson::object>())
{
ERROR_LOG(VIDEO,
"Failed to load dynamic input json file '%s' because required fields "
"'image', or 'emulated_controls' are either "
"missing or the incorrect type",
json_file.c_str());
ERROR_LOG_FMT(VIDEO,
"Failed to load dynamic input json file '{}' because required fields "
"'image', or 'emulated_controls' are either "
"missing or the incorrect type",
json_file);
m_valid = false;
return;
}
Expand All @@ -121,10 +122,10 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st
const std::string image_full_path = m_base_path + texture_data.m_image_name;
if (!File::Exists(image_full_path))
{
ERROR_LOG(VIDEO,
"Failed to load dynamic input json file '%s' because the image '%s' "
"could not be loaded",
json_file.c_str(), image_full_path.c_str());
ERROR_LOG_FMT(VIDEO,
"Failed to load dynamic input json file '{}' because the image '{}' "
"could not be loaded",
json_file, image_full_path);
m_valid = false;
return;
}
Expand All @@ -134,10 +135,10 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st
{
if (!map.is<picojson::object>())
{
ERROR_LOG(VIDEO,
"Failed to load dynamic input json file '%s' because 'emulated_controls' "
"map key '%s' is incorrect type. Expected map ",
json_file.c_str(), emulated_controller_name.c_str());
ERROR_LOG_FMT(VIDEO,
"Failed to load dynamic input json file '{}' because 'emulated_controls' "
"map key '{}' is incorrect type. Expected map ",
json_file, emulated_controller_name);
m_valid = false;
return;
}
Expand All @@ -147,10 +148,11 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st
{
if (!regions_array.is<picojson::array>())
{
ERROR_LOG(VIDEO,
"Failed to load dynamic input json file '%s' because emulated controller '%s' "
"key '%s' has incorrect value type. Expected array ",
json_file.c_str(), emulated_controller_name.c_str(), emulated_control.c_str());
ERROR_LOG_FMT(
VIDEO,
"Failed to load dynamic input json file '{}' because emulated controller '{}' "
"key '{}' has incorrect value type. Expected array ",
json_file, emulated_controller_name, emulated_control);
m_valid = false;
return;
}
Expand All @@ -161,11 +163,11 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st
Rect r;
if (!region.is<picojson::array>())
{
ERROR_LOG(
ERROR_LOG_FMT(
VIDEO,
"Failed to load dynamic input json file '%s' because emulated controller '%s' "
"key '%s' has a region with the incorrect type. Expected array ",
json_file.c_str(), emulated_controller_name.c_str(), emulated_control.c_str());
"Failed to load dynamic input json file '{}' because emulated controller '{}' "
"key '{}' has a region with the incorrect type. Expected array ",
json_file, emulated_controller_name, emulated_control);
m_valid = false;
return;
}
Expand All @@ -174,24 +176,24 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st

if (region_offsets.size() != 4)
{
ERROR_LOG(
ERROR_LOG_FMT(
VIDEO,
"Failed to load dynamic input json file '%s' because emulated controller '%s' "
"key '%s' has a region that does not have 4 offsets (left, top, right, "
"Failed to load dynamic input json file '{}' because emulated controller '{}' "
"key '{}' has a region that does not have 4 offsets (left, top, right, "
"bottom).",
json_file.c_str(), emulated_controller_name.c_str(), emulated_control.c_str());
json_file, emulated_controller_name, emulated_control);
m_valid = false;
return;
}

if (!std::all_of(region_offsets.begin(), region_offsets.end(),
[](picojson::value val) { return val.is<double>(); }))
{
ERROR_LOG(
ERROR_LOG_FMT(
VIDEO,
"Failed to load dynamic input json file '%s' because emulated controller '%s' "
"key '%s' has a region that has the incorrect offset type.",
json_file.c_str(), emulated_controller_name.c_str(), emulated_control.c_str());
"Failed to load dynamic input json file '{}' because emulated controller '{}' "
"key '{}' has a region that has the incorrect offset type.",
json_file, emulated_controller_name, emulated_control);
m_valid = false;
return;
}
Expand All @@ -217,10 +219,10 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st

if (host_controls.empty())
{
ERROR_LOG(VIDEO,
"Failed to load dynamic input json file '%s' because field "
"'host_controls' is missing ",
json_file.c_str());
ERROR_LOG_FMT(VIDEO,
"Failed to load dynamic input json file '{}' because field "
"'host_controls' is missing ",
json_file);
m_valid = false;
return;
}
Expand All @@ -229,10 +231,10 @@ DynamicInputTextureConfiguration::DynamicInputTextureConfiguration(const std::st
{
if (!map.is<picojson::object>())
{
ERROR_LOG(VIDEO,
"Failed to load dynamic input json file '%s' because 'host_controls' "
"map key '%s' is incorrect type ",
json_file.c_str(), host_device.c_str());
ERROR_LOG_FMT(VIDEO,
"Failed to load dynamic input json file '{}' because 'host_controls' "
"map key '{}' is incorrect type ",
json_file, host_device);
m_valid = false;
return;
}
Expand Down
68 changes: 37 additions & 31 deletions Source/Core/InputCommon/GCAdapter.cpp
Expand Up @@ -88,7 +88,7 @@ static void Read()
int err = libusb_interrupt_transfer(s_handle, s_endpoint_in, s_controller_payload_swap,
sizeof(s_controller_payload_swap), &payload_size, 16);
if (err)
ERROR_LOG(SERIALINTERFACE, "adapter libusb read failed: err=%s", libusb_error_name(err));
ERROR_LOG_FMT(SERIALINTERFACE, "adapter libusb read failed: err={}", libusb_error_name(err));

{
std::lock_guard<std::mutex> lk(s_mutex);
Expand All @@ -111,12 +111,17 @@ static void Write()
if (!s_adapter_thread_running.IsSet())
return;

u8 payload[5] = {0x11, s_controller_rumble[0], s_controller_rumble[1], s_controller_rumble[2],
s_controller_rumble[3]};
int err =
u8 payload[5] = {
0x11,
s_controller_rumble[0],
s_controller_rumble[1],
s_controller_rumble[2],
s_controller_rumble[3],
};
const int err =
libusb_interrupt_transfer(s_handle, s_endpoint_out, payload, sizeof(payload), &size, 16);
if (err)
ERROR_LOG(SERIALINTERFACE, "adapter libusb write failed: err=%s", libusb_error_name(err));
if (err != 0)
ERROR_LOG_FMT(SERIALINTERFACE, "adapter libusb write failed: err={}", libusb_error_name(err));
}
}

Expand Down Expand Up @@ -149,7 +154,7 @@ static int HotplugCallback(libusb_context* ctx, libusb_device* dev, libusb_hotpl
static void ScanThreadFunc()
{
Common::SetCurrentThreadName("GC Adapter Scanning Thread");
NOTICE_LOG(SERIALINTERFACE, "GC Adapter scanning thread started");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter scanning thread started");

#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
#ifndef __FreeBSD__
Expand All @@ -165,7 +170,7 @@ static void ScanThreadFunc()
nullptr, &s_hotplug_handle) != LIBUSB_SUCCESS)
s_libusb_hotplug_enabled = false;
if (s_libusb_hotplug_enabled)
NOTICE_LOG(SERIALINTERFACE, "Using libUSB hotplug detection");
NOTICE_LOG_FMT(SERIALINTERFACE, "Using libUSB hotplug detection");
}
#endif

Expand All @@ -182,10 +187,10 @@ static void ScanThreadFunc()
else
Common::SleepCurrentThread(500);
}
NOTICE_LOG(SERIALINTERFACE, "GC Adapter scanning thread stopped");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter scanning thread stopped");
}

void SetAdapterCallback(std::function<void(void)> func)
void SetAdapterCallback(std::function<void()> func)
{
s_detect_callback = func;
}
Expand Down Expand Up @@ -257,10 +262,10 @@ static bool CheckDeviceAccess(libusb_device* device)
{
libusb_device_descriptor desc;
int ret = libusb_get_device_descriptor(device, &desc);
if (ret)
if (ret != 0)
{
// could not acquire the descriptor, no point in trying to use it.
ERROR_LOG(SERIALINTERFACE, "libusb_get_device_descriptor failed with error: %d", ret);
ERROR_LOG_FMT(SERIALINTERFACE, "libusb_get_device_descriptor failed with error: {}", ret);
return false;
}

Expand All @@ -270,25 +275,26 @@ static bool CheckDeviceAccess(libusb_device* device)
return false;
}

NOTICE_LOG(SERIALINTERFACE, "Found GC Adapter with Vendor: %X Product: %X Devnum: %d",
desc.idVendor, desc.idProduct, 1);
NOTICE_LOG_FMT(SERIALINTERFACE, "Found GC Adapter with Vendor: {:X} Product: {:X} Devnum: {}",
desc.idVendor, desc.idProduct, 1);

// In case of failure, capture the libusb error code into the adapter status
Common::ScopeGuard status_guard([&ret] { s_status = ret; });

u8 bus = libusb_get_bus_number(device);
u8 port = libusb_get_device_address(device);
const u8 bus = libusb_get_bus_number(device);
const u8 port = libusb_get_device_address(device);
ret = libusb_open(device, &s_handle);
if (ret == LIBUSB_ERROR_ACCESS)
{
ERROR_LOG(SERIALINTERFACE,
"Dolphin does not have access to this device: Bus %03d Device %03d: ID %04X:%04X.",
bus, port, desc.idVendor, desc.idProduct);
ERROR_LOG_FMT(
SERIALINTERFACE,
"Dolphin does not have access to this device: Bus {:03d} Device {:03d}: ID {:04X}:{:04X}.",
bus, port, desc.idVendor, desc.idProduct);
return false;
}
if (ret)
if (ret != 0)
{
ERROR_LOG(SERIALINTERFACE, "libusb_open failed to open device with error = %d", ret);
ERROR_LOG_FMT(SERIALINTERFACE, "libusb_open failed to open device with error = {}", ret);
return false;
}

Expand All @@ -297,14 +303,14 @@ static bool CheckDeviceAccess(libusb_device* device)
{
ret = libusb_detach_kernel_driver(s_handle, 0);
if (ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED)
ERROR_LOG(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: %d", ret);
ERROR_LOG_FMT(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: {}", ret);
}

// This call makes Nyko-brand (and perhaps other) adapters work.
// However it returns LIBUSB_ERROR_PIPE with Mayflash adapters.
const int transfer = libusb_control_transfer(s_handle, 0x21, 11, 0x0001, 0, nullptr, 0, 1000);
if (transfer < 0)
WARN_LOG(SERIALINTERFACE, "libusb_control_transfer failed with error: %d", transfer);
WARN_LOG_FMT(SERIALINTERFACE, "libusb_control_transfer failed with error: {}", transfer);

// this split is needed so that we don't avoid claiming the interface when
// detaching the kernel driver is successful
Expand All @@ -316,9 +322,9 @@ static bool CheckDeviceAccess(libusb_device* device)
}

ret = libusb_claim_interface(s_handle, 0);
if (ret)
if (ret != 0)
{
ERROR_LOG(SERIALINTERFACE, "libusb_claim_interface failed with error: %d", ret);
ERROR_LOG_FMT(SERIALINTERFACE, "libusb_claim_interface failed with error: {}", ret);
libusb_close(s_handle);
s_handle = nullptr;
return false;
Expand Down Expand Up @@ -404,7 +410,7 @@ static void Reset()
}
if (s_detect_callback != nullptr)
s_detect_callback();
NOTICE_LOG(SERIALINTERFACE, "GC Adapter detached");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter detached");
}

GCPadStatus Input(int chan)
Expand All @@ -430,8 +436,8 @@ GCPadStatus Input(int chan)
controller_payload_copy[0] != LIBUSB_DT_HID)
{
// This can occur for a few frames on initialization.
ERROR_LOG(SERIALINTERFACE, "error reading payload (size: %d, type: %02x)", payload_size,
controller_payload_copy[0]);
ERROR_LOG_FMT(SERIALINTERFACE, "error reading payload (size: {}, type: {:02x})", payload_size,
controller_payload_copy[0]);
}
else
{
Expand All @@ -440,8 +446,8 @@ GCPadStatus Input(int chan)
if (type != ControllerTypes::CONTROLLER_NONE &&
s_controller_type[chan] == ControllerTypes::CONTROLLER_NONE)
{
NOTICE_LOG(SERIALINTERFACE, "New device connected to Port %d of Type: %02x", chan + 1,
controller_payload_copy[1 + (9 * chan)]);
NOTICE_LOG_FMT(SERIALINTERFACE, "New device connected to Port {} of Type: {:02x}", chan + 1,
controller_payload_copy[1 + (9 * chan)]);
get_origin = true;
}

Expand Down Expand Up @@ -545,7 +551,7 @@ static void ResetRumbleLockNeeded()
int size = 0;
libusb_interrupt_transfer(s_handle, s_endpoint_out, rumble, sizeof(rumble), &size, 16);

INFO_LOG(SERIALINTERFACE, "Rumble state reset");
INFO_LOG_FMT(SERIALINTERFACE, "Rumble state reset");
}

void Output(int chan, u8 rumble_command)
Expand Down
24 changes: 12 additions & 12 deletions Source/Core/InputCommon/GCAdapter_Android.cpp
Expand Up @@ -64,7 +64,7 @@ static u64 s_last_init = 0;
static void ScanThreadFunc()
{
Common::SetCurrentThreadName("GC Adapter Scanning Thread");
NOTICE_LOG(SERIALINTERFACE, "GC Adapter scanning thread started");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter scanning thread started");

JNIEnv* env = IDCache::GetEnvForThread();

Expand All @@ -78,13 +78,13 @@ static void ScanThreadFunc()
Common::SleepCurrentThread(1000);
}

NOTICE_LOG(SERIALINTERFACE, "GC Adapter scanning thread stopped");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter scanning thread stopped");
}

static void Write()
{
Common::SetCurrentThreadName("GC Adapter Write Thread");
NOTICE_LOG(SERIALINTERFACE, "GC Adapter write thread started");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter write thread started");

JNIEnv* env = IDCache::GetEnvForThread();
jmethodID output_func = env->GetStaticMethodID(s_adapter_class, "Output", "([B)I");
Expand All @@ -108,21 +108,21 @@ static void Write()
// Netplay sends invalid data which results in size = 0x00. Ignore it.
if (size != write_size && size != 0x00)
{
ERROR_LOG(SERIALINTERFACE, "error writing rumble (size: %d)", size);
ERROR_LOG_FMT(SERIALINTERFACE, "error writing rumble (size: {})", size);
Reset();
}
}

Common::YieldCPU();
}

NOTICE_LOG(SERIALINTERFACE, "GC Adapter write thread stopped");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter write thread stopped");
}

static void Read()
{
Common::SetCurrentThreadName("GC Adapter Read Thread");
NOTICE_LOG(SERIALINTERFACE, "GC Adapter read thread started");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter read thread started");

bool first_read = true;
JNIEnv* env = IDCache::GetEnvForThread();
Expand Down Expand Up @@ -179,7 +179,7 @@ static void Read()
s_fd = 0;
s_detected = false;

NOTICE_LOG(SERIALINTERFACE, "GC Adapter read thread stopped");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter read thread stopped");
}

void Init()
Expand Down Expand Up @@ -229,7 +229,7 @@ static void Reset()

s_detected = false;
s_fd = 0;
NOTICE_LOG(SERIALINTERFACE, "GC Adapter detached");
NOTICE_LOG_FMT(SERIALINTERFACE, "GC Adapter detached");
}

void Shutdown()
Expand Down Expand Up @@ -270,8 +270,8 @@ GCPadStatus Input(int chan)
GCPadStatus pad = {};
if (payload_size != controller_payload_copy.size())
{
ERROR_LOG(SERIALINTERFACE, "error reading payload (size: %d, type: %02x)", payload_size,
controller_payload_copy[0]);
ERROR_LOG_FMT(SERIALINTERFACE, "error reading payload (size: {}, type: {:02x})", payload_size,
controller_payload_copy[0]);
Reset();
}
else
Expand All @@ -281,8 +281,8 @@ GCPadStatus Input(int chan)
if (type != ControllerTypes::CONTROLLER_NONE &&
s_controller_type[chan] == ControllerTypes::CONTROLLER_NONE)
{
ERROR_LOG(SERIALINTERFACE, "New device connected to Port %d of Type: %02x", chan + 1,
controller_payload_copy[1 + (9 * chan)]);
ERROR_LOG_FMT(SERIALINTERFACE, "New device connected to Port {} of Type: {:02x}", chan + 1,
controller_payload_copy[1 + (9 * chan)]);
get_origin = true;
}

Expand Down