Skip to content
Snippets Groups Projects
Commit 9196d263 authored by ERIK ALEXANDRE PUCCI's avatar ERIK ALEXANDRE PUCCI Committed by Danilo K. S. Yorinori
Browse files

client.c: Changed Availability method code for the availability() call


The Availability method related code calls the availability(), improving
modularization.

Removed availResult variable from main(). It is only used in availability().

Signed-off-by: default avatarERIK ALEXANDRE PUCCI <eap08@c3sl.ufpr.br>
Acked-by: default avatarBruno Ribas <ribas@c3sl.ufpr.br>
Acked-by: default avatarJosiney de Souza <josineys@c3sl.ufpr.br>
Signed-off-by: default avatarDanilo K. S. Yorinori <danilok@c3sl.ufpr.br>
parent 79a564d3
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,6 @@ int main(int argc, char **argv)
{
struct soap *soap = soap_new();
char *url, *inep, *macAddr, *basedir, *clientVersion, *versionFromServer;
char *availResult;
int arglen, len;
/* Initialization *
......@@ -114,32 +113,7 @@ int main(int argc, char **argv)
/* End of Agent Version method
*------------------------------------------------------------------------
* Availability method */
if (soap_call_ns1__setAvailability(soap, url, "", inep, macAddr,
&availResult) != SOAP_OK)
{
soap_print_fault(soap, stderr);
exit(2);
}
/* Get availability result from response */
if (DEBUG)
{
printf("AvailResult: %s\n",availResult);
}
/* Verify response and print approriate message */
if (strcmp(availResult, "Success") == 0)
{
fprintf(stdout, "Data sent successful\n");
}
else if (strcmp(availResult, "Error") == 0)
{
fprintf(stdout, "Data sent error\n");
}
else
{
fprintf(stdout, "Unexpected result from server\n");
}
availability(soap, url, inep, macAddr);
/* End of Availability method
*------------------------------------------------------------------------
* Finalize execution */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment