Should have spaces after comma according to Google style guidelines "whitespace/comma"
This commit is contained in:
parent
3a0cee353a
commit
110dcc2c57
11 changed files with 31 additions and 31 deletions
|
@ -71,7 +71,7 @@ int ControllerMessage::getIntParameter(const std::string &key) const {
|
|||
if (strValue.compare("") == 0) {
|
||||
return -1;
|
||||
}
|
||||
if (strValue.substr(0,2).compare("0x") == 0) {
|
||||
if (strValue.substr(0, 2).compare("0x") == 0) {
|
||||
return strtol(strValue.c_str(), NULL, 16);
|
||||
}
|
||||
return strtol(strValue.c_str(), NULL, 10);
|
||||
|
|
|
@ -98,7 +98,7 @@ int DeviceManager::setDeviceLastSentCommand(int deviceId, int command, const std
|
|||
DeviceMap::iterator it = d->devices.find(deviceId);
|
||||
if (it != d->devices.end()) {
|
||||
TelldusCore::MutexLocker deviceLocker(it->second);
|
||||
d->set.setDeviceState(deviceId, command,value);
|
||||
d->set.setDeviceState(deviceId, command, value);
|
||||
it->second->setLastSentCommand(command, value);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -14,12 +14,12 @@ int ProtocolBrateck::methods() const {
|
|||
std::string ProtocolBrateck::getStringForMethod(int method, unsigned char, Controller *) {
|
||||
const char S = '!';
|
||||
const char L = 'V';
|
||||
const char B1[] = {L,S,L,S,0};
|
||||
const char BX[] = {S,L,L,S,0};
|
||||
const char B0[] = {S,L,S,L,0};
|
||||
const char BUP[] = {L,S,L,S,S,L,S,L,S,L,S,L,S,L,S,L,S,0};
|
||||
const char BSTOP[] = {S,L,S,L,L,S,L,S,S,L,S,L,S,L,S,L,S,0};
|
||||
const char BDOWN[] = {S,L,S,L,S,L,S,L,S,L,S,L,L,S,L,S,S,0};
|
||||
const char B1[] = {L, S, L, S, 0};
|
||||
const char BX[] = {S, L, L, S, 0};
|
||||
const char B0[] = {S, L, S, L, 0};
|
||||
const char BUP[] = {L, S, L, S, S, L, S, L, S, L, S, L, S, L, S, L, S, 0};
|
||||
const char BSTOP[] = {S, L, S, L, L, S, L, S, S, L, S, L, S, L, S, L, S, 0};
|
||||
const char BDOWN[] = {S, L, S, L, S, L, S, L, S, L, S, L, L, S, L, S, S, 0};
|
||||
|
||||
std::string strReturn;
|
||||
std::wstring strHouse = this->getStringParameter(L"house", L"");
|
||||
|
|
|
@ -33,7 +33,7 @@ std::string ProtocolEverflourish::getStringForMethod(int method, unsigned char,
|
|||
const char sssl = 84; // 0
|
||||
const char slss = 69; // 1
|
||||
|
||||
const char bits[2] = {sssl,slss};
|
||||
const char bits[2] = {sssl, slss};
|
||||
int i, check;
|
||||
|
||||
std::string strCode;
|
||||
|
@ -42,7 +42,7 @@ std::string ProtocolEverflourish::getStringForMethod(int method, unsigned char,
|
|||
|
||||
check = calculateChecksum(deviceCode);
|
||||
|
||||
char preamble[] = {'R', 5, 'T', 114,60,1,1,105,ssss,ssss,0};
|
||||
char preamble[] = {'R', 5, 'T', 114, 60, 1, 1, 105, ssss, ssss, 0};
|
||||
strCode.append(preamble);
|
||||
|
||||
for(i=15;i>=0;i--) {
|
||||
|
@ -64,15 +64,15 @@ std::string ProtocolEverflourish::getStringForMethod(int method, unsigned char,
|
|||
// The calculation used in this function is provided by Frank Stevenson
|
||||
unsigned int ProtocolEverflourish::calculateChecksum(unsigned int x) {
|
||||
unsigned int bits[16] = {
|
||||
0xf ,0xa ,0x7 ,0xe,
|
||||
0xf ,0xd ,0x9 ,0x1,
|
||||
0x1 ,0x2 ,0x4 ,0x8,
|
||||
0x3 ,0x6 ,0xc ,0xb
|
||||
0xf, 0xa, 0x7, 0xe,
|
||||
0xf, 0xd, 0x9, 0x1,
|
||||
0x1, 0x2, 0x4, 0x8,
|
||||
0x3, 0x6, 0xc, 0xb
|
||||
};
|
||||
unsigned int bit = 1;
|
||||
unsigned int res = 0x5;
|
||||
int i;
|
||||
unsigned int lo,hi;
|
||||
unsigned int lo, hi;
|
||||
|
||||
if ((x&0x3)==3) {
|
||||
lo = x & 0x00ff;
|
||||
|
|
|
@ -14,10 +14,10 @@ int ProtocolFuhaote::methods() const {
|
|||
std::string ProtocolFuhaote::getStringForMethod(int method, unsigned char, Controller *) {
|
||||
const char S = 19;
|
||||
const char L = 58;
|
||||
const char B0[] = {S,L,L,S,0};
|
||||
const char B1[] = {L,S,L,S,0};
|
||||
const char OFF[] = {S,L,S,L,S,L,L,S,0};
|
||||
const char ON[] = {S,L,L,S,S,L,S,L,0};
|
||||
const char B0[] = {S, L, L, S, 0};
|
||||
const char B1[] = {L, S, L, S, 0};
|
||||
const char OFF[] = {S, L, S, L, S, L, L, S, 0};
|
||||
const char ON[] = {S, L, L, S, S, L, S, L, 0};
|
||||
|
||||
std::string strReturn = "S";
|
||||
std::wstring strCode = this->getStringParameter(L"code", L"");
|
||||
|
|
|
@ -151,7 +151,7 @@ std::string ProtocolNexa::getStringSelflearningForCode(int intHouse, int intCode
|
|||
// code |= 11; //b1011
|
||||
}
|
||||
if (i % 2 == 0) {
|
||||
strMessage.append(1,code);
|
||||
strMessage.append(1, code);
|
||||
code = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
const unsigned char HOUSES[] = {6,0xE,2,0xA,1,9,5,0xD,7,0xF,3,0xB,0,8,4,0xC};
|
||||
const unsigned char HOUSES[] = {6, 0xE, 2, 0xA, 1, 9, 5, 0xD, 7, 0xF, 3, 0xB, 0, 8, 4, 0xC};
|
||||
|
||||
int ProtocolX10::methods() const {
|
||||
return TELLSTICK_TURNON | TELLSTICK_TURNOFF;
|
||||
|
@ -17,10 +17,10 @@ int ProtocolX10::methods() const {
|
|||
|
||||
std::string ProtocolX10::getStringForMethod(int method, unsigned char data, Controller *controller) {
|
||||
const unsigned char S = 59, L = 169;
|
||||
const char B0[] = {S,S,0};
|
||||
const char B1[] = {S,L,0};
|
||||
const unsigned char START_CODE[] = {'S',255,1,255,1,255,1,100,255,1,180,0};
|
||||
const unsigned char STOP_CODE[] = {S,0};
|
||||
const char B0[] = {S, S, 0};
|
||||
const char B1[] = {S, L, 0};
|
||||
const unsigned char START_CODE[] = {'S', 255, 1, 255, 1, 255, 1, 100, 255, 1, 180, 0};
|
||||
const unsigned char STOP_CODE[] = {S, 0};
|
||||
|
||||
std::string strReturn = reinterpret_cast<const char*>(START_CODE);
|
||||
std::string strComplement = "";
|
||||
|
|
|
@ -55,7 +55,7 @@ int Sensor::dataTypes() const {
|
|||
}
|
||||
|
||||
void Sensor::setValue(int type, const std::string &value, time_t timestamp) {
|
||||
if (value.substr(0,2).compare("0x") == 0) {
|
||||
if (value.substr(0, 2).compare("0x") == 0) {
|
||||
int intval = strtol(value.c_str(), NULL, 16);
|
||||
d->values[type] = TelldusCore::intToString(intval);
|
||||
} else {
|
||||
|
|
|
@ -38,7 +38,7 @@ std::string TellStick::createTPacket( const std::string &msg ) {
|
|||
}
|
||||
}
|
||||
|
||||
return TellStick::convertSToT(t0,t1,t2,t3,data);
|
||||
return TellStick::convertSToT(t0, t1, t2, t3, data);
|
||||
}
|
||||
|
||||
std::string TellStick::convertSToT( unsigned char t0, unsigned char t1, unsigned char t2, unsigned char t3, const std::string &data ) {
|
||||
|
|
|
@ -126,9 +126,9 @@ void TellStick::processData( const std::string &data ) {
|
|||
} else if (data[i] == 10) { // \n found
|
||||
if (d->message.substr(0, 2).compare("+V") == 0) {
|
||||
setFirmwareVersion(TelldusCore::charToInteger(d->message.substr(2).c_str()));
|
||||
} else if (d->message.substr(0,2).compare("+R") == 0) {
|
||||
} else if (d->message.substr(0, 2).compare("+R") == 0) {
|
||||
this->publishData(d->message.substr(2));
|
||||
} else if(d->message.substr(0,2).compare("+W") == 0) {
|
||||
} else if(d->message.substr(0, 2).compare("+W") == 0) {
|
||||
this->decodePublishData(d->message.substr(2));
|
||||
}
|
||||
d->message.clear();
|
||||
|
|
|
@ -82,9 +82,9 @@ int main(int argc, char **argv) {
|
|||
// This way anyone starting the daemon can read the pidfile immediately
|
||||
|
||||
// Record the pid
|
||||
fd = fopen(PID_FILE,"w");
|
||||
fd = fopen(PID_FILE, "w");
|
||||
if (fd) {
|
||||
fprintf(fd,"%d\n",pid);
|
||||
fprintf(fd, "%d\n", pid);
|
||||
fclose(fd);
|
||||
} else {
|
||||
Log::error("Could not open pid file %s: %s", PID_FILE, strerror(errno));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue