Skip to content

Instantly share code, notes, and snippets.

@afzalali15
Created June 23, 2022 17:25
Show Gist options
  • Save afzalali15/92eb0d1b2729234308d6e0b26da11a59 to your computer and use it in GitHub Desktop.
Save afzalali15/92eb0d1b2729234308d6e0b26da11a59 to your computer and use it in GitHub Desktop.
void main() {
List<String> robotUrls = getUrls();
for(var robotUrl in robotUrls)
{
var wsUrl = robotUrl.replaceAll('ws://','wss://');
initialRequest(wsUrl);
}
}
List<String> getUrls()
{
//make http call to get ws Urls
return ['ws://faith', 'ws://soul', 'ws://brett'];
}
initialRequest(String url)
{
print('//connecting to $url');
print('//waiting to open $url');
//sending subscribe operation
//listening to message
var data = "b\$GPRMC,171245.00,A,4500.032709,N,09316.210477,W,0.0,138.9,210622,0.8,E,A,V*53\\r\\n";
var info = data.split(',');
print(info[1]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment