Added function Protocol::checkBit()
This commit is contained in:
parent
99f0b133a8
commit
c7d51b249f
2 changed files with 10 additions and 4 deletions
|
@ -80,6 +80,10 @@ int Protocol::getIntParameter(const std::wstring &name, int min, int max) const
|
|||
return intValue;
|
||||
}
|
||||
|
||||
bool Protocol::checkBit(int data, int bitno) {
|
||||
return ((data>>bitno)&0x01);
|
||||
}
|
||||
|
||||
Protocol *Protocol::getProtocolInstance(const std::wstring &protocolname){
|
||||
|
||||
if(TelldusCore::comparei(protocolname, L"arctech")){
|
||||
|
|
|
@ -31,6 +31,8 @@ protected:
|
|||
std::wstring getStringParameter(const std::wstring &name, const std::wstring &defaultValue = L"") const;
|
||||
int getIntParameter(const std::wstring &name, int min, int max) const;
|
||||
|
||||
static bool checkBit(int data, int bit);
|
||||
|
||||
private:
|
||||
class PrivateData;
|
||||
PrivateData *d;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue