Init basesystem source codes.
[staging/basesystem.git] / stub / communication_subcpu / client / include / stub / com_message_header.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef COMMUNICATION_SUBCPU_CLIENT_INCLUDE_PERIPHERAL_SERVICE_COM_MESSAGE_HEADER_H_
18 #define COMMUNICATION_SUBCPU_CLIENT_INCLUDE_PERIPHERAL_SERVICE_COM_MESSAGE_HEADER_H_
19
20 /**
21  * @file com_message_header.h
22  * @~english
23  * @brief Defination of structure for message header
24  */
25
26 #include <sys/types.h>
27
28 /****************************************************************************
29  * TAG      : typedef T_APIMSG_HEADER
30  * ABSTRACT : _CWORD64_API message header structure
31  * NOTE     :
32  ****************************************************************************/
33 /*!
34  * @~english
35  * @brief Structure for message header
36  */
37 typedef struct {
38   uint16_t replyid;      //!< \~english Send Result ID
39   uint16_t sndpno;       //!< \~english Send process No
40   uint16_t respno;       //!< \~english Response No
41   uint16_t cid;          //!< \~english Command ID
42   uint16_t msgbodysize;  //!< \~english Message body size
43   uint8_t rid;           //!< \~english Resource ID
44   uint8_t reserve;       //!< \~english Reserve
45   uint8_t filler[2];     //!< \~english filler
46 } T_APIMSG_HEADER_COMM;
47
48 /*!
49  * @~english
50  * @brief Structure for buffer message header
51  */
52 typedef struct {
53   uint32_t signo;            //!< \~english Signal No
54   T_APIMSG_HEADER_COMM hdr;  //!< \~english Message Header
55 } T_APIMSG_MSGBUF_HEADER_COMM;
56
57 /*!
58  * @~english  @brief Check for assert do not overflow buffer when Re-arrangement was cast to another structure
59  */
60 #define assert_static(e)                \
61   do {                                  \
62     enum { assert_static__ = 1 / (e) }; \
63   } while (0)
64
65 #endif  // COMMUNICATION_SUBCPU_CLIENT_INCLUDE_PERIPHERAL_SERVICE_COM_MESSAGE_HEADER_H_