33 this->
interface = interface;
43 Response response = interface->submitCmd(0x30,
nullptr, 0,
false);
61 printf(
"res_x = %d, res_y = %d, cell_width = %d, cell_height = %d, fullscale = %X\n",
69 for (y = 0; y < height; y++)
71 printf(
"%03X", matrix[y * width]);
73 for (x = 1; x < width; x++)
75 printf(
", %03X", matrix[y * width + x]);
84 unsigned char payload[1];
86 Response response = interface->submitCmd(0x20, payload,
sizeof(payload),
false);
87 return getFrameData(&response);
91 Response response = interface->receiveWithoutChecks();
93 if (response.
cmdId == 0x21)
95 response = interface->receiveWithoutChecks();
98 if (response.
cmdId == 0x00)
100 return getPeriodicFrameData(&response);
104 throw TransmissionException(
str(boost::format(
"Response ID (%02X) does not match submitted command ID (%02X)") % (
int)response.
cmdId % (
int)0x00));
112 unsigned int timestamp = response->
getUInt(0);
115 int count = (response->
len - offset) / 2;
117 std::shared_ptr<std::vector<short> >
data;
118 data.reset(
new std::vector<short>(count, 0));
121 for (i = 0; i < count; i++)
137 int count = (response->
len - offset) / 2;
139 std::shared_ptr<std::vector<short> >
data;
140 data.reset(
new std::vector<short>(count, 0));
142 for (i = 0; i < count; i++)
153 unsigned char payload[3];
155 payload[1] = delay_ms & 0xFF;
156 payload[2] = (delay_ms >> 8) & 0xFF;
157 interface->fireAndForgetCmd(0x21, payload,
sizeof(payload),
false);
163 interface->fireAndForgetCmd(0x22,
nullptr, 0,
false);
166 while (waitCount > 0)
168 Response response = interface->receiveWithoutChecks();
170 if (response.
cmdId == 0x22)
176 std::cout << boost::format(
"stopPeriodicFrameAcquisition :: Discarding Response with ID 0x%02X") % (int)response.
cmdId << std::endl;
185 unsigned char payload[1];
186 payload[0] = operation;
187 Response response = interface->submitCmd(0x23, payload,
sizeof(payload),
false);
193 unsigned char payload[4];
198 Response response = interface->submitCmd(0x31, payload,
sizeof(payload),
false);
212 unsigned char payload[2];
213 payload[0] = threshold & 0xFF;
214 payload[1] = (threshold >> 8) & 0xFF;
215 Response response = interface->submitCmd(0x34, payload,
sizeof(payload),
false);
221 Response response = interface->submitCmd(0x35,
nullptr, 0,
false);
233 unsigned char payload[1];
235 Response response = interface->submitCmd(0x36, payload,
sizeof(payload),
false);
245 Response response = interface->submitCmd(0x37,
nullptr, 0,
false);
248 unsigned char gain = response.
getByte(2);
256 Response response = interface->submitCmd(0x38,
nullptr, 0,
false);
259 std::string type = std::string((
char*)response.
data.data() + 2, response.
len - 2);
264 Response response = interface->submitCmd(0x46,
nullptr, 0,
false);
271 Response response = interface->submitCmd(0x50,
nullptr, 0,
false);
287 std::cout << boost::format(
"System Type=%1%, Hardware Revision=%2%, Firmware Version=%3%.%4%.%5%.%6% (0x%7$04X), Serial Number=%8%")
292 unsigned char* payload = (
unsigned char*)tag.c_str();
293 Response response = interface->submitCmd(0x51, payload, tag.length(),
false);
299 Response response = interface->submitCmd(0x52,
nullptr, 0,
false);
302 std::string tag = std::string((
char*)response.
data.data() + 2, response.
len - 2);
308 Response response = interface->submitCmd(0x52,
nullptr, 0,
false);
317 tag = std::string((
char*)response.
data.data() + 2, response.
len - 2);
327 return interface->toString();
332 return strm <<
a.interface;