Added sendPOST function combining functions of sendPOSI and getTERR

This commit is contained in:
Norman Princen
2020-05-02 14:38:48 -07:00
committed by GitHub
parent 9b6d0986be
commit be4e799f8d

View File

@@ -692,28 +692,6 @@ int getTERRResponse(XPCSocket sock, double values[11], char ac)
return 0;
}
int getTERR(XPCSocket sock, double posi[3], double values[11], char ac)
{
// Send Command
int result = sendTERRRequest(sock, posi, ac);
if (result < 0)
{
// An error ocurred while sending.
// sendTERRRequest will print an error message, so just return.
return result;
}
// Read Response
result = getTERRResponse(sock, values, ac);
if (result < 0)
{
// An error ocurred while reading the response.
// getTERRResponse will print an error message, so just return.
return result;
}
return 0;
}
int sendPOST(XPCSocket sock, double posi[], int size, double values[11], char ac)
{
// Validate input
@@ -770,6 +748,28 @@ int sendPOST(XPCSocket sock, double posi[], int size, double values[11], char ac
}
return 0;
}
int getTERR(XPCSocket sock, double posi[3], double values[11], char ac)
{
// Send Command
int result = sendTERRRequest(sock, posi, ac);
if (result < 0)
{
// An error ocurred while sending.
// sendTERRRequest will print an error message, so just return.
return result;
}
// Read Response
result = getTERRResponse(sock, values, ac);
if (result < 0)
{
// An error ocurred while reading the response.
// getTERRResponse will print an error message, so just return.
return result;
}
return 0;
}
/*****************************************************************************/
/**** End TERR functions ****/
/*****************************************************************************/