DEENESPTFRRUARHIKOZHNL

LIN State Manager (LinSM)

ModulLinSM (LIN State Manager)
BSW-Modul-ID141
Standard-Header#include "LinSM.h"
SWS-SpezifikationAUTOSAR_SWS_LINStateManager.pdf
ClusterLIN

Module guideAI-GENERATED

Controls communication mode, wakeup, sleep, and schedule table switching per LIN network.
AI-GENERATED unreviewed Model: claude-opus-5-5 · Effort: high · Temperature: not controllable · Prompt: 4c8293bd0eb8 Provenance Open questions (2)
Causal anchor: R20-11 Valid from R20-11 Synthesized for this specification release.
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Controls communication mode, wakeup, sleep, and schedule table switching per LIN network.

The LIN State Manager translates the communication requests of ComM per LIN network into calls to the LIN Interface. It reports the resulting states LINSM_FULL_COM and LINSM_NO_COM to ComM and BswM [SWS_LinSM_00126]. It starts wakeup, sleep, and—only on the master—the switch of the schedule table directly and monitors confirmations with timers in LinSM_MainFunction. On the slave, the master determines going to sleep: only LinSM_GotoSleepIndication triggers LinIf_GotoSleep [SWS_LinSM_00231]. If a transition fails, LinSM reports the previous state again so that the upper layers remain consistent.

The LIN State Manager is the bus state manager for LIN. Through it, ComM requests the communication capability of a network (SWS ComM p. 19). It accepts mode requests via LinSM_RequestComMode [SWS_LinSM_00126]. It controls LinIf and reports states to ComM and BswM [SWS_LinSM_00229]. Which LIN driver serves a network remains hidden behind LinIf (SWS LinSM p. 28).

kontext ComM ComM LinSM LinSM ComM->LinSM LinSM_RequestComMode LinSM_GetCurrentComMode BswM BswM BswM->LinSM LinSM_Init (Beispielregel) LinSM_ScheduleRequest SchM BSW-Scheduler (SchM) SchM->LinSM LinSM_MainFunction (periodisch) LinSM->ComM ComM_BusSM_ModeIndication ComM_BusSM_BusSleepMode LinSM->BswM BswM_LinSM_CurrentState BswM_LinSM_CurrentSchedule LinIf LinIf LinSM->LinIf LinIf_Wakeup / LinIf_GotoSleep LinIf_ScheduleRequest / LinIf_SetTrcvMode Det Det LinSM->Det Fehlermeldungen LinIf->LinSM LinSM_WakeupConfirmation LinSM_GotoSleepConfirmation LinSM_GotoSleepIndication LinSM_ScheduleRequestConfirmation Lin LIN driver (one or more) LinIf->Lin Zuordnung Netzwerk zu Treiber

Context diagram: ComM and BswM control LinSM, LinSM controls LinIf, and LinIf reports back via callbacks. Sources: [SWS_LinSM_00229], [SWS_LinSM_00138], SWS LinSM p. 28

After LinSM_Init, every network is in LINSM_NO_COM [SWS_LinSM_00155]. ComM and BswM are not notified in this process (SWS LinSM p. 23). Communication is permitted only in LINSM_FULL_COM. Upon entry, ComM and BswM receive a notification, and the substate LINSM_RUN_COMMUNICATION is entered [SWS_LinSM_00301]. Only LINSM_FULL_COM and LINSM_NO_COM are visible to BswM [SWS_LinSM_00220].

zustaende cluster_init LINSM_INIT (je LIN-Netzwerk) cluster_full LINSM_FULL_COM Start Systemstart UNINIT LINSM_UNINIT Start->UNINIT NO_COM LINSM_NO_COM (Bus still) UNINIT->NO_COM LinSM_Init (no notification to ComM/BswM) RUN LINSM_RUN_COMMUNICATION NO_COM->RUN LinSM_WakeupConfirmation(TRUE) FULL_COM notification to ComM and BswM GOTO LINSM_GOTO_SLEEP RUN->GOTO LinIf_GotoSleep returns E_OK Master: ComM requests NO_COM Slave: LinSM_GotoSleepIndication GOTO->NO_COM LinSM_GotoSleepConfirmation (regardless of success) NO_COM notification to ComM and BswM

State diagram: Per network, LinSM transitions between LINSM_NO_COM and LINSM_FULL_COM via wakeup and sleep confirmation. Sources: [SWS_LinSM_00155], [SWS_LinSM_00301], SWS LinSM p. 20

LinSM initiates wakeup and sleep directly in the call. It monitors the confirmations of LinIf with timers in LinSM_MainFunction [SWS_LinSM_00156] (SWS LinSM p. 28). On the master, a request for COMM_NO_COMMUNICATION leads immediately to LinIf_GotoSleep [SWS_LinSM_00036]. On the slave, it is only stored [SWS_LinSM_00230]; only LinSM_GotoSleepIndication triggers going to sleep [SWS_LinSM_00231]. A silence-after-wakeup timer delays repeated wakeup attempts [SWS_LinSM_00237].

