Skip to content
This repository was archived by the owner on Oct 30, 2026. It is now read-only.
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
2 changes: 1 addition & 1 deletion src/orchard_cli/apple/linux_usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
import uuid

MODES = {0x1227: 'dfu', 0x4141: 'pongo', 0x4142: 'linux'}
MODES = {0x1227: 'dfu', 0x4141: 'pongo', 0x4142: 'linux', 0x4144: 'ram'}


def devices(root=Path('/sys/bus/usb/devices')):
Expand Down
14 changes: 14 additions & 0 deletions tests/test_device_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ def test_linux_usb_descriptor_identifies_device_and_boot_without_serial_commands
self.assertEqual(len(rows),1)
self.assertEqual((rows[0]['ecid'],rows[0]['boot_id']),(2,BOOT_B))

def test_linux_ram_payload_is_available_to_ram_session_tools(self):
node = self.root/'1-2'
node.mkdir()
for name,value in {'idVendor':'05ac','idProduct':'4144','product':'Orchard charger-test',
'serial':f'BOOT:{BOOT_B}'}.items():
(node/name).write_text(value)
(node/'iface/tty/ttyACM0').mkdir(parents=True)
rows = linux_usb.devices(self.root)
self.assertEqual(len(rows),1)
self.assertEqual(rows[0]['mode'],'ram')
self.assertEqual(rows[0]['boot_id'],BOOT_B)
self.assertEqual(rows[0]['serial_port'],'/dev/ttyACM0')
self.assertIsNone(rows[0]['ecid'])


if __name__ == '__main__':
unittest.main()