sys/include/net: Add suggested changes

This commit is contained in:
Jannes 2020-07-16 14:44:47 +02:00
parent 0c04de92ac
commit 37cb65971f

View File

@ -28,42 +28,43 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#define SOMEIP_MAX_PLEN (1400) /**< SOME/IP maximum payload length */ /**
#define SOMEIP_HDR_LENGTH (8) /**< SOME/IP header length size, excluding payload */ * @brief SOME/IP header length size, excluding payload
#define SOMEIP_FULL_HDR_SIZE (16) /**< SOME/IP full header size, including all fields except for the 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 * @brief Structure of the Message ID
*/ */
struct message_id typedef struct {
{ uint16_t service_id; /**< Service ID */
uint16_t service_id; /**< Service ID */ uint16_t method_id; /**< Method ID */
uint16_t method_id; /**< Method ID */ } someip_message_id_t;
};
/** /**
* @brief Structure of the Request ID * @brief Structure of the Request ID
*/ */
struct request_id typedef struct {
{ uint16_t client_id; /**< Client ID */
uint16_t client_id; /**< Client ID */ uint16_t session_id; /**< Session ID */
uint16_t session_id; /**< Session ID */ } someip_request_id_t;
};
/** /**
* @brief SOME/IP header * @brief SOME/IP header
*/ */
typedef struct __attribute__((packed)) typedef struct __attribute__((packed)) {
{ someip_message_id_t message_id; /**< Message ID */
struct message_id message_id; /**< Message ID */ uint32_t length; /**< Length */
uint32_t length; /**< Length */ someip_request_id_t request_id; /**< Request ID */
struct request_id request_id; /**< Request ID */ uint8_t protocol_version; /**< Protocol Version */
uint8_t protocol_version; /**< Protocol Version */ uint8_t interface_version; /**< Interface Version*/
uint8_t interface_version; /**< Interface Version*/ uint8_t msg_type; /**< Message Type*/
uint8_t msg_type; /**< Message Type*/ uint8_t return_code; /**< Return Code*/
uint8_t return_code; /**< Return Code*/ } someip_hdr_t;
uint8_t payload[SOMEIP_MAX_PLEN]; /**< Payload */
} someip_hdr_t;
#ifdef __cplusplus #ifdef __cplusplus
} }