Schedule switching exists only on the master [SWS_LinSM_00241]. LinSM forwards LinSM_ScheduleRequest directly to LinIf and reports the result via BswM_LinSM_CurrentSchedule (SWS LinSM p. 26). For errors, the following applies:

  • LinSM reports development errors to DET, with the codes from [SWS_LinSM_00053].
  • An absent callback from LinIf is considered a LINSM_E_CONFIRMATION_TIMEOUT [SWS_LinSM_00224].
  • After a failed transition, LinSM sets the previous state again so that ComM and BswM remain consistently informed [SWS_LinSM_00177].

Role between ComM, BswM, and LIN Interface

The LIN State Manager (LinSM) is the bus state manager for LIN. As with the other bus state managers, ComM requests the communication capability of a network via it (SWS ComM p. 19). The central input interface for this is LinSM_RequestComMode [SWS_LinSM_00126]. The current mode is provided by LinSM_GetCurrentComMode [SWS_LinSM_00122]. LinSM operates exclusively on networks. LinIf conceals which LIN driver serves a network. Therefore, ECUs with multiple different LIN drivers do not affect LinSM (SWS LinSM p. 28).

The mandatory interfaces include LinIf_GotoSleep and LinIf_ScheduleRequest downwards as well as notifications ComM_BusSM_ModeIndication, ComM_BusSM_BusSleepMode, BswM_LinSM_CurrentState, and BswM_LinSM_CurrentSchedule upwards [SWS_LinSM_00229] (SWS LinSM p. 41). LinSM calls LinIf_Wakeup in the wake-up sequence (SWS LinSM p. 27). Optionally, it uses Det_ReportError and LinIf_SetTrcvMode [SWS_LinSM_00138]. LinIf reports back via the following callbacks:

The imported types such as ComM_ModeType, NetworkHandleType, and LinIf_SchHandleType are defined by [SWS_LinSM_00219].

kontext ComM ComM LinSM LinSM ComM->LinSM LinSM_RequestComMode LinSM_GetCurrentComMode BswM BswM BswM->LinSM LinSM_Init (Beispielregel) LinSM_ScheduleRequest SchM BSW-Scheduler (SchM) SchM->LinSM LinSM_MainFunction (periodisch) LinSM->ComM ComM_BusSM_ModeIndication ComM_BusSM_BusSleepMode LinSM->BswM BswM_LinSM_CurrentState BswM_LinSM_CurrentSchedule LinIf LinIf LinSM->LinIf LinIf_Wakeup / LinIf_GotoSleep LinIf_ScheduleRequest / LinIf_SetTrcvMode Det Det LinSM->Det Fehlermeldungen LinIf->LinSM LinSM_WakeupConfirmation LinSM_GotoSleepConfirmation LinSM_GotoSleepIndication LinSM_ScheduleRequestConfirmation Lin LIN driver (one or more) LinIf->Lin Zuordnung Netzwerk zu Treiber

Context diagram: LinSM mediates between ComM and BswM at the top and LinIf at the bottom; the LIN drivers remain hidden behind LinIf. Sources: [SWS_LinSM_00126], [SWS_LinSM_00229], [SWS_LinSM_00138], [SWS_LinSM_00156], SWS LinSM p. 28, Mode-Management-Guide p. 54

State model per LIN network, initialization, and cyclic part

At startup, prior to any API call, the module-wide state LINSM_UNINIT is active (SWS LinSM p. 22). LinSM_Init is synchronous and non-reentrant [SWS_LinSM_00155]. The function receives a pointer to the post-build configuration of implementation-specific type LinSM_ConfigType [SWS_LinSM_00221]. After this, each network is in substate LINSM_NO_COM of superstate LINSM_INIT. LinSM_Init does not report this initial transition to either ComM or BswM, because ComM does not need to be initialized at this point (SWS LinSM p. 23). In the example of the Mode Management Guide, a BswM rule calls LinSM_Init(null) after Lin_Init and LinIf_Init (Mode-Management-Guide p. 54).

In LINSM_NO_COM, the bus remains silent (SWS LinSM p. 23). Bus communication is only permitted in LINSM_FULL_COM, and each network reaches this state independently of the others. Upon entry, the following occurs (SWS LinSM p. 23):

  • ComM receives a notification with COMM_FULL_COMMUNICATION, BswM receives a notification with LINSM_FULL_COM.
  • If LinSMTransceiverPassiveMode is configured, LinSM activates the transceiver via LinIf_SetTrcvMode.
  • Substate LINSM_RUN_COMMUNICATION is entered [SWS_LinSM_00301].

The transient substate LINSM_GOTO_SLEEP bridges the wait for the sleep confirmation (SWS LinSM p. 20, SWS LinSM p. 21). For BswM, only two values of LinSM_ModeType are visible: LINSM_FULL_COM (0x01) and LINSM_NO_COM (0x02) [SWS_LinSM_00220].

Time monitoring runs in LinSM_MainFunction. This periodic function manages the timers of the request timeouts [SWS_LinSM_00156]. The wake-up confirmation timers also expire there, with a dedicated timer per network (SWS LinSM p. 28). In contrast, LinSM initiates the actual bus actions directly within the call and does not wait for the next main function cycle [SWS_LinSM_00036] [SWS_LinSM_00231].

