S32 SDK

Detailed Description

This group contains APIs that used for node configuration purpose.

With protocol lin2.1 in slave node, some service like (Data dump, Conditional change nad with id from 2 to 255) are not supported by LinStack but user can implement it in application by use function ld_receive_message and ld_send_message in transport layer.

With protocol J2602 in slave node, some service like (Data dump, Assign NAD, Conditional change NAD) are not supported by LinStack but user can implement it in application by choosing these services in supported_sid in PEX GUI and use function ld_receive_message and ld_send_message in transport layer. When received target reset master request slave node just update status_byte and send response positive message.

Functions

l_u8 ld_is_ready (l_ifc_handle iii)
 This call returns the status of the last requested configuration service. More...
 
void ld_check_response (l_ifc_handle iii, l_u8 *const RSID, l_u8 *const error_code)
 This call returns the result of the last node configuration service, in the parameters RSID and error_code. A value in RSID is always returned but not always in the error_code. Default values for RSID and error_code is 0 (zero). More...
 
void ld_assign_frame_id_range (l_ifc_handle iii, l_u8 NAD, l_u8 start_index, const l_u8 *const PIDs)
 This function assigns the protected identifier of up to four frames. More...
 
void ld_save_configuration (l_ifc_handle iii, l_u8 NAD)
 This function to issue a save configuration request to a slave node. More...
 
l_u8 ld_read_configuration (l_ifc_handle iii, l_u8 *const data, l_u8 *const length)
 This function copies current configuration in a reserved area. More...
 
l_u8 ld_set_configuration (l_ifc_handle iii, const l_u8 *const data, l_u16 length)
 This function configures slave node according to data. More...
 
void ld_assign_NAD (l_ifc_handle iii, l_u8 initial_NAD, l_u16 supplier_id, l_u16 function_id, l_u8 new_NAD)
 This call assigns the NAD (node diagnostic address) of all slave nodes that matches the initial_NAD, the supplier ID and the function ID. Master node only. More...
 
void ld_conditional_change_NAD (l_ifc_handle iii, l_u8 NAD, l_u8 id, l_u8 byte_data, l_u8 mask, l_u8 invert, l_u8 new_NAD)
 This call changes the NAD if the node properties fulfill the test specified by id, byte, mask and invert. Master node only. More...
 

Function Documentation

void ld_assign_frame_id_range ( l_ifc_handle  iii,
l_u8  NAD,
l_u8  start_index,
const l_u8 *const  PIDs 
)

This function assigns the protected identifier of up to four frames.

Parameters
[in]iiilin interface handle
[in]NADNode address value of the target node
[in]start_indexspecifies which is the first frame to assign a PID
[in]PIDslist of protected identifier
Returns
void

This API is available for master interfaces only

Definition at line 136 of file lin_diagnostic_service.c.

void ld_assign_NAD ( l_ifc_handle  iii,
l_u8  initial_NAD,
l_u16  supplier_id,
l_u16  function_id,
l_u8  new_NAD 
)

This call assigns the NAD (node diagnostic address) of all slave nodes that matches the initial_NAD, the supplier ID and the function ID. Master node only.

Parameters
[in]iiiLIN interface handle
[in]initial_NADInitial node address of the target node
[in]supplier_idSupplier ID of the target node
[in]function_idFunction identifier of the target node
[in]new_NADNew node address
Returns
void

This call assigns the NAD (node diagnostic address) of all slave nodes that matches the initial_NAD, the supplier ID and the function ID. The new NAD of the slave node will be new_NAD. This function is used for master node only.

Definition at line 860 of file lin_diagnostic_service.c.

void ld_check_response ( l_ifc_handle  iii,
l_u8 *const  RSID,
l_u8 *const  error_code 
)

This call returns the result of the last node configuration service, in the parameters RSID and error_code. A value in RSID is always returned but not always in the error_code. Default values for RSID and error_code is 0 (zero).

