1 /*
2  * Copyright 2017, NXP
3  * All rights reserved.
4  *
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef __SRTM_SERVICE_STRUCT_H__
10 #define __SRTM_SERVICE_STRUCT_H__
11 
12 #include "srtm_defs.h"
13 #include "srtm_list.h"
14 
15 /*******************************************************************************
16  * Definitions
17  ******************************************************************************/
18 /**
19  * @brief SRTM service struct
20  */
21 struct _srtm_service
22 {
23     srtm_list_t node; /*!< SRTM service list node to link to a list */
24     srtm_dispatcher_t dispatcher;
25     uint8_t category;
26 
27     void (*destroy)(srtm_service_t service);
28     srtm_status_t (*request)(srtm_service_t service, srtm_request_t request);
29     srtm_status_t (*notify)(srtm_service_t service, srtm_notification_t notification);
30 };
31 
32 /*******************************************************************************
33  * API
34  ******************************************************************************/
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /*!
40  * @brief Compare message and service version to see if the service can serve.
41  *
42  * @param service SRTM service handle.
43  * @param msg The message to check.
44  * @param svcVer The service version to check.
45  * @return SRTM_Status_Success on success and others on failure.
46  */
47 srtm_status_t SRTM_Service_CheckVersion(srtm_service_t service, srtm_message_t msg, uint16_t svcVer);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 /*! @} */
54 
55 #endif /* __SRTM_SERVICE_STRUCT_H__ */
56