OGDP can falsely identify other mobile devices sending inquiry packets as OG devices. This is because the received JSON is not checked for a "signature" to indicate it is a "real OG". :)
So, the received packet must be checked for:
- That it is valid JSON
- That the JSON has the following keys: "name", "randomFactoid". Both of these are sent in response to inbound OGDP Discovery packets.
In addition, the OGDP discovery packet sent by the mobile device should have the following structure:
{ "ip":"192.168.1.23", "action": "discover", "time": 142364758 }
Where the IP address is the mobile device's IP address and the time is the Unix timestamp of when the packet is being sent. NodeJS example below.
function sendPingFrom(ipAddress){
var pingMsg = JSON.stringify( { ip: ipAddress, action: "discover", time: Date.now() } );
server.send( pingMsg, 0, pingMsg.length, 9091, '255.255.255.255', function ( err ) {
if (err){
console.log("Error sending UDP ping!");
}
});
}
OGDP can falsely identify other mobile devices sending inquiry packets as OG devices. This is because the received JSON is not checked for a "signature" to indicate it is a "real OG". :)
So, the received packet must be checked for:
In addition, the OGDP discovery packet sent by the mobile device should have the following structure:
{ "ip":"192.168.1.23", "action": "discover", "time": 142364758 }
Where the IP address is the mobile device's IP address and the time is the Unix timestamp of when the packet is being sent. NodeJS example below.