Skip to content

Instantly share code, notes, and snippets.

@ova2
Created May 14, 2021 17:45
Show Gist options
  • Save ova2/d24b68cc2d203fc0b8f8f3c1487f94ea to your computer and use it in GitHub Desktop.
Save ova2/d24b68cc2d203fc0b8f8f3c1487f94ea to your computer and use it in GitHub Desktop.
Future<void> _requestTrackPositions(
String correlationId, String deviceId, String station, String trackNumber) async {
_messagingService.request(
topicRetrieveTrackPositionsQuery,
jsonEncode(RetrieveTrackPositionsQuery(
mobileDeviceId: deviceId,
correlationId: correlationId,
station: station,
trackNumber: trackNumber)));
}
Stream<TrackPositionsRetrievedResponse> _trackPositionRetrieved$(
String correlationId, String mobileDeviceId) {
return _messagingService
.updatesFor('$topicTrackPositionsRetrievedResponse/$mobileDeviceId')
.map((mqttMessage) => TrackPositionsRetrievedResponse.fromJson(mqttMessage.json));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment