Connecting to a GPS Deamon service in c# -
i working on application need location through gpsd service. using c# library (same project), not supported gpsd itself, don't have library. that's why trying create own library (and make nuget package of it).
but got stuck following problem. connection gpsd service through sockets, , following data:
{"class":"version","release":"3.11","rev":"3.11-3","proto_major":3,"proto_minor":9}
so connection working, don't know how gps data itself, there not documentation so, does have experience this, or know how can achieve this?
using (var client = connectviahttpproxy(serveraddress, port, proxyaddress, port)) { while (client.connected) { var result = new byte[256]; client.client.receive(result); //_response = encoding.utf8.getstring(result, 0, result.length); _response = encoding.ascii.getstring(result, 0, result.length); var resultclass = jsonconvert.deserializeobject<gpsddata>(_response); console.writeline(resultclass.tostring()); thread.sleep(10); } client.close(); }
i found out how connect service: @x...
says in link: link
the command need send is:
var bytedata = encoding.ascii.getbytes("?watch={\"enable\":true,\"json\":true}"); client.client.send(bytedata);
Comments
Post a Comment