zustaende cluster_init LINSM_INIT (je LIN-Netzwerk) cluster_full LINSM_FULL_COM Start Systemstart UNINIT LINSM_UNINIT Start->UNINIT NO_COM LINSM_NO_COM (Bus still) UNINIT->NO_COM LinSM_Init (no notification to ComM/BswM) RUN LINSM_RUN_COMMUNICATION NO_COM->RUN LinSM_WakeupConfirmation(TRUE) FULL_COM notification to ComM and BswM GOTO LINSM_GOTO_SLEEP RUN->GOTO LinIf_GotoSleep returns E_OK Master: ComM requests NO_COM Slave: LinSM_GotoSleepIndication GOTO->NO_COM LinSM_GotoSleepConfirmation (regardless of success) NO_COM notification to ComM and BswM

State diagram: Per network, LinSM transitions between LINSM_NO_COM and LINSM_FULL_COM through wake-up and sleep confirmations; LINSM_GOTO_SLEEP is merely a wait state. Sources: [SWS_LinSM_00155], [SWS_LinSM_00301], SWS LinSM p. 20, SWS LinSM p. 21, SWS LinSM p. 24

Wake-up: from LINSM_NO_COM to LINSM_FULL_COM

A LIN network is woken up when ComM requests full communication via LinSM_RequestComMode. If another node wakes the bus, this is handled not by LinSM, but by EcuM; this case also leads to a request by ComM (SWS LinSM p. 27). LinSM then calls LinIf_Wakeup directly and resets the counter for the maximum number of retries. If LinIf is already awake, it ignores the call. Prior to the call, LinSM starts the wake-up confirmation timer for the channel using LinSMConfirmationTimeout. This value must be 0 or an integer multiple of the main function period (SWS LinSM p. 28).

If LinSM_WakeupConfirmation reports success = TRUE, the network transitions to LINSM_FULL_COM [SWS_LinSM_00132]. In all other cases, LinSM re-sets the state prior to the request so that ComM and BswM still receive a mode indication (SWS LinSM p. 27). For a slave, LinIf does not confirm until it receives the master's first LIN header. If the master does not start scheduling, the confirmation is absent, and the LinSM timeout takes effect (SWS LinIf p. 52).

Waking up a LIN network (internal wakeup)ComMLinSMLinIfBswMLinSM_RequestComMode(network,COMM_FULL_COMMUNICATION)Start wakeup confirmation timer(LinSMConfirmationTimeout)LinIf_Wakeup(Channel)Directly, not in LinSM_MainFunctionE_OKE_OKMaster: confirmation after sending wakeup signalSlave: confirmation with first received LIN headeraltsuccess = TRUELinSM_WakeupConfirmation(network, TRUE)Timer stoppenLINSM_FULL_COM / LINSM_RUN_COMMUNICATIONComM_BusSM_ModeIndication(network,COMM_FULL_COMMUNICATION)BswM_LinSM_CurrentState(network, LINSM_FULL_COM)success = FALSELinSM_WakeupConfirmation(network, FALSE)Restore state prior to requestComM_BusSM_ModeIndication(network, bisheriger Modus)BswM_LinSM_CurrentState(network, bisheriger Zustand)No confirmationLinSM_MainFunction: Timer abgelaufenLINSM_E_CONFIRMATION_TIMEOUT

Sequence diagram: LinSM wakes the network immediately within the call, but the state change only follows with the asynchronous confirmation from LinIf. Sources: [SWS_LinSM_00126], [SWS_LinSM_00132], [SWS_LinSM_00224], SWS LinSM p. 42, SWS LinSM p. 27

A second time limit is the silence-after-wakeup timer with LinSMSilenceAfterWakeupTimeout [SWS_LinSM_00235]. As long as it is running, LinSM delays a new call to LinIf_Wakeup, even if ComM requests full communication [SWS_LinSM_00237]. After it expires, LinSM restarts the wake-up process provided that ComM continues to request COMM_FULL_COMMUNICATION [SWS_LinSM_00236]. The condition that starts the timer is specified in a requirement that is not present here. It is therefore not described.

wakeup_entscheidung A ComM: LinSM_RequestComMode (COMM_FULL_COMMUNICATION) B Silence-after-wakeup timer running? A->B C Delay LinIf_Wakeup until timer expiry B->C yes D Reset retry counter, start wakeup confirmation timer B->D no C->D Timer abgelaufen E LinIf_Wakeup(Channel) direkt aufrufen D->E F Feedback from LinIf? E->F G LINSM_FULL_COM, notification to ComM and BswM F->G WakeupConfirmation TRUE H Reset and report state prior to the request F->H WakeupConfirmation FALSE I LinSM_MainFunction: Timer abgelaufen LINSM_E_CONFIRMATION_TIMEOUT F->I No confirmation J Silence-after-wakeup timeout and COMM_FULL_COMMUNICATION still requested J->D Restart wakeup process

Activity diagram: Depending on timer states and feedback, a request for full communication ends in LINSM_FULL_COM, in the previous state, or in a confirmation timeout. Sources: [SWS_LinSM_00237], [SWS_LinSM_00236], [SWS_LinSM_00224], SWS LinSM p. 27, SWS LinSM p. 28

Going to sleep: Master requests, slave follows the bus

The go-to-sleep sequence differs between master and slave. In both cases, LinSM reports the entry into no-communication mode to BswM and ComM, even if a problem occurred (SWS LinSM p. 24).

