| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- File List
- File Members

erpc_transport.h
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.h"
15 #include "erpc_message_buffer.h"
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
58 virtual erpc_status_t receive(MessageBuffer *message) = 0;
59
69 virtual erpc_status_t send(MessageBuffer *message) = 0;
70
80 virtual bool hasMessage(void) { return true; }
81
87 virtual void setCrc16(Crc16 *crcImpl) { (void)crcImpl; }
88 };
89
95 class TransportFactory
96 {
97 public:
101 TransportFactory(void) {}
105 virtual ~TransportFactory(void) {}
111 virtual Transport *create(void) = 0;
112 };
113
114 } // namespace erpc
115
118 #endif // _EMBEDDED_RPC__TRANSPORT_H_
erpc::Transport
Abstract interface for transport layer.
Definition: erpc_transport.h:36
erpc::TransportFactory
Abstract interface for transport factory.
Definition: erpc_transport.h:95
erpc::Transport::~Transport
virtual ~Transport(void)
Transport destructor.
Definition: erpc_transport.h:47
erpc::Transport::Transport
Transport(void)
Constructor.
Definition: erpc_transport.h:42
erpc_status_t
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:87
erpc::Transport::hasMessage
virtual bool hasMessage(void)
Poll for an incoming message.
Definition: erpc_transport.h:80
erpc_crc16.h
erpc::MessageBuffer
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.h:37
erpc
Definition: erpc_arbitrated_client_manager.h:25
erpc::Transport::send
virtual erpc_status_t send(MessageBuffer *message)=0
Prototype for send message.
erpc::TransportFactory::TransportFactory
TransportFactory(void)
Constructor.
Definition: erpc_transport.h:101
erpc::Crc16
Class for compute crc16.
Definition: erpc_crc16.h:29
erpc_message_buffer.h
erpc::Transport::receive
virtual erpc_status_t receive(MessageBuffer *message)=0
Prototype for receiving message.
erpc::TransportFactory::~TransportFactory
virtual ~TransportFactory(void)
TransportFactory destructor.
Definition: erpc_transport.h:105
erpc::Transport::setCrc16
virtual void setCrc16(Crc16 *crcImpl)
This functions sets the CRC-16 implementation.
Definition: erpc_transport.h:87