Benjamin Hepp / ait_link
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ait_link_impl.h Source File

ait_link_impl.h

00001 //
00002 // HDLC based serial communication class.
00003 //
00004 // Created by Benjamin Hepp on 02.04.16.
00005 // Copyright (c) 2016 Benjamin Hepp. All rights reserved.
00006 //
00007 
00008 #pragma once
00009 
00010 #include "ait_link.h"
00011 
00012 #ifdef __MBED__
00013 
00014 #include "ait_link_mbed.h"
00015 
00016 #else
00017 
00018 #include "Serial.h"
00019 
00020 namespace ait {
00021 
00022 class AITLinkImpl : public AITLink {
00023 public:
00024     AITLinkImpl(Serial* serial, uint16_t max_frame_length = 1024)
00025         : AITLink(max_frame_length), serial_(serial) {
00026     }
00027 
00028     virtual ~AITLinkImpl() {
00029     }
00030 
00031     virtual void sendChar(uint8_t data) {
00032       serial_->write(data);
00033     }
00034 
00035 private:
00036   Serial* serial_;
00037 };
00038 
00039 }
00040 
00041 #endif // __MBED__