For the master, the following applies:

  • If ComM requests COMM_NO_COMMUNICATION in LINSM_FULL_COM, LinSM calls LinIf_GotoSleep, which transmits the go-to-sleep command [SWS_LinSM_10208].
  • The call occurs directly [SWS_LinSM_00036]. In all other cases, it is omitted [SWS_LinSM_10209].
  • The call is only permitted in substate LINSM_RUN_COMMUNICATION (SWS LinSM p. 24).
  • If LinIf_GotoSleep returns E_NOT_OK, LinSM_RequestComMode also returns E_NOT_OK. The previous state is set again so that ComM and BswM receive an indication [SWS_LinSM_00177].

After that, LinIf calls LinSM_GotoSleepConfirmation [SWS_LinSM_00135]. If LinSM is then in LINSM_FULL_COM/LINSM_GOTO_SLEEP, it transitions to LINSM_NO_COM, regardless of the success parameter. In any other state, it ignores the confirmation (SWS LinSM p. 24). The diagram in the specification starts a timer before LinIf_GotoSleep and stops it after the confirmation (SWS LinSM p. 47).

Transition to sleep of a LIN network (master)ComMLinSMLinIfBswMLinSM_RequestComMode(network,COMM_NO_COMMUNICATION)Only in LINSM_FULL_COM / LINSM_RUN_COMMUNICATIONDirect call, not in LinSM_MainFunctionstart_timer()LinIf_GotoSleep(Channel)altLinIf_GotoSleep = E_OKE_OKUnterzustand LINSM_GOTO_SLEEPE_OKLinSM_GotoSleepConfirmation(network, success)stop_timer()LINSM_NO_COM (regardless of success)ComM_BusSM_ModeIndication(network,COMM_NO_COMMUNICATION)BswM_LinSM_CurrentState(network, LINSM_NO_COM)LinIf_GotoSleep = E_NOT_OKE_NOT_OKbisherigen Zustand erneut setzenE_NOT_OKComM_BusSM_ModeIndication(network,COMM_FULL_COMMUNICATION)BswM_LinSM_CurrentState(network, LINSM_FULL_COM)

Sequence diagram: For the master, ComM initiates going to sleep; LINSM_NO_COM is reached only with the sleep confirmation, an E_NOT_OK from LinIf_GotoSleep leads to re-reporting the previous state. Sources: [SWS_LinSM_00036], [SWS_LinSM_00177], [SWS_LinSM_00135], SWS LinSM p. 47, SWS LinSM p. 24

For the slave, the master decides on going to sleep. If ComM requests COMM_NO_COMMUNICATION in LINSM_FULL_COM, LinSM merely stores the request and returns E_OK [SWS_LinSM_00230]. LinIf reports LinSM_GotoSleepIndication when a go-to-sleep command was received or a bus idle timeout occurred [SWS_LinSM_91000]. Only then does LinSM directly call LinIf_GotoSleep [SWS_LinSM_00231]. How the process continues depends on the stored request:

  • If COMM_NO_COMMUNICATION is requested and LinIf_GotoSleep returns E_OK, ComM is notified of the bus sleep event via ComM_BusSM_BusSleepMode [SWS_LinSM_00233].
  • If full communication is requested, LinSM restarts the wake-up process after the sleep confirmation [SWS_LinSM_00234].

In LinIf, the slave sequence puts the controller and, if supported, the transceiver into sleep mode (SWS LinIf p. 137).

Transition to sleep of a LIN network (slave)ComMLinSMLinIfBswMUse Case: Sleep request from ComMLinSM_RequestComMode(network,COMM_NO_COMMUNICATION)angeforderten Modus speichern,No further actionE_OKUse Case: BusereignisLinSM_GotoSleepIndication(Channel)Goto-Sleep-Kommando empfangenOr bus idle timeoutstart_timer()LinIf_GotoSleep(Channel)Directly, not in LinSM_MainFunctionE_OKaltangefordert: COMM_NO_COMMUNICATIONComM_BusSM_BusSleepMode(Channel)LinSM_GotoSleepConfirmation(network, success)stop_timer()LINSM_NO_COMComM_BusSM_ModeIndication(network,COMM_NO_COMMUNICATION)BswM_LinSM_CurrentState(network, LINSM_NO_COM)angefordert: COMM_FULL_COMMUNICATIONLinSM_GotoSleepConfirmation(network, success)LINSM_NO_COM, notification to ComM and BswMkein Bus-Sleep-Ereignis an ComMRestart wakeup process (LinIf_Wakeup)

Sequence diagram: For the slave, ComM's sleep request is merely stored; going to sleep is triggered by the indication from LinIf. Sources: [SWS_LinSM_00230], [SWS_LinSM_00231], [SWS_LinSM_00233], [SWS_LinSM_00234], SWS LinSM p. 48, SWS LinSM p. 24

Switching schedule tables (master only)

LinSM_ScheduleRequest [SWS_LinSM_00113] exists only if at least one channel is configured as master [SWS_LinSM_00241]. The same applies to the callback LinSM_ScheduleRequestConfirmation [SWS_LinSM_00242]. The asynchronous function forwards the request directly to LinIf_ScheduleRequest without routing it through the main function. It returns LinIf's return value to the caller (SWS LinSM p. 26). The caller is BswM. It uses LinSMScheduleIndex as a symbolic reference whose value must correspond to the value in LinIf (SWS LinSM p. 52). Diagnostic schedule switches of the LIN transport protocol also run via BswM and LinSM_ScheduleRequest (SWS LinIf p. 142).

