The interface is described in the LCS Partner Program documents. If you can translate a hardware input (say, the position of a quilling whistle slider) into a packet with the TMCC command & value, and transmit the packet to the LCS WiFi socket, the WiFi will forward the packet to the Base where the TMCC command embedded in the packet will get transmitted via the track to the engine. Use Lionel's LCS WiFi Monitor to watch the packets and their contents.
In reality, the Cab2 and apps have to maintain state of the engine(s) operation for info, speed, etc. displays, so the work involved building a control device is a lot more complex than translating hardware inputs and transmitting them to the base.
I have to use three apps (iCab and iTrain on the iPad, and eTrain on Windows) to access most of the functions available in the Cab2. None of these apps/device can be used alone to control all of the functionality of Legacy locos, box cars, dining cars, sensor tracks, subways, and other (future?) LCS devices. Lionel has a lot of capability to add to the upcoming iCab app to make it a "complete" control interface.