MCPcopy Create free account
hub / github.com/SunOner/sunone_aimbot_2 / Arduino

Method Arduino

sunone_aimbot_2/mouse/Arduino.cpp:11–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "Arduino.h"
10
11Arduino::Arduino(const std::string& port, unsigned int baud_rate, ArduinoProtocol protocol)
12 : protocol_(protocol),
13 button_mask_(0),
14 is_open_(false),
15 timer_running_(false),
16 listening_(false),
17 aiming_active(false),
18 shooting_active(false),
19 zooming_active(false)
20{
21 try
22 {
23 serial_.setPort(port);
24 serial_.setBaudrate(baud_rate);
25 serial_.open();
26
27 if (serial_.isOpen())
28 {
29 is_open_ = true;
30 std::cout << "[Arduino] Connected! PORT: " << port << std::endl;
31
32 if (config.arduino_enable_keys || protocol_ == ArduinoProtocol::Teensy41)
33 {
34 startListening();
35 }
36 }
37 else
38 {
39 std::cerr << "[Arduino] Unable to connect to the port: " << port << std::endl;
40 }
41 }
42 catch (std::exception& e)
43 {
44 std::cerr << "[Arduino] Error: " << e.what() << std::endl;
45 }
46}
47
48Arduino::~Arduino()
49{

Callers

nothing calls this directly

Calls 2

openMethod · 0.45
isOpenMethod · 0.45

Tested by

no test coverage detected