For slave interfaces ld_check_response shall do nothing

Parameters
[in]iiilin interface handle
[out]RSIDbuffer for saving the response ID
[out]error_codebuffer for saving the error code

This API is available for master interfaces only

Definition at line 106 of file lin_diagnostic_service.c.

void ld_conditional_change_NAD ( l_ifc_handle  iii,
l_u8  NAD,
l_u8  id,
l_u8  byte_data,
l_u8  mask,
l_u8  invert,
l_u8  new_NAD 
)

This call changes the NAD if the node properties fulfill the test specified by id, byte, mask and invert. Master node only.

Parameters
[in]iii:LIN interface handle
[in]NADCurrent NAD value of the target node
[in]idProperty ID of the target node
[in]byteByte location of property value to be read from the target node
[in]maskValue for masking the read property byte
[in]invertValue for excluding the read property byte
[in]new_NADNew NAD value to be assigned when the condition is met
Returns
void

This call changes the NAD if the node properties fulfill the test specified by id, byte, mask and invert.

Definition at line 902 of file lin_diagnostic_service.c.

l_u8 ld_is_ready ( l_ifc_handle  iii)

This call returns the status of the last requested configuration service.

Parameters
[in]iiilin interface handle
Returns
LD_SERVICE_BUSY Service is ongoing.
LD_REQUEST_FINISHED The configuration request has been completed. This is a intermediate status between the configuration request and configuration response.
LD_SERVICE_IDLE The configuration request/response combination has been completed, i.e. the response is valid and may be analyzed. Also, this value is returned if no request has yet been called.
LD_SERVICE_ERROR The configuration request or response experienced an error. Error here means error on the bus, and not a negative configuration response from the slave node.

Definition at line 80 of file lin_diagnostic_service.c.

l_u8 ld_read_configuration ( l_ifc_handle  iii,
l_u8 *const  data,
l_u8 *const  length 
)

This function copies current configuration in a reserved area.

Parameters
[in]iiiLin interface handle
[out]dataData area to save configuration,
[out]lengthLength of data area (1 + n, NAD + PIDs)
Returns
LD_READ_OK If the service was successful.
LD_LENGTH_TOO_SHORT If the configuration size is greater than the length. It means that the data area does not contain a valid configuration.

This function is implemented Slave Only.

Set the expected length value to EXP = NN + NF, where : NN = the number of NAD. NF = the number of configurable frames; Moreover: Not taken PID's diagnostics frame: 3C, 3D

Definition at line 438 of file lin_diagnostic_service.c.

void ld_save_configuration ( l_ifc_handle  iii,
l_u8  NAD 
)

This function to issue a save configuration request to a slave node.

Parameters
[in]iiiInterface name
[in]NADNode address of target
Returns
void

This function is available for master nodes only. This function is available for all diagnostic classes and only for LIN2.1 and above. This function is called to send a save configuration request to a specific slave node with the given NAD, or to all slave nodes if NAD is set to broadcast This function is implemented for Master Only.

Definition at line 178 of file lin_diagnostic_service.c.

l_u8 ld_set_configuration ( l_ifc_handle  iii,
const l_u8 *const  data,
l_u16  length 
)

This function configures slave node according to data.

Parameters
[in]iiiLin interface handle
[in]dataStructure containing the NAD and all the n PIDs for the frames of the specified NAD,
[in]lengthLength of data area (1 + n, NAD + PIDs)
Returns
LD_SET_OK If the service was successful
LD_LENGTH_NOT_CORRECT If the required size of the configuration is not equal to the given length.
LD_DATA_ERROR The set of configuration could not be made.

This function is implemented Slave Only.

Set the expected length value to EXP = NN + NF, where : NN = the number of NAD. NF = the number of configurable frames; Moreover: Not taken PID's diagnostics frame: 3C, 3D

Definition at line 503 of file lin_diagnostic_service.c.