forked from RIOT-OS/RIOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsomeip.h
73 lines (64 loc) · 1.68 KB
/
someip.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* Copyright (C) 2020 HAW Hamburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup net_someip SOME/IP
* @ingroup net
* @brief Provides SOME/IP header and field defines
*
* @{
*
* @file
* @brief SOME/IP header and field definitions
*
* @author Jannes Volkens <jannes.volkens@haw-hamburg.de>
*/
#ifndef NET_SOMEIP_H
#define NET_SOMEIP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/**
* @brief SOME/IP header length size, excluding payload
*/
#define SOMEIP_HDR_LENGTH (8U)
/**
* @brief SOME/IP full header size, including all field expect for the payload
*/
#define SOMEIP_FULL_HDR_SIZE (16U)
/**
* @brief Structure of the Message ID
*/
typedef struct {
uint16_t service_id; /**< Service ID */
uint16_t method_id; /**< Method ID */
} someip_message_id_t;
/**
* @brief Structure of the Request ID
*/
typedef struct {
uint16_t client_id; /**< Client ID */
uint16_t session_id; /**< Session ID */
} someip_request_id_t;
/**
* @brief SOME/IP header
*/
typedef struct __attribute__((packed)) {
someip_message_id_t message_id; /**< Message ID */
uint32_t length; /**< Length */
someip_request_id_t request_id; /**< Request ID */
uint8_t protocol_version; /**< Protocol Version */
uint8_t interface_version; /**< Interface Version*/
uint8_t msg_type; /**< Message Type*/
uint8_t return_code; /**< Return Code*/
} someip_hdr_t;
#ifdef __cplusplus
}
#endif
#endif /* NET_SOMEIP_H */
/** @} */