Skip to content

File syn_cannm.c

FileList > proto > syn_cannm.c

Go to the source code of this file

AUTOSAR CAN Network Management (CanNm) Protocol Implementation.

  • #include "syn_cannm.h"
  • #include <string.h>

Public Functions

Type Name
void syn_cannm_init (SYN_CanNM_Session * session, const SYN_CanNM_Config * cfg)
Initialize CAN NM Session.
bool syn_cannm_process_rx_frame (SYN_CanNM_Session * session, const SYN_CAN_Frame * frame)
Process an incoming CAN frame for CAN NM filtering and state machine.
void syn_cannm_release_network (SYN_CanNM_Session * session)
Release network request (allow transition to sleep).
void syn_cannm_request_network (SYN_CanNM_Session * session)
Request network active operation (keep awake / active wakeup).
void syn_cannm_request_repeat_msg (SYN_CanNM_Session * session)
Request Repeat Message state transition.
void syn_cannm_set_user_data (SYN_CanNM_Session * session, const uint8_t * data, size_t len)
Set local NM user payload bytes (6 bytes max).
bool syn_cannm_step (SYN_CanNM_Session * session, uint32_t delta_ms, SYN_CAN_Frame * tx_frame)
Step CAN NM state machine and timer tick.

Public Static Functions

Type Name
void pack_nm_tx_pdu (SYN_CanNM_Session * session, SYN_CAN_Frame * tx_frame)
Pack CAN NM PDU payload into tx_frame.

Public Functions Documentation

function syn_cannm_init

Initialize CAN NM Session.

void syn_cannm_init (
    SYN_CanNM_Session * session,
    const SYN_CanNM_Config * cfg
) 

Parameters:

  • session Session handle pointer
  • cfg Configuration structure (or NULL for defaults)

function syn_cannm_process_rx_frame

Process an incoming CAN frame for CAN NM filtering and state machine.

bool syn_cannm_process_rx_frame (
    SYN_CanNM_Session * session,
    const SYN_CAN_Frame * frame
) 

Parameters:

  • session Session handle pointer
  • frame Incoming CAN frame pointer

Returns:

true if frame was a valid matching CAN NM PDU


function syn_cannm_release_network

Release network request (allow transition to sleep).

void syn_cannm_release_network (
    SYN_CanNM_Session * session
) 

Parameters:

  • session Session handle pointer

function syn_cannm_request_network

Request network active operation (keep awake / active wakeup).

void syn_cannm_request_network (
    SYN_CanNM_Session * session
) 

Parameters:

  • session Session handle pointer

function syn_cannm_request_repeat_msg

Request Repeat Message state transition.

void syn_cannm_request_repeat_msg (
    SYN_CanNM_Session * session
) 

Parameters:

  • session Session handle pointer

function syn_cannm_set_user_data

Set local NM user payload bytes (6 bytes max).

void syn_cannm_set_user_data (
    SYN_CanNM_Session * session,
    const uint8_t * data,
    size_t len
) 

Parameters:

  • session Session handle pointer
  • data Data pointer
  • len Data length (0 to 6 bytes)

function syn_cannm_step

Step CAN NM state machine and timer tick.

bool syn_cannm_step (
    SYN_CanNM_Session * session,
    uint32_t delta_ms,
    SYN_CAN_Frame * tx_frame
) 

Parameters:

  • session Session handle pointer
  • delta_ms Elapsed time in milliseconds
  • tx_frame Pointer to CAN frame structure to receive pending CAN NM message

Returns:

true if a CAN frame is ready in tx_frame to be transmitted


Public Static Functions Documentation

function pack_nm_tx_pdu

Pack CAN NM PDU payload into tx_frame.

static void pack_nm_tx_pdu (
    SYN_CanNM_Session * session,
    SYN_CAN_Frame * tx_frame
) 

Parameters:

  • session Pointer to CAN NM session instance.
  • tx_frame Pointer to target CAN frame structure.


The documentation for this class was generated from the following file src/syntropic/proto/syn_cannm.c