Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
ait_link_impl.h@3:bfc4928cd279, 2016-04-06 (annotated)
- Committer:
- bhepp
- Date:
- Wed Apr 06 08:27:25 2016 +0000
- Revision:
- 3:bfc4928cd279
- Parent:
- 2:502d1a5f79a0
Updated license
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bhepp | 3:bfc4928cd279 | 1 | // |
| bhepp | 3:bfc4928cd279 | 2 | // HDLC based serial communication class. |
| bhepp | 3:bfc4928cd279 | 3 | // |
| bhepp | 3:bfc4928cd279 | 4 | // Created by Benjamin Hepp on 02.04.16. |
| bhepp | 3:bfc4928cd279 | 5 | // Copyright (c) 2016 Benjamin Hepp. All rights reserved. |
| bhepp | 3:bfc4928cd279 | 6 | // |
| bhepp | 3:bfc4928cd279 | 7 | |
| bhepp | 2:502d1a5f79a0 | 8 | #pragma once |
| bhepp | 2:502d1a5f79a0 | 9 | |
| bhepp | 2:502d1a5f79a0 | 10 | #include "ait_link.h" |
| bhepp | 2:502d1a5f79a0 | 11 | |
| bhepp | 2:502d1a5f79a0 | 12 | #ifdef __MBED__ |
| bhepp | 2:502d1a5f79a0 | 13 | |
| bhepp | 2:502d1a5f79a0 | 14 | #include "ait_link_mbed.h" |
| bhepp | 2:502d1a5f79a0 | 15 | |
| bhepp | 2:502d1a5f79a0 | 16 | #else |
| bhepp | 2:502d1a5f79a0 | 17 | |
| bhepp | 2:502d1a5f79a0 | 18 | #include "Serial.h" |
| bhepp | 2:502d1a5f79a0 | 19 | |
| bhepp | 2:502d1a5f79a0 | 20 | namespace ait { |
| bhepp | 0:8e8dfc870cb2 | 21 | |
| bhepp | 2:502d1a5f79a0 | 22 | class AITLinkImpl : public AITLink { |
| bhepp | 2:502d1a5f79a0 | 23 | public: |
| bhepp | 2:502d1a5f79a0 | 24 | AITLinkImpl(Serial* serial, uint16_t max_frame_length = 1024) |
| bhepp | 2:502d1a5f79a0 | 25 | : AITLink(max_frame_length), serial_(serial) { |
| bhepp | 2:502d1a5f79a0 | 26 | } |
| bhepp | 2:502d1a5f79a0 | 27 | |
| bhepp | 2:502d1a5f79a0 | 28 | virtual ~AITLinkImpl() { |
| bhepp | 2:502d1a5f79a0 | 29 | } |
| bhepp | 2:502d1a5f79a0 | 30 | |
| bhepp | 2:502d1a5f79a0 | 31 | virtual void sendChar(uint8_t data) { |
| bhepp | 2:502d1a5f79a0 | 32 | serial_->write(data); |
| bhepp | 2:502d1a5f79a0 | 33 | } |
| bhepp | 2:502d1a5f79a0 | 34 | |
| bhepp | 2:502d1a5f79a0 | 35 | private: |
| bhepp | 2:502d1a5f79a0 | 36 | Serial* serial_; |
| bhepp | 2:502d1a5f79a0 | 37 | }; |
| bhepp | 2:502d1a5f79a0 | 38 | |
| bhepp | 2:502d1a5f79a0 | 39 | } |
| bhepp | 2:502d1a5f79a0 | 40 | |
| bhepp | 2:502d1a5f79a0 | 41 | #endif // __MBED__ |