Files
app/native-test/usb_fake_device.cpp
T
Claude b0119dbe5e USB modems: each transfer counted both ways, in the log; the first IN ones' heads
The Agere's samples don't come on the device (its clock stays at 0):
whether its IN transfers never come back, come back failed or come
back empty is now in the log, with the clock every 10 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
2026-10-26 04:50:35 +00:00

37 lines
1.0 KiB
C++

/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (C) 2026 Neo-Desktop
*
* usb_fake_device.cpp - the build host's usb_android.h: the fake
* stick (fake_pico_line.cpp) is found by
* libusb's own calls, no descriptor to wrap
*
*/
#include "usb/usb_android.h"
namespace dmodem_android {
void usb_use_fd(int fd)
{
if (fd >= 0)
usb_transfers_reset();
}
} // namespace dmodem_android
/* (weak: a fake that has its own wins) what the fake leaves to the real libusb (upstream's tests preload the
fake in front of it; here it is linked in alone): the device's ports,
for wake on ring's sysfs switch (UsbLine::arm_wake(), with set_wake()
alone), unknown */
extern "C" __attribute__((weak)) int LIBUSB_CALL libusb_get_port_numbers(libusb_device *,
uint8_t *, int)
{
return LIBUSB_ERROR_NOT_SUPPORTED;
}
/* (the Agere modem's speed check: the fake stick isn't one) */
extern "C" __attribute__((weak)) int LIBUSB_CALL libusb_get_device_speed(libusb_device *)
{
return LIBUSB_SPEED_HIGH;
}