-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1aaac0
commit 16a071d
Showing
9 changed files
with
399 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
#pragma once | ||
#pragma comment(lib, "Setupapi.lib") | ||
#include <Windows.h> | ||
|
||
#include <thread> | ||
#include <iostream> | ||
#include <windows.h> | ||
#include <devguid.h> | ||
#include <SetupAPI.h> | ||
|
||
using namespace std; | ||
using namespace chrono; | ||
using namespace this_thread; | ||
|
||
class Arduino | ||
{ | ||
public: | ||
Arduino(LPCSTR device_name); | ||
~Arduino(); | ||
bool send_data(const string& message) const; | ||
bool available() const; | ||
string readStringUntil(char delimiter) const; | ||
static bool get_device(LPCSTR friendly_name, LPSTR com_port); | ||
~Arduino(); | ||
Arduino(LPCSTR device_name); | ||
|
||
bool WriteMessage(const string& message) const; | ||
string ReceiveMessage(char delimiter) const; | ||
|
||
private: | ||
HANDLE m_hArduino; | ||
HANDLE m_arduinoHandle; | ||
bool IsAvailable() const; | ||
bool GetDevice(LPCSTR friendly_name, LPSTR com_port); | ||
}; |
Oops, something went wrong.