// Static member definition:
PIRDeviceCollection PIRKeysetMetaData::controlledDevices;
+// Thread synchronization stuff:
+extern bool commandInFlight;
+
PIRKeysetMetaData::PIRKeysetMetaData(
const char *r,
PIRMakeName m,
{
}
+
+PIRKeysetMetaData::~PIRKeysetMetaData()
+{
+ clearProtocol();
+}
+
+
bool PIRKeysetMetaData::hasKey(
PIRKeyName name) const
{
tempString.append(i->first.model);
kwi = new PIRKeysetWidgetItem(
- tempString, i->second, i->first.make, i->first.type);
+ tempString, i->first.model, i->second, i->first.make, i->first.type);
sdf->addWidgetItem(kwi);
}
+unsigned int PIRKeysetMetaData::getCarrierFrequency() const
+{
+ if (!threadableProtocol)
+ {
+ return 0;
+ }
+
+ return threadableProtocol->getCarrierFrequency();
+}
+
+
+void PIRKeysetMetaData::setCarrierFrequency(
+ unsigned int carrierFrequency)
+{
+ if (!threadableProtocol)
+ {
+ return;
+ }
+
+ threadableProtocol->setCarrierFrequency(carrierFrequency);
+}
+
+
+unsigned int PIRKeysetMetaData::getDutyCycle() const
+{
+ if (!threadableProtocol)
+ {
+ return 0;
+ }
+
+ return threadableProtocol->getDutyCycle();
+}
+
+
+void PIRKeysetMetaData::setDutyCycle(
+ unsigned int dutyCycle)
+{
+ if (!threadableProtocol)
+ {
+ return;
+ }
+
+ threadableProtocol->setDutyCycle(dutyCycle);
+}
+
+
void PIRKeysetMetaData::addControlledDevice(
PIRMakeName make,
const char *model,
{
keysetName = n;
}
+
+
+bool PIRKeysetMetaData::clearProtocol()
+{
+ if (!threadableProtocol)
+ {
+ return true;
+ }
+ else if (!commandInFlight)
+ {
+ delete threadableProtocol;
+ threadableProtocol = 0;
+ return true;
+ }
+
+ return false;
+}