View Single Post
Old 01-19-2020, 09:23 PM   #7
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 875
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
It isn't suitable for Android use (because Go), but I created a wireless client UNCaGED that can be used for inspiration.

The calibre wireless device uses a custom protocol built upon TCP. It's basically JSON over TCP, with a bit of 'packet' framing. The format is basically:
123[0,{"some": "json"}], where 123 is the size of the following payload in bytes, 0 is an opcode, and the rest is JSON. Technically, the opcode and json object is also a JSON array...

Everything is text, including the payload size, which is a bit of a PITA to decode.

So, you have to roll your own communications code I'm afraid. No HTTP to be seen unfortunately.

EDIT: It's also a relatively chatty protocol. Lots of ACKS, but not for everything. Keep-alive messages etc.
EDIT2: Wireshark is your friend. It really helped me figure out the proper order of things.

Last edited by sherman; 01-19-2020 at 09:29 PM.
sherman is offline   Reply With Quote