b15f/drv/b15f.h

44 lines
713 B
C
Raw Normal View History

2019-03-26 08:57:01 +00:00
#ifndef B15F_h
#define B15F_h
#include <iostream>
2019-03-26 10:35:20 +00:00
#include <bits/stdc++.h>
#include <string>
#include <fstream>
#include <cstdlib>
#include <cstdint>
/*#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>*/
#include "driverexception.h"
2019-03-26 08:57:01 +00:00
class B15F
{
private:
B15F(void); // privater Konstruktor
public:
void init(void);
2019-03-26 10:35:20 +00:00
bool testConnection(void);
void writeByte(uint8_t);
uint8_t readByte(void);
2019-03-26 08:57:01 +00:00
static B15F& getInstance(void);
private:
2019-03-26 10:35:20 +00:00
std::fstream usart;
2019-03-26 08:57:01 +00:00
static B15F* instance;
2019-03-26 10:35:20 +00:00
// CONSTANTS
const std::string SERIAL_DEVICE = "/dev/ttyUSB0";
constexpr static uint8_t MSG_OK = 0xFF;
constexpr static uint8_t MSG_FAIL = 0xFE;
2019-03-26 08:57:01 +00:00
};
#endif // B15F_h