Move wstring to string conversion to StringUtils.cpp and update most HID get serial number functions to use it
This commit is contained in:
parent
366fda30f5
commit
b4d15b9545
159 changed files with 623 additions and 930 deletions
|
|
@ -13,6 +13,7 @@
|
|||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "StringUtils.h"
|
||||
#include "ZETBladeOpticalController.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
|
@ -49,15 +50,12 @@ std::string ZETBladeOpticalController::GetSerialString()
|
|||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if (ret != 0)
|
||||
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));
|
||||
}
|
||||
|
||||
void ZETBladeOpticalController::PrepareHeader(unsigned char* packet, unsigned char brightness)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue