Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ The Angry Miao Infinity .100 (model AM30) is a wireless mouse. It is sold as
"AM Infinity", and the vendor app calls it "AM Infinity .100". Yichip makes its
chip and owns vendor ID 0x3151, so the mouse speaks the Yichip protocol.

- `AngryMiaoHidClient` (`src/drivers/angry-miao/hid.ts`) and its codec
(`src/angry-miao/`) handle everything for this mouse: sending reports,
passing commands through the receiver, and the settings layout.
- `AngryMiaoAm30HidClient` (`src/drivers/angry-miao/am30-hid.ts`) and its codec
(`src/angry-miao/am30.ts`) handle everything that goes over the wire for this
mouse: sending reports, passing commands through the receiver, and the
settings layout. The setters and their checks are shared with the
[Infinity .97 and .100R2](angry-miao-infinity-97-100R2.md) through
`AngryMiaoHidClient` (`src/drivers/angry-miao/hid.ts`).
- Other brands use the same product IDs. The driver claims a device only when
the product ID and the product name both say Angry Miao.
- The driver reads the device ID with `8F` during each status read that reaches
Expand Down
148 changes: 148 additions & 0 deletions docs/angry-miao-infinity-97-100R2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Angry Miao Infinity .97 and .100R2

The Angry Miao Infinity .97 (model AM35) and Infinity .100R2 (model AM30R2) are
wireless mice built on MediaTek's Airoha chips (vendor ID 0x0E8D). They speak
Airoha's RACE command protocol, not the Yichip protocol of the
[Infinity .100](angry-miao-infinity-100.md).

Original contributor does not have the necessary hardward to test. The drivers copy what the vendor
configurator at ammaster.angrymiao.com sends, from its bundle
`index-9145eff3.js`. The supported list marks both models "Test Needed" until
owners confirm them with OpenMouse's Hardware test.

Until then the drivers only read. A status read reports every setting, and the
Hardware test records the readings, but OpenMouse shows no editor and every
setter refuses before it sends a change. The write path below is in place and
tested against a fake mouse; turning it on is a one-line change in
`AngryMiaoAm35HidClient` (`writable`) once an owner's report confirms the reads.

- `AngryMiaoAm35HidClient` (`src/drivers/angry-miao/am35-hid.ts`) drives the
.97. `AngryMiaoAm30R2HidClient` drives the .100R2 and differs only in its
button numbers.
- The codec is `src/angry-miao/am35.ts`. The settings the three Infinity models
share (rates, debounce steps, lift-off levels, sleep presets, button actions)
live in `src/angry-miao/shared.ts`.
- `AngryMiaoHidClient` (`src/drivers/angry-miao/hid.ts`) holds the setters,
their checks and the one-step-at-a-time rule for all three models. Each
protocol client supplies only its reads and writes.

## Identification

| Model | Mouse | 2.4 GHz receiver |
| --- | --- | --- |
| Infinity .97 | 0E8D:0880, 35A1:0035 | 0E8D:0703 |
| Infinity .100R2 | 0E8D:0881 | 0E8D:0704 |

The vendor app treats 0E8D:0880 and 35A1:0035 as a receiver when the product
name contains "dongle", "receiver" or "2.4". The drivers do the same.

A driver claims a device when its vendor and product ID match and the interface
carries feature report 0x14, or output report 0x06 with input report 0x07. The
picker asks for the IDs alone, as the vendor app does.

## Framing

A RACE frame is `05 5A <length LE16> <command LE16> <payload>`. The length
counts the command and the payload. A reply has the same shape, and most reply
payloads start with a status byte, where 0 means done.

One HID report carries `<chunk length> <device id> <chunk>`, zero padded to at
least 61 bytes. A chunk holds up to 59 frame bytes, so a longer frame, such as
the DPI table reply, spans several reports.

- The drivers write to feature report 0x14 and poll it for the reply. They
wait up to 1.2 s, or 3 s through the receiver, as the vendor app does.
- Without report 0x14, they write output report 0x06 and wait for input report
0x07.
- A firmware-version reply of just `00` only acknowledges the request. The
drivers wait for the next one.

## Receiver

Device ID 0 is the device the browser opened: the mouse on the cable, the
receiver on 2.4 GHz. Before it talks to the mouse through the
receiver, the driver sends the vendor app's opening sequence to the receiver
itself:

