How to send Data using GT06 protocol?

vedant2 years ago

I am trying to send the GPS coordinates to Traccar GT06 device. But I Don't know how to send the data in flutter.

This is the Implementation

void sendDataToGT06Device() async {
final socket = await Socket.connect("3.108.199.67", 5023);

print("socket.isBroadcast ${socket.remoteAddress}");

Position position = await Geolocator.getCurrentPosition(
  desiredAccuracy: LocationAccuracy.best,
);

double lat = position.latitude;
double lng = position.longitude;

socket.write("Data");     }

what is the format for sending the data ? How to send the coordinates ?

Anton Tananaev2 years ago
vedant2 years ago

How to send lat long using flutter ?