6 std::vector<std::string>
split(
const std::string& s,
char delimiter) {
7 std::vector<std::string> tokens;
9 size_t end = s.find(delimiter);
11 while(end != std::string::npos) {
12 tokens.push_back(s.substr(start, end - start));
14 end = s.find(delimiter, start);
17 tokens.push_back(s.substr(start, end));
23 std::string productName;
24 if((productName = eepromFactory.
productName).empty()) {
31 std::transform(productName.begin(), productName.end(), productName.begin(), [](
int c) { return std::toupper(c); });
32 std::replace(productName.begin(), productName.end(),
' ',
'-');
35 if(productName ==
"BW1098OBC") {
36 productName =
"OAK-D";
37 }
else if(productName ==
"DM2097") {
38 productName =
"OAK-D-CM4-POE";
39 }
else if(productName ==
"BW1097") {
40 productName =
"OAK-D-CM3";
47 std::string deviceName;
48 if((deviceName = eepromFactory.
deviceName).empty()) {
51 const std::array<std::string, 5> skuDiff = {
"AF",
"FF",
"97",
"9782",
"OV9782"};
57 auto tokens =
split(deviceName,
'-');
59 for(
unsigned int i = 0; i < tokens.size(); i++) {
60 const auto& token = tokens[i];
63 bool skipToken =
false;
64 for(
const auto& d : skuDiff) {
70 if(skipToken)
continue;
72 if(i != 0) deviceName +=
"-";