LIN State Manager (LinSM)
Manages state transitions of LIN networks.
Funktionen — Übersicht
void LinSM_Init (const LinSM_ConfigType* ConfigPtr);This function initializes the Lin SM.Std_ReturnType LinSM_ScheduleRequest (NetworkHandleType network, LinIf_SchHandleType schedule);The upper layer requests a schedule table to be changed on one LIN network.void LinSM_GetVersionInfo (Std_VersionInfoType* versioninfo);-Std_ReturnType LinSM_GetCurrentComMode (NetworkHandleType network, ComM_ModeType* mode);Function to query the current communication mode.Std_ReturnType LinSM_RequestComMode (NetworkHandleType network, ComM_ModeType mode);Requesting of a communication mode.void LinSM_MainFunction (void);Periodic function that runs the timers of different request timeoutsvoid LinSM_ScheduleRequestConfirmation (NetworkHandleType network, LinIf_SchHandleType schedule);The Lin If module will call this callback when the new requested schedule table is active.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.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.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.
Typen — Übersicht
enum LinSM_ModeTypeType used to report the current mode to the Bsw Mstruct LinSM_ConfigTypeData structure type for the post - build configuration parameters.
Funktionen & Typen — Detailansicht
function LinSM_Init [SWS_LinSM_00155] 📄 PDF
void LinSM_Init (const LinSM_ConfigType* ConfigPtr);
This function initializes the Lin SM.
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,
ConfigPtrof typeconst 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.hand carries the service ID0x01[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.
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_GetVersionInfo [SWS_LinSM_00117] 📄 PDF
void LinSM_GetVersionInfo (Std_VersionInfoType* versioninfo);
-
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.
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
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.
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.
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 typeNetworkHandleType([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.
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 typeNetworkHandleType[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.
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 typeNetworkHandleTypedesignates 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
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 value0x01): Signals the state of unrestricted full communication [SWS_LinSM_00220].LINSM_NO_COM(numeric value0x02): 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)
type LinSM_ConfigType [SWS_LinSM_00221] 📄 PDF
Data structure type for the post - build configuration parameters.
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
gemini-3.8-flash-low· 2026-10-13 · German original