Repository navigation
Rework on public service discovery + ObserverDemo - #434
Open
KonradBreitsprecherBkd wants to merge 1 commit into
Open
KonradBreitsprecherBkd wants to merge 1 commit into
KonradBreitsprecherBkd wants to merge 1 commit into
Conversation
KonradBreitsprecherBkd
added this pull request to stack #435
October 5, 2026 13:44
KonradBreitsprecherBkd
force-pushed
the
dev_public_service_discovery_observer
branch
from
October 6, 2026 07:51
d6d0ac0 to
315bfd0
Compare
MariusBgm
force-pushed
the
dev_public_service_discovery_observer
branch
from
October 6, 2026 13:03
315bfd0 to
1e1dcb6
Compare
…s, observer demo
- Replace the catch-all Link kind with NetworkSimulatorLink, PubSubMatch and
RpcMatch. Matches are now reported as removed: after both endpoints are
known, and before the first endpoint's ServiceRemoved.
- Report each participant's LifecycleService and TimeSyncService.
- Rework SilKit_Experimental_ServiceDescriptor (unreleased, so not backward
compatible): serviceId / connectedServiceId as stable keys, typed
networkType, operationMode and timeSyncActive, an isSnapshot flag for the
services replayed on handler registration; drop the always empty
simulationName.
- Adapt the C++ hourglass, and extend the unit, integration and hourglass
tests.
- Add SilKitDemoObserver, a live terminal dashboard that joins a simulation
and shows, based only on the experimental service discovery and the
system monitor:
- the system state, and all participants with their state, operation
mode, time synchronization and services;
- the topology: bus networks with their controllers and network
simulators, and pub/sub topics and RPC functions with their matches;
- a concise log of every change, with new and removed elements
highlighted.
With --sim-time it also takes part in the virtual time synchronization to
show the global simulation time, without ever advancing alone.
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
MariusBgm
force-pushed
the
dev_public_service_discovery_observer
branch
from
October 6, 2026 14:32
1e1dcb6 to
8f61cd3
Compare
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experimental Service Discovery: Extensions to the PoC
This branch extends the proof of concept of the public, experimental service discovery
(
SilKit_Experimental_ServiceDiscovery_*insilkit/capi/Experimental.h, plus the C++ hourglassSilKit::Experimental::ServiceDiscovery). It adds two things:and are reported as removed.
Services carry stable ids, a typed bus type, and a flag for the initial snapshot.
SilKitDemoObserver): a live terminal dashboard built only on that API.1 - Service descriptor
What changed compared to the first PoC:
SilKit_Experimental_ServiceKind_Linkis replaced by the three link and match kinds.serviceId/connectedServiceIdidentify services independently of their names. A matchpoints directly at both of its endpoints.
strings in
serviceName/primaryIdentifier.ServiceCreatedwithisSnapshotset, synchronously insideSetServiceDiscoveryHandler. Later events haveit cleared. A consumer can thus show the existing simulation without treating it as a burst of changes.
simulationName, which was always empty, because services never carry the simulation name;only the VAsio peers do.
SilKit_Experimental_ServiceDescriptor(C) andSilKit::Experimental::ServiceDiscovery::ServiceDescriptor(C++):participantNameserviceNameserviceIdEndpointId); withparticipantNamea stable keyserviceKindprimaryIdentifiernetworkTypeSilKit_Experimental_SimulatedNetworkType: CAN, LIN, Ethernet, FlexRay) of bus controllers and netsim links;UndefinedotherwisemediaType,labelListoperationModeLifecycleServiceonly (SilKit_OperationMode);InvalidotherwisetimeSyncActiveTimeSyncServiceonlyconnectedParticipantName,connectedServiceName,connectedServiceIdisSnapshotFields that don't apply to a kind are empty, zero,
UndefinedorInvalid.primaryIdentifierCanController,EthernetController,FlexrayController,LinControllernetworkTypeDataPublisher,DataSubscriberRpcClient,RpcServerNetworkSimulatorLinknetworkTypePubSubMatchRpcMatchLifecycleServiceoperationModeTimeSyncServicetimeSyncActive2 - Links and matches
What changed
Previously, network-simulator links and pub/sub/RPC matches were all reported as
Link. Consumers had towork out the rest by convention:
connectedParticipantNamemeant a network-simulator link.ServiceRemovedof one ofits endpoints.
networkType.Now the kind alone says what a link or match is, and each is reported on both
ServiceCreatedandServiceRemoved. Pub/sub and RPC pairings are called matches, as in SIL Kit's matching ofpublishers/subscribers and clients/servers. Link is kept for network simulators, which are internally
ServiceType::Link.Guarantees
PubSubMatch/RpcMatchexists only while both of its endpoints are known. It is reported as createdafter both endpoints were reported, and as removed before the first endpoint's
ServiceRemoved.whichever comes first. It is reported as removed exactly once.
NetworkSimulatorLinkis reported on creation and removal of the simulated network. A simulated network isidentified by its bus type and its name, just like the bus controllers on it.
Implementation (
SilKit/source/capi/ServiceObserver.{hpp,cpp})VSilKit::ServiceObserverturns the internal service-discovery events into the public ones:Pending matches. Pub/sub and RPC matches are announced internally as
DataSubscriberInternal/RpcServerInternalendpoints. Such an endpoint becomes aPubSubMatch/RpcMatchonce the parent(subscriber/server) and the peer (publisher/client, identified by its UUID) are both known. Until then it
waits in
_pending.Emitted matches.
_emittedholds every match that was reported as created, keyed by(parent, peer UUID). Removals are taken from there:
HandleInternalMatch),HandlePeer),HandleParent).The match removals are emitted before the endpoint's own
ServiceRemoved.Network-simulator links. These are the internal
ServiceType::Linkdescriptors.ClassifyAndFillmaps them to
NetworkSimulatorLink, and maps the internal network type tonetworkType(
ToSimulatedNetworkType).Snapshot flag.
SilKit_Experimental_ServiceDiscovery_SetServiceDiscoveryHandler(CapiExperimental.cpp)remembers the registering thread while it calls
RegisterServiceDiscoveryHandler. The internal servicediscovery replays the known services synchronously on that thread, under its lock. An invocation on that
thread during the registration is therefore exactly a snapshot entry. The flag is applied to everything
emitted for that event, including matches it resolves.
Handler calls. The handler is always invoked outside the observer's mutex.
3 - Operation mode and time synchronization
Each participant announces its lifecycle and time sync services internally when it calls
StartLifecycle,with the supplemental data keys
LifecycleIsCoordinated(the operation mode) andTimeSyncActive. Theobserver used to suppress them as infrastructure. Now it reports them as
LifecycleService(withoperationMode) andTimeSyncService(withtimeSyncActive).Before
StartLifecycle, neither is known. SIL Kit never announces that a participant has no lifecycle,so consumers should treat a missing announcement as "unknown", not as "none".
4 - Observer demo (
Demos/tools/Introspection)SilKitDemoObserverjoins a simulation and draws a live dashboard. It is also the reference consumer ofthe API above:
networkTypeand name.