LinSM reports the result via BswM_LinSM_CurrentSchedule (SWS BswM p. 80). Which schedule is reported depends on the execution course (SWS LinSM p. 26):

  • If LinSM_ScheduleRequestConfirmation confirms [SWS_LinSM_00129] before the timer expires, LinSM reports the new schedule.
  • If the timer has expired, it reports the unchanged schedule.
  • If LinIf_ScheduleRequest returns E_NOT_OK, it reports the old schedule in the next main function call.
  • It also reports a change without a prior request, such as the switch to the NULL schedule performed by LinIf when going to sleep.
Schedule table switch (master only)BswMLinSMLinIfLinSM_ScheduleRequest(network, schedule)start_timer()LinIf_ScheduleRequest(Channel, schedule)Directly, not in LinSM_MainFunctionaltE_OK, confirmation before timer expiryE_OKE_OK (weitergereicht)LinSM_ScheduleRequestConfirmation(network, schedule)stop_timer()BswM_LinSM_CurrentSchedule(network, neuer Schedule)E_OK, Timer abgelaufenE_OKE_OK (weitergereicht)LinSM_MainFunction: Timer abgelaufenBswM_LinSM_CurrentSchedule(network, unchanged schedule)LinIf_ScheduleRequest = E_NOT_OKE_NOT_OKE_NOT_OK (weitergereicht)Next call of LinSM_MainFunctionBswM_LinSM_CurrentSchedule(network, alter Schedule)

Sequence diagram: The schedule switch is forwarded directly and monitored by timer; BswM is notified of the actually valid schedule in every outcome. Sources: [SWS_LinSM_00113], [SWS_LinSM_00129], [SWS_LinSM_00156], SWS LinSM p. 26, SWS LinSM p. 48

Node type, configuration, and differences from later releases

The parameter LinSMNodeType determines whether master or slave behavior applies to a channel. This governs whether LinSM_ScheduleRequest, LinSM_ScheduleRequestConfirmation, and LinSM_GotoSleepIndication are available [SWS_LinSM_00241] [SWS_LinSM_00242] [SWS_LinSM_00243]. The most important timing parameters are LinSMConfirmationTimeout (SWS LinSM p. 28) and LinSMSilenceAfterWakeupTimeout [SWS_LinSM_00235]. The LinSMSchedule containers reference schedules from the LinIf configuration (SWS LinSM p. 52). The DET checks depend on LinSMDevErrorDetect [SWS_LinSM_00239].

Many document references originate from later releases. For R20-11, the requirements are authoritative, and in several places they diverge:

Behavior in the event of an error

The development errors are defined by [SWS_LinSM_00053]:

  • LINSM_E_UNINIT (0x00)
  • LINSM_E_NONEXISTENT_NETWORK (0x20)
  • LINSM_E_PARAMETER (0x30)
  • LINSM_E_PARAM_POINTER (0x40)
  • LINSM_E_INIT_FAILED (0x50)

When LinSMDevErrorDetect is enabled, the callbacks check the network and initialization, such as LinSM_GotoSleepIndication [SWS_LinSM_00239] [SWS_LinSM_00240]. Callbacks do not have a return value, so only the DET notification remains there (SWS LinSM p. 40, SWS LinSM p. 39). APIs with Std_ReturnType additionally return E_NOT_OK, for example in case of an invalid network, mode, or schedule, or in state LINSM_UNINIT (SWS LinSM p. 36, SWS LinSM p. 34). Interpretation: These checks originate from versions R24-11 onwards and likely apply with identical content to R20-11. Notably, the later version also requires E_NOT_OK for a NULL pointer for the void API LinSM_GetVersionInfo [SWS_LinSM_00117] (SWS LinSM p. 34). Question Q-6b2d75dd286bdcb4 (open)

As a runtime error, LINSM_E_CONFIRMATION_TIMEOUT (0x00) is designated for missing callbacks from LinIf [SWS_LinSM_00224]. Presumably, it is reported via Det_ReportRuntimeError, which later versions list as a mandatory interface (SWS LinSM p. 41). Question Q-06b13a07d0d60152 (open) Functionally, LinSM ensures that ComM and BswM always observe a consistent state:

  • After a failed wake-up, it re-sets and re-reports the old state (SWS LinSM p. 27).
  • In case of E_NOT_OK from LinIf_GotoSleep, the same applies [SWS_LinSM_00177].
  • A sleep confirmation leads to LINSM_NO_COM even with success = FALSE (SWS LinSM p. 24).
  • Upon a failed schedule switch, BswM receives the old or unchanged schedule (SWS LinSM p. 26).

Further detailed evidence

AI-generated module guide based on the normative requirements for R20-11 and the associated document sections and diagrams, some of which originate from other releases. Statements labeled as interpretation are not normatively verified. Only the AUTOSAR specification is authoritative.

LIN State Manager (LinSM)

Manages state transitions of LIN networks.

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

function LinSM_Init [SWS_LinSM_00155] 📄 PDF

void LinSM_Init (const LinSM_ConfigType* ConfigPtr);

