114 lines
4.7 KiB
C++
114 lines
4.7 KiB
C++
|
|
/*============================================================================*/
|
||
|
|
/* Copyright (C) huaxu (2026).
|
||
|
|
*
|
||
|
|
* All rights reserved. This software is huaxu property. Duplication
|
||
|
|
* or disclosure without huaxu written authorization is prohibited.
|
||
|
|
*
|
||
|
|
* @file someip_client_cfg.hpp
|
||
|
|
* @brief head file of someip ids
|
||
|
|
* @author LiuZhimin
|
||
|
|
* @date 2026-02-24 15:20:00
|
||
|
|
*/
|
||
|
|
/*============================================================================*/
|
||
|
|
/*=======[R E V I S I O N H I S T O R Y]====================================*/
|
||
|
|
/* <VERSION> <DATE> <AUTHOR> <REVISION LOG>
|
||
|
|
* V0.0.1 20260606 Liuzhimin Initial Version
|
||
|
|
*/
|
||
|
|
/*============================================================================*/
|
||
|
|
|
||
|
|
#ifndef SOMEIP_CLIENT_CFG_HPP
|
||
|
|
#define SOMEIP_CLIENT_CFG_HPP
|
||
|
|
|
||
|
|
/*=======[I N C L U D E S]====================================================*/
|
||
|
|
|
||
|
|
#include "someip_client.hpp"
|
||
|
|
|
||
|
|
/*=======[M A C R O S]========================================================*/
|
||
|
|
|
||
|
|
/*--- TOOLS GENERATE BEGIN ---*/
|
||
|
|
|
||
|
|
#if 0 /* Not used */
|
||
|
|
#define VSOMEIP_CONFIGURATION "/etc/vsomeip/tbox_service.json"
|
||
|
|
#define APP_NAME "my_app"
|
||
|
|
#define USE_TCP (1u)
|
||
|
|
#define USE_UDP (2u)
|
||
|
|
#define USE_PROTOCAL USE_TCP
|
||
|
|
#define USE_STATIC_ROUTING false
|
||
|
|
#define OFFER_F_F_METHOD false
|
||
|
|
#define OFFER_R_R_METHOD true
|
||
|
|
#define OFFER_SETTER true
|
||
|
|
#define OFFER_GETTER true
|
||
|
|
#define OFFER_EVENT true
|
||
|
|
#endif
|
||
|
|
|
||
|
|
/* These IDs is just an example, please refer to SomeIp Matrix */
|
||
|
|
/* ServiceID */
|
||
|
|
#define S_SYSTEM_SERVER_ID 0x0001
|
||
|
|
#define S_SYSTEM_INSTANCE_ID 0x0001
|
||
|
|
#define S_AC_SERVER_ID 0x0002
|
||
|
|
#define S_AC_INSTANCE_ID 0x0001
|
||
|
|
|
||
|
|
#define R_SYSTEM_SERVER_ID 0x8001
|
||
|
|
#define R_SYSTEM_INSTANCE_ID 0x0001
|
||
|
|
#define R_AC_SERVER_ID 0x8002
|
||
|
|
#define R_AC_INSTANCE_ID 0x0001
|
||
|
|
|
||
|
|
/* MethodID */
|
||
|
|
#define RR_METHOD_EXAMPLE1 0x0001
|
||
|
|
#define RR_METHOD_EXAMPLE2 0x0002
|
||
|
|
#define FF_METHOD_EXAMPLE1 0x1001
|
||
|
|
#define FF_METHOD_EXAMPLE2 0x1002
|
||
|
|
#define GETTER_EXAMPLE1 0x2001
|
||
|
|
#define GETTER_EXAMPLE2 0x2002
|
||
|
|
#define SETTER_EXAMPLE1 0x3001
|
||
|
|
#define SETTER_EXAMPLE2 0x3002
|
||
|
|
#define EVENT_EXAMPLE1 0x4001
|
||
|
|
#define EVENT_EXAMPLE2 0x4002
|
||
|
|
#define EVENTGROUP_EXAMPLE1 0x0001
|
||
|
|
#define NOTIFIER_EXAMPLE1 0x5001
|
||
|
|
#define NOTIFIER_EXAMPLE2 0x5002
|
||
|
|
#define EVENTGROUP_EXAMPLE2 0x0002
|
||
|
|
|
||
|
|
|
||
|
|
/*=======[P A R A M T Y P E D E F]==========================================*/
|
||
|
|
|
||
|
|
/*=======[E X P O R T D A T A]==============================================*/
|
||
|
|
|
||
|
|
/*=======[E X P O R T F U N C T I O N D E C L A R A T I O N S]============*/
|
||
|
|
|
||
|
|
|
||
|
|
/* CLIENT */
|
||
|
|
extern std::vector<byte_t> req_rr_method_example1(void);
|
||
|
|
extern std::vector<byte_t> req_ff_method_example1(void);
|
||
|
|
extern std::vector<byte_t> req_getter_example1(void);
|
||
|
|
extern std::vector<byte_t> req_setter_example1(void);
|
||
|
|
|
||
|
|
extern void msg_rr_method_example1(const std::shared_ptr<message> &_response);
|
||
|
|
extern void msg_ff_method_example1(const std::shared_ptr<message> &_response);
|
||
|
|
extern void msg_getter_example1(const std::shared_ptr<message> &_response);
|
||
|
|
extern void msg_setter_example1(const std::shared_ptr<message> &_response);
|
||
|
|
extern void msg_event_example1(const std::shared_ptr<message> &_response);
|
||
|
|
extern void msg_notifier_example1(const std::shared_ptr<message> &_response);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
inline std::vector<request_method_t> request_methods = {
|
||
|
|
{S_SYSTEM_SERVER_ID, S_SYSTEM_INSTANCE_ID,RR_METHOD_EXAMPLE1,req_rr_method_example1,message_type_e::MT_REQUEST,msg_rr_method_example1},
|
||
|
|
{S_SYSTEM_SERVER_ID, S_SYSTEM_INSTANCE_ID,FF_METHOD_EXAMPLE1,req_ff_method_example1,message_type_e::MT_REQUEST_NO_RETURN,nullptr},
|
||
|
|
{S_SYSTEM_SERVER_ID, S_SYSTEM_INSTANCE_ID,GETTER_EXAMPLE1,req_getter_example1,message_type_e::MT_REQUEST,msg_getter_example1},
|
||
|
|
{S_SYSTEM_SERVER_ID, S_SYSTEM_INSTANCE_ID,SETTER_EXAMPLE2,req_setter_example1,message_type_e::MT_REQUEST,msg_setter_example1},
|
||
|
|
|
||
|
|
};
|
||
|
|
inline std::vector<request_event_t> request_events = {
|
||
|
|
{S_SYSTEM_SERVER_ID, S_SYSTEM_INSTANCE_ID, EVENTGROUP_EXAMPLE1, EVENT_EXAMPLE1, event_type_e::ET_EVENT,msg_event_example1},
|
||
|
|
{S_SYSTEM_SERVER_ID, S_SYSTEM_INSTANCE_ID, EVENTGROUP_EXAMPLE2, NOTIFIER_EXAMPLE1, event_type_e::ET_FIELD,msg_notifier_example1},
|
||
|
|
};
|
||
|
|
inline std::vector<request_service_t> request_services = {
|
||
|
|
{S_SYSTEM_SERVER_ID, S_SYSTEM_INSTANCE_ID},
|
||
|
|
// {S_AC_SERVER_ID, S_AC_INSTANCE_ID}
|
||
|
|
};
|
||
|
|
|
||
|
|
/*--- TOOLS GENERATE END ---*/
|
||
|
|
|
||
|
|
#endif // SOMEIP_CLIENT_CFG_HPP
|