- added error responses

- ok and err responses have arguments



git-svn-id: http://moon:8086/svn/projects/HendiControl@182 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-03-30 16:12:19 +00:00
parent a11e20345c
commit 11a4f32515
+8 -8
View File
@@ -182,7 +182,7 @@ int main(void)
} }
else else
{ {
PRINT_ANSWER("INVALID STATE"); PRINT_ANSWER("ERR:Invalid state");
} }
} }
} }
@@ -211,7 +211,7 @@ int main(void)
} }
else else
{ {
PRINT_ANSWER("INVALID STATE"); PRINT_ANSWER("ERR:Invalid state");
} }
} }
} }
@@ -240,11 +240,11 @@ int main(void)
setPower(PowerLow); setPower(PowerLow);
setSwitch(SwitchOff); setSwitch(SwitchOff);
state_next = StateRemote; state_next = StateRemote;
PRINT_ANSWER("OK"); PRINT_ANSWER("OK:%d", arg);
} }
else else
{ {
PRINT_ANSWER("INVALID STATE"); PRINT_ANSWER("ERR:Invalid state");
} }
} }
else if (arg == 0) else if (arg == 0)
@@ -255,11 +255,11 @@ int main(void)
setPower(PowerLow); setPower(PowerLow);
setSwitch(SwitchOff); setSwitch(SwitchOff);
state_next = StateNormal; state_next = StateNormal;
PRINT_ANSWER("OK"); PRINT_ANSWER("OK:%d", arg);
} }
else else
{ {
PRINT_ANSWER("INVALID STATE"); PRINT_ANSWER("ERR:Invalid state");
} }
} }
} }
@@ -281,7 +281,7 @@ int main(void)
break; break;
} }
g_debug = (uint16_t)strtol(pArgs, &pArgs, 10); g_debug = (uint16_t)strtol(pArgs, &pArgs, 10);
PRINT_ANSWER("OK"); PRINT_ANSWER("OK:%d", g_debug);
} }
} }
@@ -323,7 +323,7 @@ int main(void)
else else
{ {
pArgs++; pArgs++;
PRINT_ANSWER("UNKNOWN COMMAND"); PRINT_ANSWER("ERR:Unknown command");
} }
} // while (*pArgs) } // while (*pArgs)