This function initializes the Lin SM.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 18f94187e199 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function LinSM_Init serves to initialize the LIN State Manager (LinSM) software module in the AUTOSAR Classic Platform [SWS_LinSM_00155].

Usage and interface parameters:

  • Call synchronization: The execution of the initialization function is specified as synchronous (Synchronous) [SWS_LinSM_00155].
  • Input parameters: As the only parameter, ConfigPtr of type const LinSM_ConfigType* is passed [SWS_LinSM_00155]. This functions as a pointer to the post-build configuration data of LinSM [SWS_LinSM_00155].
  • Further parameters and return value: The interface returns no return value (void) [SWS_LinSM_00155]. Additional input/output parameters or pure output parameters do not exist [SWS_LinSM_00155].
  • Header file and service identifier: The declaration is provided via header file LinSM.h and carries the service ID 0x01 [SWS_LinSM_00155].

Concurrency and restrictions:

For the execution of LinSM_Init, it is defined that the function is non-reentrant (Non reentrant) [SWS_LinSM_00155]. Consequently, the call must neither occur in parallel across multiple threads nor interruptively by higher-prioritized contexts [SWS_LinSM_00155].

This usage note was generated automatically based on the specification AUTOSAR CP R20-11.

Implementer's Guide to follow (complexity I2)

function LinSM_ScheduleRequest [SWS_LinSM_00113] 📄 PDF

Std_ReturnType LinSM_ScheduleRequest (NetworkHandleType network, LinIf_SchHandleType schedule);

The upper layer requests a schedule table to be changed on one LIN network.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f2deb9e24090 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The function LinSM_ScheduleRequest is called by the upper layer to request the switch of a schedule table on a specified LIN channel [SWS_LinSM_00113]. The interface is defined in header file LinSM.h, has the service ID 0x10, and operates asynchronously as well as reentrantly [SWS_LinSM_00113]. Upon calling, the affected channel is passed via parameter network (NetworkHandleType) and the desired new table via schedule (LinIf_SchHandleType) [SWS_LinSM_00113].

Error Handling and Return Values

If the request for schedule table switching was accepted by the module, the function returns E_OK [SWS_LinSM_00113]. If, however, the call cannot be executed—for example because the module is not yet initialized—the function provides the return value E_NOT_OK [SWS_LinSM_00113]. Specific error codes for DET or DEM are not listed for this service.

Constraints and Interaction

The provision of the function depends essentially on configuration parameter LinSMNodeType: LinSM_ScheduleRequest is exclusively available if the module is configured as a LIN master node on at least one channel, and is omitted in pure LIN slave configurations [SWS_LinSM_00241]. In an identical manner, the associated confirmation function LinSM_ScheduleRequestConfirmation also requires a master node configuration [SWS_LinSM_00242]. Feedback about the successfully completed asynchronous table switch to the upper layer is presumably likely to occur via this confirmation function. Question Q-34c3ec02381c72ca (open)

This text was created by an AI; the AUTOSAR specification is authoritative.

Implementer's Guide to follow (complexity I1)

function LinSM_GetCurrentComMode [SWS_LinSM_00122] 📄 PDF

Std_ReturnType LinSM_GetCurrentComMode (NetworkHandleType network, ComM_ModeType* mode);

Function to query the current communication mode.

function LinSM_RequestComMode [SWS_LinSM_00126] 📄 PDF

Std_ReturnType LinSM_RequestComMode (NetworkHandleType network, ComM_ModeType mode);

Requesting of a communication mode. The mode switch will not be made instant. The Lin SM will notify the caller when mode transition is made.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 64785219821f Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Call Context

The function LinSM_RequestComMode declared in header file LinSM.h (Service ID 0x12) serves to asynchronously request a communication mode for a passed LIN network [SWS_LinSM_00126]. The parameter network of type NetworkHandleType identifies the LIN channel concerned, while mode of type ComM_ModeType specifies the requested communication mode [SWS_LinSM_00126]. The actual mode switch does not occur instantaneously; LinSM notifies the caller only once the mode transition has been successfully completed [SWS_LinSM_00126]. Interpretation: ComM likely acts as the primary caller, as the mode switch is requested and acknowledged at channel level. Question Q-0fcce16df8a29149 (open)

Return Values and Concurrency

The interface is specified as reentrant and returns a status value of type Std_ReturnType [SWS_LinSM_00126]:

  • E_OK: The request was successfully accepted by LinSM [SWS_LinSM_00126].
  • E_NOT_OK: Execution of the request is not possible, for example if the LinSM module has not yet been initialized [SWS_LinSM_00126].

Error Handling and Interaction

Within the scope of error handling, an interaction with the LIN interface is defined: If the underlying call to LinIf_GotoSleep yields the return value E_NOT_OK, LinSM_RequestComMode must unconditionally also return E_NOT_OK [SWS_LinSM_00177]. If the function returns with E_NOT_OK, the same state must remain or be set in LinSM so that the corresponding feedback to ComM_BusSM_ModeIndication and BswM_LinSM_CurrentState occurs [SWS_LinSM_00177].

This text was generated automatically. All technical statements are based exclusively on the specification data of AUTOSAR R20-11.

Implementer's Guide to follow (complexity I2)

function LinSM_MainFunction [SWS_LinSM_00156] 📄 PDF

void LinSM_MainFunction (void);

