misson20000 / twili

Homebrew debug monitor for the Nintendo Switch.
GNU General Public License v3.0
184 stars 23 forks source link

twili and incognito mode(empty serial number)? #111

Open AmonRaNet opened 3 years ago

AmonRaNet commented 3 years ago

I have issue with device identification.

Connection: USB OS: 11.x Release: Twili 1.4.0 (preview 2)

When I start daemon I see error for device identification (payload size 0). At same time when I start HB menu I can see messages coming from twili sysmodule. It mean communication works, but device id is failed. As result I could not connect to device.

My suspicion is incognito mode (or more correct - empty serial number). I have impression that in this case identification in sysmodule will fail and will return 0 result.

misson20000 commented 3 years ago

Yeah, empty serial number will be a problem. Devices need some way to identify themselves so that if you have multiple devices connected there is a stable way to distinguish between them. If you have a use case where you actually need both incognito and twili to run together, I could look into it, otherwise I'd recommend you run twili without incognito.

AmonRaNet commented 3 years ago

Thanks for fast response! I could fix code around serial number retrieval and make custom twili build for myself. Or I will simply disable incognito for some time :)

This line: https://github.com/misson20000/twili/blob/947d96e677ee6eec473a0556acbd7d75f13152e3/twili/bridge/interfaces/ITwibDeviceInterface.cpp#L169 ?

I see that TWILI_BRIDGE_CHECK is very strict and any error will cause 0x0 in return to client. But in assumption that Identify is many async calls, probably failure of single should not cause failure for whole call. Maybe is better to use then empty (or hard-coded) default values? Id for device can be produced as hash of all values (wifi + bt MAC unique in all cases), then missing SN will be not a big issue.

But I got your point and technically you answer my question.