sendCTRL Bug

Fixed bug where sendCTRL is sending gear as float. Changed to char as
specified in ICD.
This commit is contained in:
Chris Teubert
2015-04-01 15:58:01 -07:00
parent 87819e5adc
commit 5d50d970bd

View File

@@ -373,7 +373,7 @@ short sendPOSI(struct xpcSocket recfd, short ACNum, short numArgs, float valueAr
short sendCTRL(struct xpcSocket recfd, short numArgs, float valueArray[]) short sendCTRL(struct xpcSocket recfd, short numArgs, float valueArray[])
{ {
char message[29] = {0}; char message[26] = {0};
int i; int i;
short position = 5; short position = 5;
@@ -396,12 +396,21 @@ short sendCTRL(struct xpcSocket recfd, short numArgs, float valueArray[])
val = valueArray[i]; val = valueArray[i];
} }
// Float Values if (i==4) // Integer-gear
memcpy(&message[position],&val,sizeof(float)); {
position += sizeof(float); message[position] = (short int) val;
position += 1;
}
else // float
{
// Float Values
memcpy(&message[position],&val,sizeof(float));
position += sizeof(float);
}
} }
sendUDP(recfd, message, 29); sendUDP(recfd, message, 26);
return 0; return 0;
} }