Skip to content

Commit

Permalink
fix: driving mode, mock backend url, message header attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mghilardelli committed Oct 24, 2024
1 parent c98edc0 commit a977808
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions das_client/lib/flavor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ enum Flavor {
dev(
displayName: 'Dev',
//backendUrl: 'http://localhost:8080',
backendUrl: 'https://das-backend-dev.app.sbb.ch',
backendUrl: 'https://sfera-mock.app.sbb.ch',
mqttUrl: 'wss://das-poc.messaging.solace.cloud',
authenticatorConfig: _authenticatorConfigDev,
),
inte(
displayName: 'Inte',
//backendUrl: 'http://localhost:8080',
backendUrl: 'https://das-backend-dev.app.sbb.ch',
backendUrl: 'https://sfera-mock.app.sbb.ch',
mqttUrl: 'wss://das-poc.messaging.solace.cloud',
authenticatorConfig: _authenticatorConfigInte,
),
prod(
displayName: 'Prod',
//backendUrl: 'http://localhost:8080',
backendUrl: 'https://das-backend-dev.app.sbb.ch',
backendUrl: 'https://sfera-mock.app.sbb.ch',
mqttUrl: 'wss://das-poc.messaging.solace.cloud',
authenticatorConfig: _authenticatorConfigProd,
);
Expand Down
4 changes: 2 additions & 2 deletions das_client/lib/pages/fahrt/widgets/train_selection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class _TrainSelectionState extends State<TrainSelection> {
@override
void initState() {
super.initState();
_trainNumberController = TextEditingController(text: "9232");
_companyController = TextEditingController(text: "1088");
_trainNumberController = TextEditingController(text: "4816");
_companyController = TextEditingController(text: "1085");

context.fahrbildCubit.updateTrainNumber(_trainNumberController.text);
context.fahrbildCubit.updateCompany(_companyController.text);
Expand Down
12 changes: 9 additions & 3 deletions das_client/lib/service/sfera/sfera_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,15 @@ class SferaService {
_stateSubject.add(SferaServiceState.disconnected);
}

static Future<MessageHeader> messageHeader({TrainIdentification? trainIdentification}) async {
return MessageHeader.create(const Uuid().v4(), Format.sferaTimestamp(DateTime.now()),
await DeviceIdInfo.getDeviceId(), "TMS", await DeviceIdInfo.getDeviceId(), "TMS",
static Future<MessageHeader> messageHeader(
{TrainIdentification? trainIdentification}) async {
return MessageHeader.create(
const Uuid().v4(),
Format.sferaTimestamp(DateTime.now()),
await DeviceIdInfo.getDeviceId(),
"TMS",
"1085",
"0085",
trainIdentification: trainIdentification);
}

Expand Down
4 changes: 2 additions & 2 deletions das_client/lib/service/sfera/task/handshake_task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class HandshakeTask extends SferaTask {
Fimber.i("Sending handshake request for company=${otnId.company} train=$sferaTrain");
var handshakeRequest = HandshakeRequest.create([
DasOperatingModesSupported.create(
DasDrivingMode.goa1, DasArchitecture.boardAdviceCalculation, DasConnectivity.connected),
], relatedTrainRequestType: RelatedTrainRequestType.ownTrainAndRelatedTrains, statusReportsEnabled: true);
DasDrivingMode.readOnly, DasArchitecture.boardAdviceCalculation, DasConnectivity.connected),
], relatedTrainRequestType: RelatedTrainRequestType.ownTrainAndRelatedTrains, statusReportsEnabled: false);

var sferaB2gRequestMessage =
SferaB2gRequestMessage.create(await SferaService.messageHeader(), handshakeRequest: handshakeRequest);
Expand Down
2 changes: 1 addition & 1 deletion das_client/lib/util/format.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Format {

static String sferaTimestamp(DateTime date) {
final localDate = date.toLocal();
final dateFormat = DateFormat("yyyy-MM-ddTHH:mm:ssZ");
final dateFormat = DateFormat("yyyy-MM-ddTHH:mm:ss'Z'");
return dateFormat.format(localDate);
}

Expand Down

0 comments on commit a977808

Please sign in to comment.