17 #if USING_OSX_FIREWIRE
23 #define LOC QString("FireDev(%1): ").arg(guid_to_string(m_guid))
25 static void fw_init(QMap<uint64_t,QString> &id_to_model);
31 m_guid(guid), m_subunitid(subunitid),
45 LOG(VB_RECORD, LOG_INFO,
LOC +
64 LOG(VB_RECORD, LOG_INFO,
LOC +
70 QMutexLocker locker(&
m_lock);
72 std::vector<uint8_t> cmd;
73 std::vector<uint8_t> ret;
80 QString cmdStr = (on) ?
"on" :
"off";
81 LOG(VB_RECORD, LOG_INFO,
LOC + QString(
"Powering %1").
arg(cmdStr));
85 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Power on cmd failed (no response)");
91 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Power %1 failed").
arg(cmdStr));
96 LOG(VB_RECORD, LOG_INFO,
LOC +
97 QString(
"Power %1 cmd sent successfully").
arg(cmdStr));
104 QMutexLocker locker(&
m_lock);
106 std::vector<uint8_t> cmd;
107 std::vector<uint8_t> ret;
114 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Requesting STB Power State");
118 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Power cmd failed (no response)");
122 QString loc =
LOC +
"STB Power State: ";
126 LOG(VB_CHANNEL, LOG_INFO, loc +
"Query not implemented");
133 LOG(VB_CHANNEL, LOG_INFO, loc +
"On");
139 LOG(VB_CHANNEL, LOG_INFO, loc +
"Off");
143 LOG(VB_GENERAL, LOG_ERR,
LOC +
"STB Power State: Unknown Response");
151 LOG(VB_CHANNEL, LOG_INFO, QString(
"SetChannel(model %1, alt %2, chan %3)")
154 QMutexLocker locker(&
m_lock);
155 LOG(VB_CHANNEL, LOG_INFO,
"SetChannel() -- locked");
159 LOG(VB_GENERAL, LOG_ERR,
LOC +
160 QString(
"Model: '%1' ").
arg(panel_model) +
161 "is not supported by internal channel changer.");
165 std::array<uint,3> digit {
173 LOG(VB_GENERAL, LOG_ERR,
LOC +
174 "SetChannel: Extended subunits are not supported.");
179 std::vector<uint8_t> cmd;
180 std::vector<uint8_t> ret;
182 if ((panel_model.toUpper() ==
"SA GENERIC") ||
183 (panel_model.toUpper() ==
"SA4200HD") ||
184 (panel_model.toUpper() ==
"SA4250HDC"))
186 if (panel_model.toUpper() ==
"SA4250HDC")
188 LOG(VB_GENERAL, LOG_ERR,
LOC +
189 "The Scientific Atlanta 4250 HDC is not supported "
190 "\n\t\t\tby any MythTV Firewire channel changer."
191 "At the moment you must use an IR blaster.");
200 cmd.push_back((
channel>>8) & 0x0f);
216 if (!press_ok && !release_ok)
218 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Tuning failed");
228 bool is_mot = ((panel_model.startsWith(
"DCT-", Qt::CaseInsensitive)) ||
229 (panel_model.startsWith(
"DCH-", Qt::CaseInsensitive)) ||
230 (panel_model.startsWith(
"DCX-", Qt::CaseInsensitive)) ||
231 (panel_model.startsWith(
"QIP-", Qt::CaseInsensitive)) ||
232 (panel_model.startsWith(
"MOTO", Qt::CaseInsensitive)) ||
233 (panel_model.startsWith(
"PACE-", Qt::CaseInsensitive)));
235 if (is_mot && !alt_method)
252 std::this_thread::sleep_for(std::chrono::milliseconds(500));
259 if (is_mot && alt_method)
267 cmd.push_back((
channel>>8) & 0x0f);
279 if (panel_model.toUpper() ==
"SA3250HD")
287 cmd.push_back(0x30 | digit[2]);
288 cmd.push_back(0x30 | digit[1]);
289 cmd.push_back(0x30 | digit[0]);
295 cmd[5] = 0x30 | digit[0];
296 cmd[6] = 0x30 | digit[1];
297 cmd[7] = 0x30 | digit[2];
310 const unsigned char *data,
uint dataSize)
313 ((data[1] & 0x1f) == 0) && (data[2] == 0))
319 listener->AddData(data, dataSize);
327 LOG(VB_GENERAL, LOG_INFO, QString(
"SetLastChannel(%1): cleared: %2")
341 LOG(VB_RECORD, LOG_DEBUG,
LOC +
342 QString(
"ProcessPATPacket: CRC 0x%1 cleared: %2")
348 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Can't handle large PAT's");
358 QString ret =
s_idToModel[(((uint64_t) vendor_id) << 32) | model_id];
361 return "MOTO GENERIC";
367 std::vector<AVCInfo> list;
369 #ifdef USING_LINUX_FIREWIRE
371 #elif USING_OSX_FIREWIRE
376 #ifdef DEBUG_AVC_INFO
378 info.guid = 0x0016928a7b600001ULL;
380 info.vendorid = 0x000014f8;
381 info.modelid = 0x00001072;
382 info.firmware_revision = 0x0;
383 info.product_name =
"Explorer 4200 HD";
384 list.push_back(info);
386 info.guid = 0xff2145a850e39810ULL;
388 info.vendorid = 0x000014f8;
389 info.modelid = 0x00000be0;
390 info.firmware_revision = 0x0;
391 info.product_name =
"Explorer 3250 HD";
392 list.push_back(info);
393 #endif // DEBUG_AVC_INFO
398 static void fw_init(QMap<uint64_t,QString> &id_to_model)
400 const std::array<const uint64_t,16> sa_vendor_ids
402 0x0a73, 0x0f21, 0x11e6, 0x14f8, 0x1692, 0x1868,
403 0x1947, 0x1ac3, 0x1bd7, 0x1cea, 0x1e6b, 0x21be,
404 0x223a, 0x22ce, 0x23be, 0x252e,
407 for (uint64_t vendor_id : sa_vendor_ids)
409 id_to_model[vendor_id << 32 | 0x0be0] =
"SA3250HD";
410 id_to_model[vendor_id << 32 | 0x1072] =
"SA4200HD";
411 id_to_model[vendor_id << 32 | 0x10cc] =
"SA4250HDC";
412 id_to_model[vendor_id << 32 | 0x22ce] =
"SA8300HD";
415 const std::array<uint64_t,59> motorola_vendor_ids
418 0x1c11, 0x1cfb, 0x1fc4, 0x23a3, 0x23ee, 0x25f1,
419 0xfa01, 0x25f1, 0x25f2, 0xcc7d37, 0x946269, 0x6455b1,
429 0x0ce5, 0x0e5c, 0x1225, 0x0f9f, 0x1180,
430 0x12c9, 0x11ae, 0x152f, 0x14e8, 0x16b5, 0x1371,
431 0x19a6, 0x1aad, 0x0b06, 0x195e, 0x10dc,
441 0x04db, 0x0406, 0x0ce5, 0x111a, 0x1225, 0x1404,
442 0x1626, 0x18c0, 0x1ade, 0x1cfb, 0x2040, 0x2180,
443 0x2210, 0x230b, 0x2375, 0x2395, 0x23a2, 0x23ed,
444 0x23ee, 0x23a0, 0x23a1,
447 for (uint64_t vendor_id : motorola_vendor_ids)
449 id_to_model[vendor_id << 32 | 0xf740] =
"DCX-3200";
450 id_to_model[vendor_id << 32 | 0xf804] =
"DCX-3200";
451 id_to_model[vendor_id << 32 | 0xfa03] =
"DCX-3200";
452 id_to_model[vendor_id << 32 | 0xfa05] =
"DCX-3200";
453 id_to_model[vendor_id << 32 | 0xfa07] =
"DCX-3200";
454 id_to_model[vendor_id << 32 | 0x24a1] =
"DCX-3200";
455 id_to_model[vendor_id << 32 | 0x2322] =
"DCX-3200";
456 id_to_model[vendor_id << 32 | 0xea05] =
"DCX-3432";
457 id_to_model[vendor_id << 32 | 0xd330] =
"DCH-3200";
458 id_to_model[vendor_id << 32 | 0xb630] =
"DCH-3416";
459 id_to_model[vendor_id << 32 | 0x34cb] =
"DCT-3412";
460 id_to_model[vendor_id << 32 | 0x346b] =
"DCT-3416";
461 id_to_model[vendor_id << 32 | 0xb630] =
"DCT-3416";
462 id_to_model[vendor_id << 32 | 0x6200] =
"DCT-6200";
463 id_to_model[vendor_id << 32 | 0x620a] =
"DCT-6200";
464 id_to_model[vendor_id << 32 | 0x64ca] =
"DCT-6212";
465 id_to_model[vendor_id << 32 | 0x64cb] =
"DCT-6212";
466 id_to_model[vendor_id << 32 | 0x646b] =
"DCT-6216";
467 id_to_model[vendor_id << 32 | 0x8100] =
"QIP-7100";
468 id_to_model[vendor_id << 32 | 0x7100] =
"QIP-6200";
469 id_to_model[vendor_id << 32 | 0x0001] =
"QIP-7100";
472 const std::array<const uint64_t,2> pace_vendor_ids
478 for (uint64_t vendor_id : pace_vendor_ids)
480 id_to_model[vendor_id << 32 | 0x10551] =
"PACE-550";
481 id_to_model[vendor_id << 32 | 0x10755] =
"PACE-779";
487 QString model = panel_model.toUpper();
488 return ((model ==
"DCH-3200") ||
489 (model ==
"DCH-3416") ||
490 (model ==
"DCT-3412") ||
491 (model ==
"DCT-3416") ||
492 (model ==
"DCT-6200") ||
493 (model ==
"DCT-6212") ||
494 (model ==
"DCT-6216") ||
495 (model ==
"DCX-3200") ||
496 (model ==
"SA3250HD") ||
497 (model ==
"SA4200HD") ||
498 (model ==
"SA4250HDC") ||
499 (model ==
"SA8300HD") ||
500 (model ==
"PACE-550") ||
501 (model ==
"PACE-779") ||
502 (model ==
"QIP-6200") ||
503 (model ==
"QIP-7100") ||
504 (model ==
"SA GENERIC") ||
505 (model ==
"MOTO GENERIC"));