Periodic function that runs the timers of different request timeouts

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: ca2058e9ab04 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The function LinSM_MainFunction acts as the central periodic main function of the LIN State Manager (LinSM) module within the AUTOSAR Classic architecture [SWS_LinSM_00156]. According to the specification, it has the syntax void LinSM_MainFunction (void) and the hexadecimal service ID 0x30 [SWS_LinSM_00156]. Since it neither accepts parameters nor returns a return value, it operates purely state-based within the module [SWS_LinSM_00156]. Its primary functional task is running and updating the internal timers continuously, which are responsible for monitoring various request timeouts [SWS_LinSM_00156].

Call Context and Scheduling

The interface is declared via header file SchM_LinSm.h [SWS_LinSM_00156]. Interpretation: Due to this integration into the Schedule Manager, the function is likely to be called cyclically by the BSW Scheduler in the context of an operating system task. Question Q-d83f7b3f0b251f4f (open) This regular cycle is essential so that pending timeout conditions for LIN channel and state requests can be recognized and processed deterministically. Specific error handlings such as DET error codes or DEM events as well as formal reentrancy criteria are not specified for this service in the available scope of the specification and are therefore omitted.

This usage note was generated automatically based on the specification of AUTOSAR R20-11.

Implementer's Guide to follow (complexity I1)

function LinSM_ScheduleRequestConfirmation [SWS_LinSM_00129] 📄 PDF

void LinSM_ScheduleRequestConfirmation (NetworkHandleType network, LinIf_SchHandleType schedule);

The Lin If module will call this callback when the new requested schedule table is active.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 966015905644 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The function LinSM_ScheduleRequestConfirmation serves as a callback interface of the LinSM module and has the service ID 0x20 [SWS_LinSM_00129]. It is available via header file LinSM.h and is called by the LIN Interface (LinIf) as soon as a previously requested new schedule table has become active on the LIN bus [SWS_LinSM_00129].

The interface has no return value (void) and passes two input parameters to LinSM [SWS_LinSM_00129]:

  • network (NetworkHandleType): Serves to uniquely identify the affected LIN communication channel [SWS_LinSM_00129].
  • schedule (LinIf_SchHandleType): Passes the identifier or pointer to the newly activated schedule table [SWS_LinSM_00129].

Concurrency and Interaction

The execution of LinSM_ScheduleRequestConfirmation is specified as synchronous and reentrant [SWS_LinSM_00129]. Input and output parameters (inout or out) are not present [SWS_LinSM_00129]. The interaction is tightly coupled with the LinIf module, which calls this callback function to confirm the state change of the schedule table to LinSM [SWS_LinSM_00129]. Interpretation: Since LinIf acts as the caller, the call context is likely to be coupled to the execution processing of the LinIf driver or interface. Question Q-500d6a653bfbaac0 (open)

This usage note was generated automatically based on the AUTOSAR specification.

Implementer's Guide to follow (complexity I1)

function LinSM_GotoSleepIndication [SWS_LinSM_91000] 📄 PDF

void LinSM_GotoSleepIndication (NetworkHandleType Channel);

The Lin If will call this callback when the go to sleep command is received on the network or a bus idle timeout occurs. Only applicable for LIN slave nodes.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f0a8b1578ff8 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The callback function LinSM_GotoSleepIndication ([SWS_LinSM_91000]) serves to notify the LIN State Manager about putting a channel into sleep state. It is called by the LIN Interface (LinIf) as soon as a go-to-sleep command is received on the network or a bus idle timeout occurs.

Usage and Call Context

The function is executed synchronously and has no return value ([SWS_LinSM_91000]). It is provided via the header LinSM.h and carries the Service ID 0x03. Its only parameter serves for channel identification:

  • Channel (In): Identifies the affected LIN channel via the type NetworkHandleType ([SWS_LinSM_91000]).

Neither input/output parameters (inout) nor output parameters (out) are specified ([SWS_LinSM_91000]).

Concurrency and Limitations

Regarding concurrency, the interface is defined as reentrant ([SWS_LinSM_91000]). A decisive functional restriction concerns the node property: The callback is intended and applicable exclusively for LIN slave nodes ([SWS_LinSM_91000]).

This usage note is based exclusively on the specification data from AUTOSAR Release R20-11.

Implementer's Guide to follow (complexity I1)

function LinSM_GotoSleepConfirmation [SWS_LinSM_00135] 📄 PDF

void LinSM_GotoSleepConfirmation (NetworkHandleType network, boolean success);

The Lin If will call this callback when the go to sleep command is sent successfully or not sent successfully on the network.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: cf9e1845fe84 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The callback function LinSM_GotoSleepConfirmation is called according to [SWS_LinSM_00135] by the LIN Interface (LinIf) as soon as a go-to-sleep command has been transmitted on the LIN network or transmission has failed.

Usage and Parameters

The callback has the service ID 0x22, is declared via header LinSM.h, and has no return value [SWS_LinSM_00135]. Two input parameters are used for identification and status transmission:

  • network: Identifies the affected LIN channel via the type NetworkHandleType [SWS_LinSM_00135].
  • success: Indicates as a boolean value whether the go-to-sleep command could be successfully sent on the bus (true) or not (false) [SWS_LinSM_00135].

Execution Context and Concurrency

