eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_transport.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  */
9 
10 #ifndef _EMBEDDED_RPC__TRANSPORT_H_
11 #define _EMBEDDED_RPC__TRANSPORT_H_
12 
13 #include "erpc_common.h"
14 #include "erpc_crc16.hpp"
15 #include "erpc_message_buffer.hpp"
16 
17 #include <cstring>
18 
25 // Classes
28 
29 namespace erpc {
30 
36 class Transport
37 {
38 public:
42  Transport(void) {}
43 
47  virtual ~Transport(void) {}
48 
54  virtual uint8_t reserveHeaderSize(void) { return 0; }
55 
65  virtual erpc_status_t receive(MessageBuffer *message) = 0;
66 
76  virtual erpc_status_t send(MessageBuffer *message) = 0;
77 
87  virtual bool hasMessage(void) { return true; }
88 
94  virtual void setCrc16(Crc16 *crcImpl) { (void)crcImpl; }
95 
101  virtual Crc16 *getCrc16(void) { return NULL; }
102 };
103 
110 {
111 public:
116 
120  virtual ~TransportFactory(void) {}
121 
127  virtual Transport *create(void) = 0;
128 };
129 
130 } // namespace erpc
131 
134 #endif // _EMBEDDED_RPC__TRANSPORT_H_
Abstract interface for transport layer.
Definition: erpc_transport.hpp:36
virtual uint8_t reserveHeaderSize(void)
Size of data placed in MessageBuffer before serializing eRPC data.
Definition: erpc_transport.hpp:54
Abstract interface for transport factory.
Definition: erpc_transport.hpp:109
virtual ~Transport(void)
Transport destructor.
Definition: erpc_transport.hpp:47
Transport(void)
Constructor.
Definition: erpc_transport.hpp:42
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
virtual bool hasMessage(void)
Poll for an incoming message.
Definition: erpc_transport.hpp:87
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.hpp:37
Definition: erpc_arbitrated_client_manager.hpp:25
virtual erpc_status_t send(MessageBuffer *message)=0
Prototype for send message.
TransportFactory(void)
Constructor.
Definition: erpc_transport.hpp:115
Class for compute crc16.
Definition: erpc_crc16.hpp:29
virtual Crc16 * getCrc16(void)
This functions gets the CRC-16 object.
Definition: erpc_transport.hpp:101
virtual erpc_status_t receive(MessageBuffer *message)=0
Prototype for receiving message.
virtual ~TransportFactory(void)
TransportFactory destructor.
Definition: erpc_transport.hpp:120
virtual void setCrc16(Crc16 *crcImpl)
This functions sets the CRC-16 implementation.
Definition: erpc_transport.hpp:94