From 091c4e46f51d17d02636b79686e363f82ed680de Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Mon, 29 Jul 2024 22:56:59 -0500 Subject: [PATCH] Fix wstring to string conversion warnings in SinowealthController.cpp --- .../SinowealthController/SinowealthController.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Controllers/SinowealthController/SinowealthController.cpp b/Controllers/SinowealthController/SinowealthController.cpp index 69ef565d..2085e7a5 100644 --- a/Controllers/SinowealthController/SinowealthController.cpp +++ b/Controllers/SinowealthController/SinowealthController.cpp @@ -7,22 +7,22 @@ | Niels Westphal (crashniels) 20/5/2020 | \*-----------------------------------------*/ -#include "SinowealthController.h" #include -#include +#include "LogManager.h" +#include "SinowealthController.h" +#include "StringUtils.h" SinowealthController::SinowealthController(hid_device* dev_data_handle, hid_device* dev_cmd_handle, char *_path) { dev_data = dev_data_handle; dev_cmd = dev_cmd_handle; + location = _path; led_count = 1; current_mode = GLORIOUS_MODE_STATIC; current_speed = GLORIOUS_SPEED_NORMAL; current_direction = GLORIOUS_DIRECTION_UP; - - location = _path; } SinowealthController::~SinowealthController() @@ -44,17 +44,14 @@ unsigned int SinowealthController::GetLEDCount() std::string SinowealthController::GetSerialString() { wchar_t serial_string[128]; - int ret = hid_get_serial_number_string(dev_data, serial_string, 128); + int ret = hid_get_serial_number_string(dev_cmd, serial_string, 128); if(ret != 0) { return(""); } - std::wstring return_wstring = serial_string; - std::string return_string(return_wstring.begin(), return_wstring.end()); - - return(return_string); + return(StringUtils::wstring_to_string(serial_string)); } std::string SinowealthController::GetFirmwareVersion()