Source file: /~heha/hs/bl/hid-flash.zip/src/rs232.h

/*
 This rs232 source code file is a customized version for HID Bootloader project
 (c) 2005-2017	Teunis van Beelen  teuniz@gmail.com
    2018-05-10	Vassilis Serasidis http://www.serasidis.gr <avrsite@yahoo.gr>
*/
#pragma once
#ifdef _WIN32
#include <windows.h>	// HANDLE
#else
#include <termios.h>	// termios
#endif

struct RS232{
 RS232(const char*);
 RS232(int);
 int SendByte(unsigned char);
 int ReadByte();
 ~RS232();
 void enableDTR();
 void disableDTR();
 void enableRTS();
 void disableRTS();
 void send_magic();
 operator bool() const {return !!hCom;}
private:
#ifdef _WIN32
 HANDLE hCom;
#else
 int hCom;
 termios old_termios;
 void change_status(int a, int x=0);
#endif
};
Detected encoding: ASCII (7 bit)2