RTI Connext DDS Micro C++ API  Version 2.4.14
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
OSAPI AutoSAR

AutoSAR System API. More...

Classes

struct  OSAPI_PortProperty

Typedefs

typedef Std_ReturnType(* NETIO_Autosar_TcpIp_get_socket )(TcpIp_DomainType domain, TcpIp_ProtocolType protocol, TcpIp_SocketIdType *socket)
 Function used to create a socket. Users must provide this function in case SocketOwner is used. The implementation of this function normally calls TcpIp_<Up>GetSocket().
typedef Std_ReturnType(* NETIO_Autosar_TcpIp_send_dyn_data )(void const *data_ptr, uint16 length, TcpIp_SockAddrType const *remote_addr_ptr)
 Function used to send data. User's must provide this function only in case SocketOwner is not used. If SocketOwner is used RTI Connext DDS Micro will use a socket to send UDP packets.

Enumerations

enum  OSAPI_Autosar_SyncKind_T { OSAPI_AUTOSAR_SYNCKIND_RESOURCES }
 Synchronization method enum. More...

Variables

uint32 OSAPI_PortProperty::timer_resolution_ms
uint32 OSAPI_PortProperty::number_of_heap_areas
uint32 const * OSAPI_PortProperty::heap_area_size
char *const * OSAPI_PortProperty::heap_area
OSAPI_Autosar_SyncKind_T OSAPI_PortProperty::sync_type
ResourceType OSAPI_PortProperty::first_resource_id
ResourceType OSAPI_PortProperty::last_resource_id
uint16 OSAPI_PortProperty::spinlock_id
uint32 OSAPI_PortProperty::semaphore_max_count
EventMaskType OSAPI_PortProperty::first_give_event
EventMaskType OSAPI_PortProperty::first_timeout_event
AlarmType OSAPI_PortProperty::first_alarm
boolean OSAPI_PortProperty::use_socket_owner
uint8 OSAPI_PortProperty::max_receive_sockets
uint8 OSAPI_PortProperty::number_of_rcv_buffers
uint32 OSAPI_PortProperty::rcv_buffer_size
NETIO_Autosar_TcpIp_get_socket OSAPI_PortProperty::get_socket
NETIO_Autosar_TcpIp_send_dyn_data OSAPI_PortProperty::send_data
TcpIp_LocalAddrIdType OSAPI_PortProperty::local_addr_id
boolean OSAPI_PortProperty::use_udp_thread
TaskType OSAPI_PortProperty::udp_receive_task_id
EventMaskType OSAPI_PortProperty::udp_packet_received_event
uint32 OSAPI_PortProperty::log_dst_address
uint16 OSAPI_PortProperty::log_dst_port

Detailed Description

AutoSAR System API.

The AutoSAR System is defined as specific functionality needed to run RTI Connext DDS Micro on an AutoSAR based OS.


Typedef Documentation

typedef Std_ReturnType(* NETIO_Autosar_TcpIp_get_socket)(TcpIp_DomainType domain, TcpIp_ProtocolType protocol, TcpIp_SocketIdType *socket)

Function used to create a socket. Users must provide this function in case SocketOwner is used. The implementation of this function normally calls TcpIp_<Up>GetSocket().

Parameters:
[in]domain- IP address family.
[in]protocol- Socket protocol as sub-family of parameter type.
[out]socket- Pointer to socket identifier representing the requested socket. This socket identifier must be provided for all further API calls which requires a SocketId. Note: value of 'socket' parameter is only valid if return value is E_OK
Returns:
E_OK on success, error code on failure.
typedef Std_ReturnType(* NETIO_Autosar_TcpIp_send_dyn_data)(void const *data_ptr, uint16 length, TcpIp_SockAddrType const *remote_addr_ptr)

Function used to send data. User's must provide this function only in case SocketOwner is not used. If SocketOwner is used RTI Connext DDS Micro will use a socket to send UDP packets.

Parameters:
[in]data_ptr- Pointer to data to send.
[in]length- Length of data to send.
[in]remote_addr_ptr- Address and port where to send the data.
Returns:
E_OK on success, error code on failure.

Enumeration Type Documentation

Synchronization method enum.

Enumerator:
OSAPI_AUTOSAR_SYNCKIND_RESOURCES 

Use Resources as synchronization method Use spinlock as synchronization method


Variable Documentation

uint32 OSAPI_PortProperty::timer_resolution_ms

Timer resolution in ms. Frequency at which the timer task is executed.

uint32 OSAPI_PortProperty::number_of_heap_areas

Heap used by RTI Connext DDS Micro can span across a number of different areas. This field indicates the number of areas in the heap memory. Minimum valid value is 1.

uint32 const* OSAPI_PortProperty::heap_area_size

Pointer to size of each heap area. As many elements as indicated in field 'number_of_heap_areas'.

char* const* OSAPI_PortProperty::heap_area

Pointer to heap areas. As many elements as indicated in field 'number_of_heap_areas'.

OSAPI_Autosar_SyncKind_T OSAPI_PortProperty::sync_type

Kind of synchronization used.

ResourceType OSAPI_PortProperty::first_resource_id

First resource id that RTI Connext DDS Micro uses to synchronize the concurrent access to shared resources. This is only used in case Resources are configured as synchronization method.

ResourceType OSAPI_PortProperty::last_resource_id

Last resource id that RTI Connext DDS Micro uses to synchronize the concurrent access to shared resources. This is only used in case Resources are configured as synchronization method.

