I’m developing a PC/Mac game where you fly a pedal-powered glider around the countryside, controlled by a smart indoor bike trainer. Sort of a modern clone of Namco’s arcade game PropCycle. The bike trainer is a Wahoo Kickr Snap and I already have it interacting with an Android app using Wahoo’s own Android API, controlling resistance and reporting wattage. The Unity game on the desktop is also working well. My problem is that I just don’t know how to get the two applications to communicate with each other over the LAN.
I’m aware that for Unity-to-Unity communication you can use the HLAPI, and that you can define custom communication with the Transport Layer API. But I have no idea if either of these can help me talk to a regular old Android app, and if so how. I’m of intermediate skill and have never done any network programming so I don’t really know where to start. But I know that this trainer-app-desktop bridge setup has been done before by Zwift via their Zwift Mobile Link for Android/iOS, I just can’t find info on how they did it. I’d only need to communicate a few floats between the app and desktop, roughly once per second. And I assume the app would have to discover the desktop game on the network, or vice versa.
Is there a standard way of doing this unity-to-non-unity connection / communication? Or maybe a plugin / library that can facilitate, either on the Android or Unity side? Those would both be ideal, but if the correct way forward is to educate myself about sockets or something low-level like that I’d just as much appreciate being pointed in the right direction for my research.
PS if anyone is curious as to why I have the bike connected to an Android app and not just an ANT+ dongle on the PC it’s because I just don’t own one nor do many others, but everyone has a Bluetooth-capable phone, and I can make the app talk to more trainer APIs besides the Wahoo in the future.