I noticed in the changelog "Gideros Players are now discoverable in Gideros Studio automatically and available through dropdown". What's the API for that as I'm considering adding this functionality to ZeroBrane Studio?
> Should we expose discovery through gdrbridge/gdrdeamon ?
@hgy29, not sure yet. As far as I understand, it's probably UDP-based, so I'd like to know what port/messages to listen for. If it's not UDP-based, then how does Gideros Studio find players?
Yes, its UDP based. Players broadcast on UDP port 15000. Packet content is:
struct adv_ {uint8_t signature[8];// 'Gideros0'uint32_t ip;//INADDR_ANY for same as UDP peeruint16_t port;uint16_t flags;char devName[32];} advPacket;
All fields are in network endian (big endian). ip and port indicate tcp ip and port for on which to contact the player. flags is unused yet, but may at some point convey some flags/extend the protocol. I thought of encoding player type (Win,Android,iOS) in this field to provide visual feedback (icon) on display. signature is litterally "Gideros0", and devName is the friendly name of the device.
If ip holds the value INADDR_ANY (0 if I remember correctly), it means that the ip should be taken from the source of the udp message.
Comments
https://github.com/gideros/gideros/blob/master/ui/mainwindow.cpp#L430
which are sent by libnetwork:
https://github.com/gideros/gideros/blob/master/libnetwork/libnetwork.cpp#L528-L551
If you need more info, then @hgy29 implemented that functionality
Yes, feel free to ask for more details.
Should we expose discovery through gdrbridge/gdrdeamon ?
> Should we expose discovery through gdrbridge/gdrdeamon ?
@hgy29, not sure yet. As far as I understand, it's probably UDP-based, so I'd like to know what port/messages to listen for. If it's not UDP-based, then how does Gideros Studio find players?
ip and port indicate tcp ip and port for on which to contact the player. flags is unused yet, but may at some point convey some flags/extend the protocol. I thought of encoding player type (Win,Android,iOS) in this field to provide visual feedback (icon) on display. signature is litterally "Gideros0", and devName is the friendly name of the device.
If ip holds the value INADDR_ANY (0 if I remember correctly), it means that the ip should be taken from the source of the udp message.