SOME/IP Client Stack
SOME/IP Client Overview
RAPIDSEA supports SOME/IP protocol as explained in the SOME/IP Protocol page. This page explains the client architecture and details how the user should interface the stack with their custom logic and realize the Tester implementation quickly. It also provides guidelines on adopting the stack for different systems.
The below diagram captures the block level diagram of the SOME/IP client and how it interfaces with other modules.
Application Interface
While the RAPIDSEA SOME/IP client stack can handle most of the functionality such as message validation, service discovery management, subscription handling, Notification process etc, the business logic has to implement the application functionality. The RAPIDSEA SOME/IP client clearly defines API and callback functions that are essential for the user to use/implement.
The below table captures the function that are to be called from the application logic.
Function |
Description |
|---|---|
rs_some_client_open |
To initialize the SOME/IP client instance structure for both discovery and notification process. |
rs_some_client_subscribe_init |
To initialize the SOME/IP subscription details structure associated with the client. |
rs_some_client_run |
To be called to set the run state for state machine for both discovery and notification process. |
rs_some_client_set_rx_msg_buf |
To set up the receive buffers to be used for the SOME/IP client communication. |
rs_some_client_set_tx_msg_buf |
To set up the transmit buffers to be used for the SOME/IP client communication. |
rs_some_client_send_req |
To be called to frame and send request message for given method ID and their related parameters. |
rs_some_client_req_find_service |
To be called to find the service of given service ID and instance ID. |
rs_some_client_send_stop_subscribe_req |
To be called to stop the eventgroup subscription for given eventgroup ID. |
rs_some_client_send_notify_req |
To be called to send the request for subscribed eventgroups (read/write/method) |
rs_some_client_set_reboot_flag |
To be called to set the reboot flag in SOME/IP client instance. |
rs_some_client_process |
To be called to call the discovery and notification’s state machine and process respectively. |
rs_some_client_all_subscribe_reset |
Called to reset all subscription details on client. |
rs_some_client_close |
To freed the SOME/IP client handle. |
There are many functions through which the SOME/IP client stack retrieves information from the application logic or indicate actions to be performed. These functions are captured in the below table.
Function |
Description |
|---|---|
rcb_some_client_notification_resp_handler |
Called when response for a read/write/method request is received and also notification events received |
rcb_some_client_notification_resp_err_handler |
Called to indicate reception of error response for any request |
rcb_some_client_subscription_resp_handler |
Called when response for a service discovery request is received |
rcb_some_client_get_serialized_config_option |
Called when function get the serialized data of configuration option |
rcb_some_client_set_deserialize_config_option |
Called when function set the deserialized data of load balancing option |
rcb_some_client_set_load_balancing_option_info |
called when function set the data of load balancing option |
rcb_some_client_get_mem |
Called to get memory |
SOME/IP Client Configuration Parameter:
Function |
Description |
|---|---|
sd_multicast_addr |
Multicast IP address |
client_addr |
SOME/IP client IP address |
sd_port |
SD Port number for UDP IP |
sn_port |
SN Port number |
ip_version |
SOME/IP SD repetition max |
protocol_ver |
SOME/IP protocol version |
interface_ver |
SOME/IP interface version |
client_id |
SOME/IP Client ID |
initial_delay |
SOME/IP SD initial wait time |
repetitions_base_delay |
SOME/IP SD repetition base delay |
repetitions_max |
SOME/IP SD repetition max |
log_level |
SOME/IP Client log level |
These functions are documented in detail in the below sections. It is important for the client to implement these functions correct for proper operation of the system.
Implementation Guide
This section explains how the SOME/IP client can be implemented using the RAPIDSEA stack. The stack is available in source form, the steps to be followed are
Initialize the client configuration
Implement the Callback functions mentioned above
Initialize the buffers necessary for the operation
Initialize the SOME/IP stack function.
Periodically call the rs_some_client_process functions so that internal timeouts are handled.
If there is a need to send a request to ECU/server, send via rs_some_client_send_notify_req call
When the response from server is received, rcb_some_client_notification_resp_handler function called.
On reception of negative response from server, rcb_some_client_notification_resp_err_handler function is called.
High level flow chart is depicted below:
The below diagram captures the high level sequence of operations associated with the SOME/IP stack.
This can be implemented in a bare-metal system or over RTOS or over full fledged OS such as Linux etc.
SOME/IP Client Stack Memory Usage
Platform |
Memory |
Size |
|---|---|---|
Linux |
ROM |
95KB |
Linux |
RAM |
48KB |
Micro controller (iMXRT) |
ROM |
108KB |
Micro controller (iMXRT) |
RAM |
90KB |
Platform |
Memory |
Size |
|---|---|---|
Linux |
ROM |
110KB |
Linux |
RAM |
107KB |
Micro controller (iMXRT) |
ROM |
275KB |
Micro controller (iMXRT) |
RAM |
195KB |
Note:
The above table captures the memory usage for five services. Each service has two or one event groups, and across these eventgroups, a total of ten events are mapped. If you add or remove services, the memory usage will increase or decrease accordingly.
Dependency
This stack depends on the below RAPIDSEA interface that can be obtained or custom implemented.
Example demo
An example implementation is available along with the release and is described in SOME/IP Client Demo.
SOME/IP Client Header
Documentation from the relevant header as follows:
Warning
doxygenfile: Cannot find file “rs_someip_client.h