|
NotificationProtocol
Details of the communication between the android and desktop apps
Phase-Implementation Protocol specificationWe use the same protocol over all notification methods, with the only change being the transmission medium. Version 2The packet format is the following string: VERSION/DEVICE_ID/NOTIFICATION_ID/EVENT_TYPE/DATA/EVENT_CONTENTS Where the fields are:
For backward compatibility, the desktop client will accept both this new format and the old one. Version 1It uses an extremely complex packet format: DEVICE_ID/NOTIFICATION_ID/EVENT_TYPE/EVENT_CONTENTS Where the fields are:
EVENT_CONTENTS can also contain embedded slashes without any need for escaping - everything after the second slash is considered part of it. Wifi (UDP)We send a broadcast packet on port 10600 to 255.255.255.255 (configurable - may also use the DHCP address or a custom IP) with the above contents from the device. The desktop app listens on anything that arrives in that port. Wifi (TCP)Similar to the UDP version, but instead we open a TCP socket on porto 10600 to the custom IP entered by the user. BluetoothWe open a RFCOMM connection from the device using UUID 7674047E-6E47-4BF0-831F-209E3F9DD23F and then send a packet over it with the above contents. We attempt to open it to every paired device until we find one that accepts it (allow the user to select the device in the future?). The desktop app publishes the service with that UUID and listens on connections to it. USBUSB mode uses the debug bridge (ADB) to forward TCP connections between the device and the host. |
An example of the version 1 would be "jonas/1/RING/6672100343"
and of the version 2 would be "v2/10/1/RING/6672100343/Homer Simpson"
Am I right?
It would be nice if there was a possibility for a custom event type, something like ping so that a script could be executed on the computer by tapping an icon on the phone...