Add comment to the GatewayTester

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2017-09-08 14:25:52 +09:00
parent e22d00046e
commit ca063cec9d
3 changed files with 52 additions and 208 deletions

View File

@@ -31,6 +31,7 @@ extern OnPublishList theOnPublishList[];
extern MQTTSNCONF;
extern UDPCONF;
extern void setup(void);
/*=====================================
LMqttsnClient
======================================*/
@@ -39,10 +40,15 @@ LScreen* theScreen = new LScreen();
bool theOTAflag = false;
bool theClientMode = true;
int run(void)
/*-------------------------------------
* main
*------------------------------------*/
int main(int argc, char** argv)
{
#ifndef CLIENT_MODE
char c = 0;
setup();
printf("\n%s", PAHO_COPYRIGHT4);
printf("\n%s\n", PAHO_COPYRIGHT0);
printf("%s\n", PAHO_COPYRIGHT1);
@@ -51,31 +57,29 @@ int run(void)
printf("%s\n", TESTER_VERSION);
printf("%s\n", PAHO_COPYRIGHT4);
#ifndef CLIENT_MODE
theClientMode = false;
PROMPT(" Do you like Tomoaki ? ( y/n ) : ");
while (true)
{
theClientMode = false;
PROMPT(" Do you like Tomoaki ? ( y/n ) : ");
while (true)
if (CHECKKEYIN(&c))
{
if (CHECKKEYIN(&c))
if ( toupper(c) == 'N' )
{
if ( toupper(c) == 'N' )
{
DISPLAY("\033[0;31m\n**** Sorry ****\033[0;37m\n\n");
PROMPT("");
return 0;
}
}
else if ( toupper(c) == 'Y' )
{
DISPLAY("\033[0m\033[0;32mAttempting to Connect the Broker.....\033[0m\033[0;37m\n");
DISPLAY("\033[0;31m\n**** Sorry ****\033[0;37m\n\n");
PROMPT("");
break;
return 0;
}
}
else if ( toupper(c) == 'Y' )
{
DISPLAY("\033[0m\033[0;32mAttempting to Connect the Broker.....\033[0m\033[0;37m\n");
PROMPT("");
break;
}
}
#endif
setup();
theClient->addTask(theClientMode);
theClient->initialize( theNetcon, theMqcon);
do