| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- File List
- File Members

erpc_serial_transport.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2014, Freescale Semiconductor, Inc.
3 * Copyright 2016 NXP
4 * All rights reserved.
5 *
6 *
7 * SPDX-License-Identifier: BSD-3-Clause
8 */
9
10 #ifndef _EMBEDDED_RPC__SERIAL_TRANSPORT_H_
11 #define _EMBEDDED_RPC__SERIAL_TRANSPORT_H_
12
13 #include "erpc_framed_transport.h"
14
15 #include <string>
16
17 #ifdef _WIN32
18 typedef long speed_t;
19 #else
20 #include <termios.h>
21 #endif
22
29 // Classes
32
33 namespace erpc {
39 class SerialTransport : public FramedTransport
40 {
41 public:
48 SerialTransport(const char *portName, speed_t baudRate);
49
53 virtual ~SerialTransport(void);
54
63 erpc_status_t init(uint8_t vtime, uint8_t vmin);
64
65 private:
75 virtual erpc_status_t underlyingSend(const uint8_t *data, uint32_t size);
76
86 virtual erpc_status_t underlyingReceive(uint8_t *data, uint32_t size);
87
88 private:
89 int m_serialHandle;
90 const char *m_portName;
91 speed_t m_baudRate;
92 };
93
94 } // namespace erpc
95
98 #endif // _EMBEDDED_RPC__SERIAL_TRANSPORT_H_
erpc::FramedTransport
Base class for framed transport layers.
Definition: erpc_framed_transport.h:56
erpc_status_t
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:87
erpc_framed_transport.h
erpc::SerialTransport::init
erpc_status_t init(uint8_t vtime, uint8_t vmin)
Initialize Serial peripheral.
Definition: erpc_serial_transport.cpp:45
erpc
Definition: erpc_arbitrated_client_manager.h:25
erpc::SerialTransport
Serial transport layer for host PC.
Definition: erpc_serial_transport.h:39
erpc::SerialTransport::SerialTransport
SerialTransport(const char *portName, speed_t baudRate)
Constructor.
Definition: erpc_serial_transport.cpp:33
erpc::SerialTransport::~SerialTransport
virtual ~SerialTransport(void)
Destructor.
Definition: erpc_serial_transport.cpp:40