radio_tool 0.2.1
Loading...
Searching...
No Matches
tyt_sgl_radio.hpp
1
18#pragma once
19
20#include <radio_tool/radio/radio.hpp>
21#include <radio_tool/hid/tyt_hid.hpp>
22
23#include <functional>
24
25namespace radio_tool::radio
26{
28 {
29 public:
30 TYTSGLRadio(libusb_device_handle* h);
31
32 auto WriteFirmware(const std::string& file) -> void override;
33 auto ToString() const -> const std::string override;
34
35 static auto SupportsDevice(const libusb_device_descriptor& dev) -> bool
36 {
37 if (dev.idVendor == hid::TYTHID::VID && dev.idProduct == hid::TYTHID::PID)
38 {
39 return true;
40 }
41 return false;
42 }
43
44 static auto Create(libusb_device_handle* h) -> TYTSGLRadio*
45 {
46 return new TYTSGLRadio(h);
47 }
48 private:
49 hid::TYTHID device;
50 auto checksum(std::vector<uint8_t>::const_iterator&& begin, std::vector<uint8_t>::const_iterator&& end) const -> uint32_t;
51 };
52} // namespace radio_tool::radio
auto WriteFirmware(const std::string &file) -> void override
auto ToString() const -> const std::string override