-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.cpp
More file actions
31 lines (29 loc) · 724 Bytes
/
dev.cpp
File metadata and controls
31 lines (29 loc) · 724 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
#include "bcast.h"
void device () {
system("/usr/local/bin/broadcast");
char devname[30];
char inumber[4];
char driver[30];
ifstream filein(USBDATA);
while(!filein.getline(devname,30,',').eof()) {
filein.getline(inumber,4,',');
filein.getline(driver,30);
//cout << "Output (" << driver << ") (" << inumber << ") (" << devname << ")" << endl;
if(strcmp(driver, "GobiSerial") == 0) {
if (strcmp(inumber, "02") == 0) {
gps = devname;
}
else if (strcmp(inumber, "03") == 0) {
modem = devname;
}
}
else {
serport = devname;
}
}
if (gps.empty() || modem.empty()) {
cerr << "Gobi identification failed\n";
}
cout << "GPS: " << gps << endl;
cout << "modem: " << modem << endl;
}