s2s:   Signal-to-Service mapping engine
1 Concepts
2 Example
3 Routing-loop discipline
9.3

s2s: Signal-to-Service mapping engine🔗ℹ

 (require s2s) package: s2s

S2S bridges the CAN signal world and the service world (DDS topics, SOME/IP events) with a config-driven routing engine, on top of the family’s dbc, dds and someip packages - the user-space take on Adaptive AUTOSAR’s Signal-to-Service conversion.

    1 Concepts

    2 Example

    3 Routing-loop discipline

1 Concepts🔗ℹ

  • Endpoints describe where a value lives, as tagged paths: (can (message 100) (signal EngineSpeed)), (dds (topic Speed) (member kph)), (someip (event 0x8010) (field rpm))

  • Samples are uniform hashes of symbol -> value across all three worlds (CAN physical values, DDS topic members, event fields)

  • Routes connect a source endpoint to a target endpoint with an optional transform ((scale s), (offset o), or any procedure)

  • The engine merges routed values into per-target state (initialized from the route’s (template ...)) and emits the complete state, so a DDS writer always publishes a full topic sample

  • Cascading: a successful emit re-ingests the target state into the same engine, so CAN->DDS->SOME/IP chains run on one bridge; a visited-set breaks per-chain loops

2 Example🔗ℹ

(require s2s)
 
(define router
  (make-router
   (list
    '((name . "telemetry-up")
      (from    can (message 100) (signal EngineSpeed))
      (to    dds (topic Speed) (member kph))
      (template    (kph . 0) (gear . 0)))
    '((name . "command-down")
      (from    someip (event 0x8010) (field rpm))
      (to    can (message 200) (signal CmdSpeed))))))
 
 
(define bridge (make-can-bridge engine-msg))
(define handle-frame (wire-can-source! router
                       (list '(can (message 100) (signal EngineSpeed)))
                       bridge))
 
 
(wire-dds-sink! router '(dds (topic Speed) (member kph)) speed-topic)
 
 
(wire-someip-sink! router '(someip (event 0x8010) (field rpm))
                   provider 32784 event-codec)

3 Routing-loop discipline🔗ℹ

The engine breaks loops within one ingest chain, but cross-transport feedback (a SOME/IP event that routes back onto the CAN message the telemetry came from) re-enters as a fresh chain and oscillates. Configure downlink traffic on its own messages/topics - the E2E test (test/s2s-e2e.rkt) demonstrates the uplink/downlink split.

Roadmap: SocketCAN transport, ARXML mapping import, per-route QoS (debounce, deadband), a config-file loader.