forked from jackburton79/inventory-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreens.cpp
More file actions
35 lines (27 loc) · 780 Bytes
/
Copy pathScreens.cpp
File metadata and controls
35 lines (27 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "Screens.h"
#include "edid-decode.h"
#include "Support.h"
#include <iostream>
#include <string>
#include <vector>
Screens::Screens()
{
if (!CommandExists("find"))
throw "Missing command \"find\"";
popen_streambuf buf("find /sys/devices/ -name edid", "r");
std::istream stream(&buf);
std::string line;
while (std::getline(stream, line)) {
screen_info info;
edid_info edidInfo;
info.name = line;
if (get_edid_info(line.c_str(), &edidInfo) == 0) {
info.description = edidInfo.description;
info.manufacturer = edidInfo.manufacturer;
info.model = edidInfo.model;
info.serial_number = edidInfo.serial_number;
fItems.push_back(info);
}
}
Rewind();
}