1. `2C83` with `12 00` (receiver mode).
2. `2CB2` with `06` (link type). The vendor app sends this write on every
connect.
3. `2C94` and `2C96` (device and paired lists).

When either list holds a device, the mouse answers on device ID 0x80. Without
feature report 0x14 the vendor app skips this sequence and sends mouse commands
to device 0, and the drivers do the same. The DPI read decides whether the mouse
answered; the battery read is optional. When the lists are empty or the DPI read
fails, OpenMouse shows the receiver alone. Until the receiver has been set up
this way, the driver refuses any mouse command, so nothing meant for the mouse
reaches the receiver by mistake.

The link type write is the one command a read-only driver still sends, because
the vendor app sends it before it lists the receiver's devices.

## Settings

Each change goes out as the vendor app sends it, then the driver reads the
setting back. A change the mouse does not keep shows an error.

| Setting | Read | Write | Payload |
| --- | --- | --- | --- |
| Report rate | `3011` | `3010` | Hz as LE16 |
| Debounce | `30E9` | `30E8` | raw cable, 2.4 GHz and Bluetooth bytes for the rate |
| Lift-off | `30CD` | `30CC` | 0 low, 1 medium, 2 high |
| Motion sync | `30D3` | `30D2` | 0 or 1 |
| Angle snapping | `30D5` | `30D4` | 0 or 1 |
| Ripple control | `30D7` | `30D6` | 0 or 1 |
| Blast Mode | `30DF` | `30DE` | 0 or 1 |
| Sleep | `3013` | `3012` | see below |
| DPI stage | `30C5` | `30C4` | stage, X LE16, Y LE16 |
| DPI stage count | `30C5` | `30C6` | count, then `30C7` with the active stage |
| Active DPI stage | `30C5` | `30C7` | stage |
| Button | `30C3` | `30C2` | key, action type, parameters |
| Mouse light | stored data `600A` | `30B3` | on, effect, speed; no reply on report 0x14 |
| Receiver light | `300E` | `300D` | on, effect, three hues with saturation, speed + 80, brightness; no reply |

- A rate change rewrites debounce for the same step, because the raw bytes
differ per rate. These are the .100's tables.
- Sleep holds the 2.4 GHz timer, then the Bluetooth one. Each is three LE16
parts that add up to the seconds, followed by two zero bytes. A fixed tail
`3C 00 1E 00 3C 00 1E 00` ends the payload. "Never" is 65535. OpenMouse
changes the 2.4 GHz timer and keeps the Bluetooth one.
- After editing the active DPI stage, the vendor app selects it again with
`30C7`. The drivers do the same.
- Button action types, with their parameters:
- 1 to 5: left, right, middle, forward and back.
- 12 and 13: scroll up and down.
- 11 with `00`, `01` or `03`: DPI up, down and cycle.
- 6 with a consumer usage LE16: media keys.
- 0: disabled.

Left stays a left click, as on the .100.
- The .100R2 sends its buttons as `F0` to `F6` where the .97 uses 1 to 7.
The vendor app names its buttons 6 and 7 "custom key 1" and "custom key 2"
and restores them to scroll up and down.

## What stays read-only

The vendor app writes some settings into the mouse's stored data (`0A0D`),
not into a setting. The drivers never send that command, so these stay
read-only:

- the mouse light's effect, speed and colour (OpenMouse can turn it on and off)
- the DPI stage colours

The drivers also leave out profile switching, macros, rotation angle, DPI quick
switch, pairing and firmware update.

`am35Frame` refuses every command outside the table above, so the drivers
cannot send factory reset, firmware update, pairing or reboot by mistake.

## Automated tests

- `src/angry-miao/am35.test.ts` checks the framing against the vendor app's own
example, every encoder and decoder, and the refused commands.
- `src/drivers/angry-miao/am35-hid.test.ts` runs both clients against a fake
mouse. It checks that a status read sends only reads, that the read-only
default refuses every setter, that no mouse command reaches an unlinked
receiver, every write and its read-back, the receiver's opening sequence, the
.100R2 button numbers and the output 0x06 fallback.
2 changes: 1 addition & 1 deletion docs/diagrams/angry-miao-relay-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/diagrams/angry-miao-relay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading