19 #ifdef USING_OSX_FIREWIRE
24 #define LOC QString("FireDev(%1): ").arg(guid_to_string(m_guid))
26 static void fw_init(QMap<uint64_t,QString> &id_to_model);
32 m_guid(guid), m_subunitid(subunitid),
46 LOG(VB_RECORD, LOG_INFO,
LOC +
47 QString(
"AddListener() %1").arg(
m_listeners.size()));
62 LOG(VB_RECORD, LOG_INFO,
LOC +
63 QString(
"RemoveListener() %1").arg(
m_listeners.size()));
68 QMutexLocker locker(&
m_lock);
70 std::vector<uint8_t> cmd;
71 std::vector<uint8_t> ret;
78 QString cmdStr = (on) ?
"on" :
"off";
79 LOG(VB_RECORD, LOG_INFO,
LOC + QString(
"Powering %1").arg(cmdStr));
83 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Power on cmd failed (no response)");
89 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Power %1 failed").arg(cmdStr));
94 LOG(VB_RECORD, LOG_INFO,
LOC +
95 QString(
"Power %1 cmd sent successfully").arg(cmdStr));
102 QMutexLocker locker(&
m_lock);
104 std::vector<uint8_t> cmd;
105 std::vector<uint8_t> ret;
112 LOG(VB_CHANNEL, LOG_INFO,
LOC +
"Requesting STB Power State");
116 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Power cmd failed (no response)");
120 QString loc =
LOC +
"STB Power State: ";
124 LOG(VB_CHANNEL, LOG_INFO, loc +
"Query not implemented");
131 LOG(VB_CHANNEL, LOG_INFO, loc +
"On");
137 LOG(VB_CHANNEL, LOG_INFO, loc +
"Off");
141 LOG(VB_GENERAL, LOG_ERR,
LOC +
"STB Power State: Unknown Response");
149 LOG(VB_CHANNEL, LOG_INFO, QString(
"SetChannel(model %1, alt %2, chan %3)")
150 .arg(panel_model).arg(alt_method).arg(channel));
152 QMutexLocker locker(&
m_lock);
153 LOG(VB_CHANNEL, LOG_INFO,
"SetChannel() -- locked");
157 LOG(VB_GENERAL, LOG_ERR,
LOC +
158 QString(
"Model: '%1' ").arg(panel_model) +
159 "is not supported by internal channel changer.");
163 std::array<uint,3> digit {
164 (channel % 1000) / 100,
165 (channel % 100) / 10,
171 LOG(VB_GENERAL, LOG_ERR,
LOC +
172 "SetChannel: Extended subunits are not supported.");
177 std::vector<uint8_t> cmd;
178 std::vector<uint8_t> ret;
180 if ((panel_model.toUpper() ==
"SA GENERIC") ||
181 (panel_model.toUpper() ==
"SA4200HD") ||
182 (panel_model.toUpper() ==
"SA4250HDC"))
184 if (panel_model.toUpper() ==
"SA4250HDC")
186 LOG(VB_GENERAL, LOG_ERR,
LOC +
187 "The Scientific Atlanta 4250 HDC is not supported "
188 "\n\t\t\tby any MythTV Firewire channel changer."
189 "At the moment you must use an IR blaster.");
198 cmd.push_back((channel>>8) & 0x0f);
199 cmd.push_back(channel & 0xff);
214 if (!press_ok && !release_ok)
216 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Tuning failed");
226 bool is_mot = ((panel_model.startsWith(
"DCT-", Qt::CaseInsensitive)) ||
227 (panel_model.startsWith(
"DCH-", Qt::CaseInsensitive)) ||
228 (panel_model.startsWith(
"DCX-", Qt::CaseInsensitive)) ||
229 (panel_model.startsWith(
"QIP-", Qt::CaseInsensitive)) ||
230 (panel_model.startsWith(
"MOTO", Qt::CaseInsensitive)) ||
231 (panel_model.startsWith(
"PACE-", Qt::CaseInsensitive)));
233 if (is_mot && !alt_method)
250 std::this_thread::sleep_for(500ms);
257 if (is_mot && alt_method)
265 cmd.push_back((channel>>8) & 0x0f);
266 cmd.push_back(channel & 0xff);
277 if (panel_model.toUpper() ==
"SA3250HD")
285 cmd.push_back(0x30 | digit[2]);
286 cmd.push_back(0x30 | digit[1]);
287 cmd.push_back(0x30 | digit[0]);
293 cmd[5] = 0x30 | digit[0];
294 cmd[6] = 0x30 | digit[1];
295 cmd[7] = 0x30 | digit[2];
308 const unsigned char *data,
uint dataSize)
311 ((data[1] & 0x1f) == 0) && (data[2] == 0))
317 listener->AddData(data, dataSize);
325 LOG(VB_GENERAL, LOG_INFO, QString(
"SetLastChannel(%1): cleared: %2")
339 LOG(VB_RECORD, LOG_DEBUG,
LOC +
340 QString(
"ProcessPATPacket: CRC 0x%1 cleared: %2")
346 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Can't handle large PAT's");
356 QString ret =
s_idToModel[(((uint64_t) vendor_id) << 32) | model_id];
359 return "MOTO GENERIC";
365 std::vector<AVCInfo> list;
367 #ifdef USING_LINUX_FIREWIRE
369 #elif defined(USING_OSX_FIREWIRE)
374 #ifdef DEBUG_AVC_INFO
376 info.
m_guid = 0x0016928a7b600001ULL;
382 list.push_back(info);
384 info.
m_guid = 0xff2145a850e39810ULL;
390 list.push_back(info);
391 #endif // DEBUG_AVC_INFO
396 static void fw_init(QMap<uint64_t,QString> &id_to_model)
398 const std::array<const uint64_t,16> sa_vendor_ids
400 0x0a73, 0x0f21, 0x11e6, 0x14f8, 0x1692, 0x1868,
401 0x1947, 0x1ac3, 0x1bd7, 0x1cea, 0x1e6b, 0x21be,
402 0x223a, 0x22ce, 0x23be, 0x252e,
405 for (uint64_t vendor_id : sa_vendor_ids)
407 id_to_model[vendor_id << 32 | 0x0be0] =
"SA3250HD";
408 id_to_model[vendor_id << 32 | 0x1072] =
"SA4200HD";
409 id_to_model[vendor_id << 32 | 0x10cc] =
"SA4250HDC";
410 id_to_model[vendor_id << 32 | 0x22ce] =
"SA8300HD";
413 const std::array<uint64_t,59> motorola_vendor_ids
416 0x1c11, 0x1cfb, 0x1fc4, 0x23a3, 0x23ee, 0x25f1,
417 0xfa01, 0x25f1, 0x25f2, 0xcc7d37, 0x946269, 0x6455b1,
427 0x0ce5, 0x0e5c, 0x1225, 0x0f9f, 0x1180,
428 0x12c9, 0x11ae, 0x152f, 0x14e8, 0x16b5, 0x1371,
429 0x19a6, 0x1aad, 0x0b06, 0x195e, 0x10dc,
439 0x04db, 0x0406, 0x0ce5, 0x111a, 0x1225, 0x1404,
440 0x1626, 0x18c0, 0x1ade, 0x1cfb, 0x2040, 0x2180,
441 0x2210, 0x230b, 0x2375, 0x2395, 0x23a2, 0x23ed,
442 0x23ee, 0x23a0, 0x23a1,
445 for (uint64_t vendor_id : motorola_vendor_ids)
447 id_to_model[vendor_id << 32 | 0xf740] =
"DCX-3200";
448 id_to_model[vendor_id << 32 | 0xf804] =
"DCX-3200";
449 id_to_model[vendor_id << 32 | 0xfa03] =
"DCX-3200";
450 id_to_model[vendor_id << 32 | 0xfa05] =
"DCX-3200";
451 id_to_model[vendor_id << 32 | 0xfa07] =
"DCX-3200";
452 id_to_model[vendor_id << 32 | 0x24a1] =
"DCX-3200";
453 id_to_model[vendor_id << 32 | 0x2322] =
"DCX-3200";
454 id_to_model[vendor_id << 32 | 0xea05] =
"DCX-3432";
455 id_to_model[vendor_id << 32 | 0xd330] =
"DCH-3200";
456 id_to_model[vendor_id << 32 | 0xb630] =
"DCH-3416";
457 id_to_model[vendor_id << 32 | 0x34cb] =
"DCT-3412";
458 id_to_model[vendor_id << 32 | 0x346b] =
"DCT-3416";
459 id_to_model[vendor_id << 32 | 0xb630] =
"DCT-3416";
460 id_to_model[vendor_id << 32 | 0x6200] =
"DCT-6200";
461 id_to_model[vendor_id << 32 | 0x620a] =
"DCT-6200";
462 id_to_model[vendor_id << 32 | 0x64ca] =
"DCT-6212";
463 id_to_model[vendor_id << 32 | 0x64cb] =
"DCT-6212";
464 id_to_model[vendor_id << 32 | 0x646b] =
"DCT-6216";
465 id_to_model[vendor_id << 32 | 0x8100] =
"QIP-7100";
466 id_to_model[vendor_id << 32 | 0x7100] =
"QIP-6200";
467 id_to_model[vendor_id << 32 | 0x0001] =
"QIP-7100";
470 const std::array<const uint64_t,2> pace_vendor_ids
476 for (uint64_t vendor_id : pace_vendor_ids)
478 id_to_model[vendor_id << 32 | 0x10551] =
"PACE-550";
479 id_to_model[vendor_id << 32 | 0x10755] =
"PACE-779";
485 QString model = panel_model.toUpper();
486 return ((model ==
"DCH-3200") ||
487 (model ==
"DCH-3416") ||
488 (model ==
"DCT-3412") ||
489 (model ==
"DCT-3416") ||
490 (model ==
"DCT-6200") ||
491 (model ==
"DCT-6212") ||
492 (model ==
"DCT-6216") ||
493 (model ==
"DCX-3200") ||
494 (model ==
"SA3250HD") ||
495 (model ==
"SA4200HD") ||
496 (model ==
"SA4250HDC") ||
497 (model ==
"SA8300HD") ||
498 (model ==
"PACE-550") ||
499 (model ==
"PACE-779") ||
500 (model ==
"QIP-6200") ||
501 (model ==
"QIP-7100") ||
502 (model ==
"SA GENERIC") ||
503 (model ==
"MOTO GENERIC"));