telldus/driver/TellUsbD101/DeviceWaveman.cpp
Micke Prag 08c02530a6 Removed function
bool devHasMethod(int id, int method)
and replaced with
int devMethods(int id)
2008-02-08 15:52:06 +00:00

45 lines
969 B
C++

// #include "StdAfx.h"
#include "DeviceWaveman.h"
#include <string>
#include <algorithm>
#include <bitset>
#include <iostream>
#include <fstream>
using namespace std;
/*
* Constructor
*/
DeviceWaveman::DeviceWaveman(int intNewHouse, int intNewCode, int intDeviceIndex)
:DeviceNexa(intNewHouse, intNewCode, intDeviceIndex){
}
/*
* Turn off this device
*/
void DeviceWaveman::turnOff(void){
try{
string strCode = getStringCode(intCode);
string strHouse = getStringCode(intHouse);
strCode.append(strHouse);
strCode.insert(0, "S");
strCode.append("$k$k$k$k$k$k$k$k$k+"); //the "turn off"-code, keeps it like this, doesn't have to be regenerated each time
char* strMessage = const_cast<char*>(strCode.c_str());
Device::send(strMessage);
}
catch(...){
throw;
}
}
/*
* Has the device got the method?
*/
int DeviceWaveman::methods(char* strModel){
return (TELLSTICK_TURNON | TELLSTICK_TURNOFF);
}