mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
D-Modem-RE's third USB line, usb_agere.cpp (047E:2892, 047E:2828), in the app's native build beside the SmartUSB56's and the pico-serial Line's. Its ROM patches (D-Modem-RE's firmware/agere: Agere's, under Agere's licence, with its LICENSE and NOTICE.md) are copied into the APK's assets at build time (agereFirmware) and installed in the app's files when an Agere modem is the line, DMODEM_AGERE_FIRMWARE pointing D-Modem-RE at them. UsbModems knows the two IDs, and runs it at 8000 Hz (the others at 9600); Android offers the app when one is plugged in; the line's settings say so. native-test: agere_host on D-Modem-RE's fake Agere modems (fake_agere.cpp), their patches the tests' own in a firmware directory: usb_line_test.py's agere run, ATI3, caller ID, CONNECT 33600 both ways, data, hang up, unplugged. AgereFirmwareTest: the patches installed as shipped (D-Modem-RE's SHA-256 sums), the licence beside them. D-Modem-RE a30aa39 too: V.cvm's MPs through AMR-WB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
33 lines
1.0 KiB
C++
33 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) {}
|
|
|
|
} // 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;
|
|
}
|