The specification defines the call as synchronous and reentrant [SWS_LinSM_00135]. Interpretation: The LinSM module is likely to update its internal state for the respective network based on parameter success and determine whether the transition to the sleep state on the bus was confirmed. Question Q-b5dfd51188b9ff0b (open) Error handlings, return values, or specific DET or DEM messages are not specified for this interface in the payload [SWS_LinSM_00135].

This text was generated by an AI; only the AUTOSAR specification is authoritative.

Implementer's Guide to follow (complexity I1)

function LinSM_WakeupConfirmation [SWS_LinSM_00132] 📄 PDF

void LinSM_WakeupConfirmation (NetworkHandleType network, boolean success);

The Lin If will call this callback when the wake up signal command is sent not successfully/ successfully on the network.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 3915bb7b7db1 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

In the LIN State Manager, the callback function LinSM_WakeupConfirmation serves to confirm the transmission of a wake-up signal on a LIN network [SWS_LinSM_00132]. It is called by the LIN interface (LinIf) as soon as the command to transmit the wake-up signal on the network was transmitted either successfully or unsuccessfully [SWS_LinSM_00132].

The following specification characteristics apply to the call context, concurrency, and parameter passing [SWS_LinSM_00132]:

  • Synchronization behavior and reentrancy: Execution of the function is synchronous (Synchronous) and is classified as reentrant (Reentrant) [SWS_LinSM_00132].
  • Channel identification (network): The passed input parameter of type NetworkHandleType designates the respective LIN channel on which the transmission process took place [SWS_LinSM_00132].
  • Success status (success): The boolean parameter indicates whether the wake-up signal could be transmitted successfully (true) or the transmission failed (false) [SWS_LinSM_00132].
  • Return value and input/output parameters: The function has no return value (void) and defines neither output nor input/output parameters [SWS_LinSM_00132].

The interface has the Service ID 0x21 and is provided via the header file LinSM.h [SWS_LinSM_00132]. Specific error codes as well as requirements for error handling via the Default Error Tracer (DET) or the Diagnostic Event Manager (DEM) module are not specified in the specification element [SWS_LinSM_00132].

This usage note is based on the specification AUTOSAR Classic Release R20-11.

type LinSM_ModeType [SWS_LinSM_00220] 📄 PDF

Type used to report the current mode to the Bsw M

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 939c0e58134f Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The data type LinSM_ModeType is a standard type of the LIN State Manager that builds on the base type uint8 and is provided via header LinSM.h [SWS_LinSM_00220]. The primary task of this type is to report the current communication mode of a LIN network to the BSW Mode Management (BswM) [SWS_LinSM_00220].

For LinSM_ModeType, two states are specified in the value range [SWS_LinSM_00220]:

  • LINSM_FULL_COM (numeric value 0x01): Signals the state of unrestricted full communication [SWS_LinSM_00220].
  • LINSM_NO_COM (numeric value 0x02): Identifies the state without ongoing communication (No communication) [SWS_LinSM_00220].

With respect to error handling and concurrency, the type definition contains no dedicated error codes, DET messages, or DEM events, as it is an elementary type declaration [SWS_LinSM_00220]. Interpretation: Passing values of this type to the BswM is likely to take place in the context of higher-level state transitions of LinSM, whereby callers must ensure that no invalid values outside the defined states are transmitted. Question Q-fe193732b8be2388 (open)

This usage note was created by an AI.

Implementer's Guide to follow (complexity I1)

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_LinSM
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_LinSM@rel:R20-11#d2671c47
Content hash
d2671c47
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_LINStateManager.pdf#nameddest=SWS_LinSM_00155

Initialization and status

-

void LinSM_GetVersionInfo (Std_VersionInfoType* versioninfo);
LinSM_Init function

This function initializes the Lin SM.

void LinSM_Init (const LinSM_ConfigType* ConfigPtr);

Services

Function to query the current communication mode.

Std_ReturnType LinSM_GetCurrentComMode (NetworkHandleType network, ComM_ModeType* mode);

The Lin If will call this callback when the go to sleep command is sent successfully or not sent successfully on the network.

void LinSM_GotoSleepConfirmation (NetworkHandleType network, boolean success);

The Lin If will call this callback when the go to sleep command is received on the network or a bus idle timeout occurs. Only applicable for LIN slave nodes.

void LinSM_GotoSleepIndication (NetworkHandleType Channel);

Requesting of a communication mode. The mode switch will not be made instant. The Lin SM will notify the caller when mode transition is made.

Std_ReturnType LinSM_RequestComMode (NetworkHandleType network, ComM_ModeType mode);

The upper layer requests a schedule table to be changed on one LIN network.

Std_ReturnType LinSM_ScheduleRequest (NetworkHandleType network, LinIf_SchHandleType schedule);

The Lin If module will call this callback when the new requested schedule table is active.

void LinSM_ScheduleRequestConfirmation (NetworkHandleType network, LinIf_SchHandleType schedule);

The Lin If will call this callback when the wake up signal command is sent not successfully/ successfully on the network.

void LinSM_WakeupConfirmation (NetworkHandleType network, boolean success);

Cyclic

Periodic function that runs the timers of different request timeouts

void LinSM_MainFunction (void);

Types

Data structure type for the post - build configuration parameters.

Type used to report the current mode to the Bsw M