Go to the source code of this file.
|
void | taf_someipSvr_ConnectService (void) |
|
le_result_t | taf_someipSvr_TryConnectService (void) |
|
LE_FULL_API void | taf_someipSvr_SetServerDisconnectHandler (taf_someipSvr_DisconnectHandler_t disconnectHandler, void *contextPtr) |
|
LE_FULL_API void | taf_someipSvr_SetNonExitServerDisconnectHandler (taf_someipSvr_DisconnectHandler_t disconnectHandler, void *contextPtr) |
|
void | taf_someipSvr_DisconnectService (void) |
|
taf_someipSvr_ServiceRef_t | taf_someipSvr_GetService (uint16_t serviceId, uint16_t instanceId) |
|
taf_someipSvr_ServiceRef_t | taf_someipSvr_GetServiceEx (uint16_t serviceId, uint16_t instanceId, const char *LE_NONNULL ifName) |
|
le_result_t | taf_someipSvr_SetServiceVersion (taf_someipSvr_ServiceRef_t serviceRef, uint8_t majVer, uint32_t minVer) |
|
le_result_t | taf_someipSvr_SetServicePort (taf_someipSvr_ServiceRef_t serviceRef, uint16_t udpPort, uint16_t tcpPort, bool enableMagicCookies) |
|
le_result_t | taf_someipSvr_OfferService (taf_someipSvr_ServiceRef_t serviceRef) |
|
le_result_t | taf_someipSvr_StopOfferService (taf_someipSvr_ServiceRef_t serviceRef) |
|
le_result_t | taf_someipSvr_EnableEvent (taf_someipSvr_ServiceRef_t serviceRef, uint16_t eventId, uint16_t eventgroupId) |
|
le_result_t | taf_someipSvr_SetEventType (taf_someipSvr_ServiceRef_t serviceRef, uint16_t eventId, taf_someipDef_EventType_t eventType) |
|
le_result_t | taf_someipSvr_SetEventCycleTime (taf_someipSvr_ServiceRef_t serviceRef, uint16_t eventId, uint32_t cycleTime) |
|
le_result_t | taf_someipSvr_DisableEvent (taf_someipSvr_ServiceRef_t serviceRef, uint16_t eventId) |
|
le_result_t | taf_someipSvr_OfferEvent (taf_someipSvr_ServiceRef_t serviceRef, uint16_t eventId) |
|
le_result_t | taf_someipSvr_StopOfferEvent (taf_someipSvr_ServiceRef_t serviceRef, uint16_t eventId) |
|
le_result_t | taf_someipSvr_Notify (taf_someipSvr_ServiceRef_t serviceRef, uint16_t eventId, const uint8_t *dataPtr, size_t dataSize) |
|
taf_someipSvr_RxMsgHandlerRef_t | taf_someipSvr_AddRxMsgHandler (taf_someipSvr_ServiceRef_t serviceRef, taf_someipSvr_RxMsgHandlerFunc_t handlerPtr, void *contextPtr) |
|
void | taf_someipSvr_RemoveRxMsgHandler (taf_someipSvr_RxMsgHandlerRef_t handlerRef) |
|
taf_someipSvr_SubscriptionHandlerRef_t | taf_someipSvr_AddSubscriptionHandler (taf_someipSvr_ServiceRef_t serviceRef, uint16_t eventGroupId, taf_someipSvr_SubscriptionHandlerFunc_t handlerPtr, void *contextPtr) |
|
void | taf_someipSvr_RemoveSubscriptionHandler (taf_someipSvr_SubscriptionHandlerRef_t handlerRef) |
|
le_result_t | taf_someipSvr_GetServiceId (taf_someipSvr_RxMsgRef_t msgRef, uint16_t *serviceIdPtr, uint16_t *instanceIdPtr) |
|
le_result_t | taf_someipSvr_GetMethodId (taf_someipSvr_RxMsgRef_t msgRef, uint16_t *methodIdPtr) |
|
le_result_t | taf_someipSvr_GetClientId (taf_someipSvr_RxMsgRef_t msgRef, uint16_t *clientIdPtr) |
|
le_result_t | taf_someipSvr_GetMsgType (taf_someipSvr_RxMsgRef_t msgRef, uint8_t *msgTypePtr) |
|
le_result_t | taf_someipSvr_GetPayloadSize (taf_someipSvr_RxMsgRef_t msgRef, uint32_t *payloadSizePtr) |
|
le_result_t | taf_someipSvr_GetPayloadData (taf_someipSvr_RxMsgRef_t msgRef, uint8_t *dataPtr, size_t *dataSizePtr) |
|
le_result_t | taf_someipSvr_SendResponse (taf_someipSvr_RxMsgRef_t msgRef, bool isErrRsp, uint8_t returnCode, const uint8_t *dataPtr, size_t dataSize) |
|
le_result_t | taf_someipSvr_ReleaseRxMsg (taf_someipSvr_RxMsgRef_t msgRef) |
|
◆ taf_someipSvr_DisconnectHandler_t
typedef void(* taf_someipSvr_DisconnectHandler_t) (void *) |
Type for handler called when a server disconnects.
◆ taf_someipSvr_ConnectService()
void taf_someipSvr_ConnectService |
( |
void |
| ) |
|
Connect the current client thread to the service providing this API. Block until the service is available.
For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see apiFilesC_client.
This function is created automatically.
◆ taf_someipSvr_TryConnectService()
Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.
For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see apiFilesC_client.
This function is created automatically.
- Returns
- LE_OK if the client connected successfully to the service.
- LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
- LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
- LE_COMM_ERROR if the Service Directory cannot be reached.
◆ taf_someipSvr_SetServerDisconnectHandler()
Set handler called when server disconnection is detected.
When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.
◆ taf_someipSvr_SetNonExitServerDisconnectHandler()
Set handler called when server disconnection is detected without exiting.
When a server connection is lost, call this handler without exit.
- Warning
- When using the API, it needs the application developer to handle some cases like re-connecting and recycling the resources. For most of cases, it is safe to use SetServerDisconnectHandler.
◆ taf_someipSvr_DisconnectService()
void taf_someipSvr_DisconnectService |
( |
void |
| ) |
|
Disconnect the current client thread from the service providing this API.
Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see apiFilesC_client.
This function is created automatically.
◆ taf_someipSvr_GetService()
Gets the reference to a server-service-instance on default network interface.
- Returns
- Reference to the service instance.
- NULL if not allowed to represent the service.
- Parameters
-
[in] | serviceId | Service ID. |
[in] | instanceId | Instance ID. |
◆ taf_someipSvr_GetServiceEx()
Gets the reference to a server-service-instance on a dedicated network interface. The ifName shall match the device name specified in one of the JSON files.
- Returns
- Reference to the service instance.
- NULL if not allowed to represent the service.
- Parameters
-
[in] | serviceId | Service ID. |
[in] | instanceId | Instance ID. |
[in] | ifName | Network interface name. |
◆ taf_someipSvr_SetServiceVersion()
Sets the major and minor version for the server-service-instance. The default major version is 0x00, the minor version is 0x00000000.
NOTE: This API must be called before OfferService() if needed.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or already offered.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | majVer | Major Version. |
[in] | minVer | Minor Version. |
◆ taf_someipSvr_SetServicePort()
Sets up an UDP server and/or a TCP server with given port(s) for the server-service-instance.
NOTE: This API must be called before OfferService() if needed.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or already offered.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | udpPort | Set up an UDP server with the given UDP port for the |
[in] | tcpPort | Set up an TCP server with the given TCP port for the |
[in] | enableMagicCookies | If TCP magic cookie is enabled when TCP server is set |
◆ taf_someipSvr_OfferService()
Offers a server-service-instance. The TCP port or/and UDP port must be set if the service need to be offered remotely, otherwise it's only offered locally.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client.
- LE_DUPLICATE – The service is already offered.
- Parameters
-
[in] | serviceRef | Service Reference. |
◆ taf_someipSvr_StopOfferService()
Stops offering a server-service-instance. It also stops offering all events of the service.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client.
- LE_DUPLICATE – The service is already stopped.
- Parameters
-
[in] | serviceRef | Service Reference. |
◆ taf_someipSvr_EnableEvent()
Enables an event by adding it to an event group.
NOTE: This API must be called before offerEvent() and can be called for multiple times if the event need to be added into more than one event groups.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or if the event is already offered.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | eventId | Event ID, valid range: 0x8001 to 0xFFFE. |
[in] | eventgroupId | Event Group ID, valid range: 0x0001 to 0xFFFE. |
◆ taf_someipSvr_SetEventType()
Sets the event type for an event of a service.
NOTE: The default event type is ET_EVENT and the API must be called before OfferEvent() if needed.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or if the event is already offered.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | eventId | Event ID. |
[in] | eventType | Event Type. |
◆ taf_someipSvr_SetEventCycleTime()
Sets the cycle time for an periodic event notification(ET_EVENT) of a service. By default the cycle time is 0 which means periodic event notification is disabled.
NOTE: This API has no effect for field notification(ET_FIELD) and must be called before OfferEvent() if needed.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or the event is already offered or not ET_EVENT type.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | eventId | Event ID. |
[in] | cycleTime | Cycle Time in milliseconds. |
◆ taf_someipSvr_DisableEvent()
Disables an event by removing it from all added event groups.
NOTE: This API must be called before OfferEvent() if needed.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or if the event is already offered.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | eventId | Event ID. |
◆ taf_someipSvr_OfferEvent()
Offers an event which is enabled for a server-service-instance.
NOTE: This API must be called after OfferService() and EnableEvent() if needed.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or not offered, or the event is not enabled.
- LE_DUPLICATE – The event is already offered.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | eventId | Event ID. |
◆ taf_someipSvr_StopOfferEvent()
Stops offering an event for a server-service-instance.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or not offered, or the event is not enabled.
- LE_DUPLICATE – The event is already stopped.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | eventId | Event ID. |
◆ taf_someipSvr_Notify()
Fires an event or field notification. The specified event is updated with the specified payload Data. Dependent on the type of the event, the payload is distributed to all notified clients (always for events, only if the payload has changed for fields).
NOTE: This API is only available after offerService() and OfferEvent().
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid serviceRef.
- LE_NOT_PERMITTED – The service is not set up by the client or not offered, or the event is not enabled or not offered.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | eventId | Event ID. |
[in] | dataPtr | Payload Data. |
[in] | dataSize | |
◆ taf_someipSvr_AddRxMsgHandler()
Add handler function for EVENT 'taf_someipSvr_RxMsg'
This event provides information on Rx message.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | handlerPtr | |
[in] | contextPtr | |
◆ taf_someipSvr_RemoveRxMsgHandler()
Remove handler function for EVENT 'taf_someipSvr_RxMsg'
- Parameters
-
◆ taf_someipSvr_AddSubscriptionHandler()
Add handler function for EVENT 'taf_someipSvr_Subscription'
This event provides information on the event group subscription status.
- Parameters
-
[in] | serviceRef | Service Reference. |
[in] | eventGroupId | Event Group ID. |
[in] | handlerPtr | |
[in] | contextPtr | |
◆ taf_someipSvr_RemoveSubscriptionHandler()
Remove handler function for EVENT 'taf_someipSvr_Subscription'
- Parameters
-
◆ taf_someipSvr_GetServiceId()
Gets the service ID and Instance ID of the Rx Message.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid msgRef.
- Parameters
-
[in] | msgRef | Rx Message Reference. |
[out] | serviceIdPtr | Service ID. |
[out] | instanceIdPtr | Instance ID. |
◆ taf_someipSvr_GetMethodId()
Gets the method ID of the Rx message.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid msgRef.
- Parameters
-
[in] | msgRef | Rx Message reference. |
[out] | methodIdPtr | Method ID. |
◆ taf_someipSvr_GetClientId()
Gets the client ID of the Rx message.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid msgRef.
- Parameters
-
[in] | msgRef | Rx Message reference. |
[out] | clientIdPtr | Client ID. |
◆ taf_someipSvr_GetMsgType()
Gets the message type of the Rx message. The possible message type can be MT_REQUEST(0x00) or MT_REQUEST_NO_RETURN(0x01).
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid msgRef.
- Parameters
-
[in] | msgRef | Rx Message reference. |
[out] | msgTypePtr | Message Type. |
◆ taf_someipSvr_GetPayloadSize()
Gets the payload size of the Rx message.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid msgRef.
- Parameters
-
[in] | msgRef | Rx Message reference. |
[out] | payloadSizePtr | Payload Size in bytes. |
◆ taf_someipSvr_GetPayloadData()
Gets the payload data of the Rx message.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid msgRef.
- Parameters
-
[in] | msgRef | Rx Message reference. |
[out] | dataPtr | Payload Data. |
[in,out] | dataSizePtr | |
◆ taf_someipSvr_SendResponse()
Sends a response message for a Rx message. The Rx message is automatically freed after sending the response successfully.
NOTE: Only the message type MT_REQUEST(0x00) is allowed to send a response.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid msgRef.
- LE_NOT_PERMITTED – The msgRef is not a MT_REQUEST message, or the response message type is MT_ERROR(0x81) with returnCode E_OK(0x00), or the service of the msgRef is not set up by the client or not offered.
- Parameters
-
[in] | msgRef | Rx Message reference. |
[in] | isErrRsp | True with message type MT_ERROR(0x81), |
[in] | returnCode | Return Code. |
[in] | dataPtr | Payload Data. |
[in] | dataSize | |
◆ taf_someipSvr_ReleaseRxMsg()
Releases a Rx message.
- Returns
- LE_OK – Succeeded.
- LE_BAD_PARAMETER – Invalid msgRef or invalid service of the msgRef.
- LE_NOT_PERMITTED – The service of the msgRef is not set up by the client.
- Parameters
-
[in] | msgRef | Rx Message reference. |