Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support all VDV-453/-454 services #4

Open
derhuerst opened this issue Sep 17, 2024 · 2 comments
Open

support all VDV-453/-454 services #4

derhuerst opened this issue Sep 17, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@derhuerst
Copy link
Member

derhuerst commented Sep 17, 2024

This client should support all VDV-453/VDV-454 services, not just those that VBB currently uses.

vdv-453-client/index.js

Lines 19 to 30 in 0ace9f3

const {
DFI,
// REF_DFI,
// ANS,
// REF_ANS,
// > Dieser Dienst wird derzeit nicht von der VBB Datendrehscheibe unterstützt.
// VIS,
// > Dieser Dienst wird derzeit nicht von der VBB Datendrehscheibe unterstützt.
// AND,
AUS,
// REF_AUS,
} = SERVICES

vdv-453-client/index.js

Lines 51 to 56 in 0ace9f3

const ABO_ANFRAGE_ROOT_SUB_TAGS_BY_SERVICE = new Map([
[DFI, 'AboAZB'],
// [REF_DFI, 'AboAZBRef'],
[AUS, 'AboAUS'],
// [REF_AUS, 'AboAUSRef'],
])

vdv-453-client/index.js

Lines 70 to 76 in 0ace9f3

const DATEN_ABRUFEN_ANTWORT_ROOT_SUB_TAGS_BY_SERVICE = new Map([
[DFI, 'AZBNachricht'],
// [REF_DFI, 'AZBNachricht'],
// todo: rather pick AUSNachricht children (FahrtVerband, Linienfahrplan, SollUmlauf, IstFahrt, IstUmlauf, GesAnschluss)? – AUSNachricht has ~500kb of children, so this would lead to smaller XML trees being read into memory
[AUS, 'AUSNachricht'],
// [REF_AUS, 'AUSNachricht'],
])

vdv-453-client/index.js

Lines 543 to 550 in 0ace9f3

_handleClientStatusAnfrage(DFI)
// _handleClientStatusAnfrage(REF_DFI)
// _handleClientStatusAnfrage(ANS)
// _handleClientStatusAnfrage(REF_ANS)
// _handleClientStatusAnfrage(VIS)
// _handleClientStatusAnfrage(AND)
_handleClientStatusAnfrage(AUS)
// _handleClientStatusAnfrage(REF_AUS)

vdv-453-client/index.js

Lines 738 to 751 in 0ace9f3

return {
logger,
sendRequest,
httpServer,
data,
dfiSubscribe,
dfiUnsubscribe,
dfiUnsubscribeAll,
dfiFetchData,
ausSubscribe,
ausUnsubscribe,
ausUnsubscribeAll,
ausFetchData,
}

// service + ':' + call -> response body's root elements
const CLIENT_RESPONSE_ROOT_ELS_BY_PATH = new Map([
[SERVICES.DFI + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
[SERVICES.DFI + ':' + SERVER_CALLS.DATEN_BEREIT, 'DatenBereitAntwort'],
// todo: other calls on DFI
[SERVICES.REF_DFI + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
[SERVICES.REF_DFI + ':' + SERVER_CALLS.DATEN_BEREIT, 'DatenBereitAntwort'],
// todo: other calls on REF_DFI
[SERVICES.ANS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on ANS
[SERVICES.REF_ANS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on REF_ANS
[SERVICES.VIS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on VIS
[SERVICES.AND + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on AND
[SERVICES.AUS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on AUS
[SERVICES.REF_AUS + ':' + SERVER_CALLS.CLIENT_STATUS, 'ClientStatusAntwort'],
// todo: other calls on REF_AUS
])

vdv-453-client/index.js

Lines 127 to 128 in be70352

// The VBB VDV-453 system doesn't seem to notify us about new/changed data (see _handleDatenBereitAnfrage), so we fetch the data "manually" periodically.
fetchSubscriptionsDataPeriodically: true,

@derhuerst derhuerst added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 17, 2024
@dancesWithCycles
Copy link

How about an on-demand procedure? I reckon AUS is the most important service, isn't it? If my memory services me right, the AUS service delivers the realtime information.

@derhuerst
Copy link
Member Author

derhuerst commented Sep 18, 2024

How about an on-demand procedure?

What do you mean?

I reckon AUS is the most important service, isn't it? If my memory services me right, the AUS service delivers the realtime information.

I agree: DFI (for realtime arrivals/departures) and ANS(trip-based realtime data) seem relevant to me as soon asAUS` is not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants