libsmoco
Low-level interface library for Segment Motion Controller system
|
Functions in this group invoke and manage background execution of long-running SMOCO commands (movement commands) within an event-driven "transaction" context. More...
Functions | |
SMOCO_ResponseID | smoco_run_command (SMOCO_CTX ctx, SMOCO_CommandID cmd_id, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id, SMOCO_Parameters *params, SMOCO_EventCB_t cb_response, void *cbdata) |
Runs a SMOCO command on a single node and actuator within a transaction-tracking context and waits for the completion of the transaction. More... | |
SMOCO_STATUS | smoco_start_command (SMOCO_CTX ctx, SMOCO_CommandID cmd_id, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id, SMOCO_Parameters *params, SMOCO_EventCB_t cb_response, void *cbdata) |
Starts a SMOCO command on a single node and actuator within a transaction-tracking context. More... | |
Functions in this group invoke and manage background execution of long-running SMOCO commands (movement commands) within an event-driven "transaction" context.
SMOCO_ResponseID smoco_run_command | ( | SMOCO_CTX | ctx, |
SMOCO_CommandID | cmd_id, | ||
SMOCO_NodeID | node_id, | ||
SMOCO_ActuatorID | act_id, | ||
SMOCO_Parameters * | params, | ||
SMOCO_EventCB_t | cb_response, | ||
void * | cbdata | ||
) |
Runs a SMOCO command on a single node and actuator within a transaction-tracking context and waits for the completion of the transaction.
Implemented as a general-purpose wrapper for smoco_start_command(), providing a simple default response callback, runcmd_cb(). Intended for long-running movement commands, smoco_run_commmand() creates a transaction-tracking context for the given command, sends the command to SMOCO, and then waits for its completion.
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. A value of ALL_SMOCO_NODES will return an error and no command will be sent. |
act_id | The actuator ID to receive the command, if the command is actuator-specific. A value of ACT_ALL will return an error and no command will be sent. 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. |
cb_response | A SMOCO_EventCB_t function pointer, to be called in response to events generated by the transaction tracker. This event handler will be called BEFORE the actions in the default handler. |
cbdata | An opaque pointer to be provided to the callback function provided in cb_response |
SMOCO_STATUS smoco_start_command | ( | SMOCO_CTX | ctx, |
SMOCO_CommandID | cmd_id, | ||
SMOCO_NodeID | node_id, | ||
SMOCO_ActuatorID | act_id, | ||
SMOCO_Parameters * | params, | ||
SMOCO_EventCB_t | cb_response, | ||
void * | cbdata | ||
) |
Starts a SMOCO command on a single node and actuator within a transaction-tracking context.
Intended for long-running movement commands, smoco_start_commmand() creates a transaction-tracking context for the given command, sends the command to SMOCO and waits for an initial response. The processing of the command then continues in the background. A callback function can be specified to handle events generated by the transaction created for this command.
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. A value of ALL_SMOCO_NODES will return an error and no command will be sent. |
act_id | The actuator ID to receive the command, if the command is actuator-specific. A value of ACT_ALL will return an error and no command will be sent. 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. |
cb_response | A SMOCO_EventCB_t function pointer, to be called in response to events generated by the transaction tracker. |
cbdata | An opaque pointer to be provided to the callback function provided in cb_response |