gclib  2.0.8
Communications API for Galil controllers and PLCs

◆ GCmdT()

GReturn GCALL GCmdT ( GCon  g,
GCStringIn  command,
GCStringOut  trimmed_response,
GSize  response_len,
GCStringOut front 
)

Wrapper around GCommand that trims the response.

For use when the return value is desired, is ASCII (not binary), and the response should be trimmed of trailing colon, whitespace, and optionally leading space.

Parameters
gConnection's handle.
commandNull-terminated command string to send to the controller.
trimmed_responseThe trimmed response from the controller. Trailing space is trimmed by null terminating any trailing spaces, carriage returns, or line feeds.
response_lenThe length of the trimmed_response buffer.
frontIf non-null, upon return *front will point to the first non-space character in trimmed_response. This allows trimming the front of the string without modifying the user's buffer pointer, which may be allocated on the heap.
Returns
The success status or error code of the function. See gclib_errors.h for possible values.

See x_gcommand.cpp for an example.

Definition at line 243 of file gclibo.c.