uint16 OSAPI_PortProperty::spinlock_id

Spinlock id used in case sync_type is OSAPI_AUTOSAR_SYNCKIND_SPINLOCK. Type SpinlockIdType could be used for this field but some AutoSAR implementations don't include this type in case spinlock module is not added. To avoid ifdef we use uint16.

uint32 OSAPI_PortProperty::semaphore_max_count

Maximum number of semaphores that can be created. As many give and timeout events and alarms as indicated by this field must be configured in Autosar. Give events shall have 'consecutive' event IDs, starting at first_give_event (e.g. 1, 2, 4). Timeout events shall have 'consecutive' event IDs starting at first_timeout_event (e.g. 8, 16, 32). Alarms shall have 'consecutive' IDs starting at first_alarm (e.g. 1, 2, 3).

A Waitset object needs two semaphores. In case Waitsets are not used this field can be set to 0.

Semaphore implementation uses two events and one alarm for each semaphore that is created. One event, the give event, is set in the semaphore give() method. The other event, the timeout event, is used to signal a timeout in the semaphore. The alarm must be configured to set the timeout event. The semaphore take() operation starts the alarm and waits for any of the events.

The alarm must be configured as 'RELATIVE' and to set the timeout event when it expires. The counter used to trigger the alarm must be configured with one tick per millisecond and in case this is not done properly the semaphore timeout will occur sooner or later than expected.

The semaphore take() method in the semaphore can be used only from one task.

In case semaphores are not needed it is possible to just set fields first_give_event, first_timeout_event, first_alarm and semaphore_max_count to 0.

EventMaskType OSAPI_PortProperty::first_give_event

First give event id used for semaphore implementation.

EventMaskType OSAPI_PortProperty::first_timeout_event

First timeout event id used for semaphore implementation.

AlarmType OSAPI_PortProperty::first_alarm

First alarm id used for semaphore implementation.

boolean OSAPI_PortProperty::use_socket_owner

TRUE if SocketOwner is configured in AutoSAR TcpIp module configuration. In that case RTI Connext DDS Micro will use sockets to send and receive UDP packets. Otherwise a function pointer will be used to send packets.

If set to 'TRUE' fields 'number_of_socket' and 'get_socket' must be configured properly (can't be NULL_PTR).

If set to 'FALSE' field 'send_data' needs to be configured properly (can't be NULL_PTR).

uint8 OSAPI_PortProperty::max_receive_sockets

Maximum number of sockets that RTI Connext DDS Micro can use to receive UDP packets. This number depends on the number of participants created and the UDP transport configuration.

If SocketOwner is used for each participant 2 sockets are normally needed to receive UDP packets:

  • Socket to receive unicast discovery data.
  • Socket to receive unicast user data.

If SocketOwner is not used sockets are not used but this field must have at least a value of 1.

uint8 OSAPI_PortProperty::number_of_rcv_buffers

RTI Connext DDS Micro can use internal socket buffers. This is normally needed in case the received callback indication is called in the context of an ISR. Number of receive buffers of size specified in field 'rcv_buffer_size'. This is only used when field 'use_udp_thread' is TRUE.

uint32 OSAPI_PortProperty::rcv_buffer_size

RTI Connext DDS Micro Size of each receive buffer.

NETIO_Autosar_TcpIp_get_socket OSAPI_PortProperty::get_socket

Pointer to the function that can create a socket. This function is used to create sockets to send and receive UDP packets. This field is used only in case a SocketOwner is configured, field 'use_socket_owner' is set to TRUE. Otherwise this field can be NULL_PTR.

NETIO_Autosar_TcpIp_send_dyn_data OSAPI_PortProperty::send_data

Pointer to the function that can send data. This field is used only in case a SocketOwner is not configured, when field 'use_socket_owner' is FALSE. Otherwise this field can be NULL_PTR.

TcpIp_LocalAddrIdType OSAPI_PortProperty::local_addr_id

IP address identifier representing the local IP address and EthIf controller to bind the socket to.

boolean OSAPI_PortProperty::use_udp_thread

Set to TRUE to use a thread to receive data. If this field is set to FALSE, the incoming UDP packets will be processed in the callback notification function. If this field is set to TRUE, the callback notification function will copy the UDP packet in an internal buffer and set an event for the UDP thread to process the packet.

TaskType OSAPI_PortProperty::udp_receive_task_id

UDP receive thask id. This must be configured with the ID of the task NETIO_Autosar_udp_receive_task. This field must be configured only in case field 'use_udp_thread' is set to TRUE.

EventMaskType OSAPI_PortProperty::udp_packet_received_event

Event used to notify the UDP task that an incoming packet has been received. This event is used only in case UDP task is used, that is when field 'use_udp_thread' is set to TRUE.

uint32 OSAPI_PortProperty::log_dst_address

Destination IP address used to send logs to. The format of the address must be compatible with the format needed for function TcpIp_UdpTransmit(), that is in host format instead of network format. I.e. 0xCA00A8C0 would be IP address 192.168.0.202. If 0, logs will not be send to any address. This is the default value.

uint16 OSAPI_PortProperty::log_dst_port

Destination IP port used to send logs to. The format of the port must be compatible with the format needed for function TcpIp_UdpTransmit().


RTI Connext DDS Micro C++ API Version 2.4.14 Copyright © Mon Apr 12 2021 Real-Time Innovations, Inc