Created
June 23, 2022 17:25
-
-
Save afzalali15/92eb0d1b2729234308d6e0b26da11a59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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