libsmoco
Low-level interface library for Segment Motion Controller system
|
Modules | |
Long-Running Command Functions | |
Functions in this group invoke and manage background execution of long-running SMOCO commands (movement commands) within an event-driven "transaction" context. | |
User Interface Helper Routines | |
This group comprises useful functions for implementing a user interface for SMOCO commands and responses. | |
Response Handler Functions | |
Functions for registering handler functions to be called when response messages are received from SMOCO controllers. | |
Functions | |
SMOCO_ResponseID | smoco_send_command (SMOCO_CTX ctx, SMOCO_CommandID cmd_id, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id, SMOCO_Parameters *params) |
Sends a command to SMOCO, and waits for an initial response. More... | |
SMOCO_STATUS | smoco_send_command_nonsync (SMOCO_CTX ctx, SMOCO_CommandID cmd_id, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id, SMOCO_Parameters *params) |
Low-level routine, formats and sends command to SMOCO hardware. More... | |
SMOCO_STATUS | smoco_params_set (SMOCO_CommandID cmd_id, SMOCO_Parameters *p_params,...) |
Sets the values in a SMOCO_Parameters structure, for use with API functions such as smoco_send_command() and smoco_run_command(). More... | |
SMOCO_STATUS smoco_params_set | ( | SMOCO_CommandID | cmd_id, |
SMOCO_Parameters * | p_params, | ||
... | |||
) |
Sets the values in a SMOCO_Parameters structure, for use with API functions such as smoco_send_command() and smoco_run_command().
cmd_id | The API ID of the command for which the parameter values are to be given. The number of parameter values expected in the call to smoco_params_set() following p_params is determined by the number of parameter values required by this command. |
p_params | Pointer to a SMOCO_Parameters structure, to be filled with given values. |
SMOCO_ResponseID smoco_send_command | ( | SMOCO_CTX | ctx, |
SMOCO_CommandID | cmd_id, | ||
SMOCO_NodeID | node_id, | ||
SMOCO_ActuatorID | act_id, | ||
SMOCO_Parameters * | params | ||
) |
Sends a command to SMOCO, and waits for an initial response.
Intended as a general-purpose function for sending commands to SMOCO. Sends the commmand, after ensuring that the addressed SMOCO node is ready to receive it. Waits until an initial response is returned from SMOCO (which for many commands may be the only expected response).
ctx | Context handle for this session |
cmd_id | The ID of the command to be sent. |
node_id | The SMOCO node ID to receive the command, or ALL_SMOCO_NODES to broadcast the command to all nodes. |
act_id | The actuator ID to receive the command, if the command is actuator-specific. A value of ACT_ALL will address the command to all actuators on the given node(s). Specify ACT_NONE if the command is not actuator-specific. |
params | A pointer to a SMOCO_Parameters structure containing parameter information specific to the given command. |
SMOCO_STATUS smoco_send_command_nonsync | ( | SMOCO_CTX | ctx, |
SMOCO_CommandID | cmd_id, | ||
SMOCO_NodeID | node_id, | ||
SMOCO_ActuatorID | act_id, | ||
SMOCO_Parameters * | params | ||
) |
Low-level routine, formats and sends command to SMOCO hardware.
Sends a command to SMOCO hardware. Does not perform any checking beforehand, and does not wait for a response. Not intended for general purpose use.
ctx | Context handle for this session |
cmd_id | The ID of the command to be sent. |
node_id | The SMOCO node ID to receive the command, or ALL_SMOCO_NODES to broadcast the command to all nodes. |
act_id | The actuator ID to receive the command, if the command is actuator-specific. A value of ACT_ALL will address the command to all actuators on the given node(s). Specify ACT_NONE if the command is not actuator-specific. |
params | A pointer to a SMOCO_Parameters structure containing parameter information specific to the given command. |