libsmoco
Low-level interface library for Segment Motion Controller system
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Command Functions
Collaboration diagram for Command Functions:

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...
 

Detailed Description

Function Documentation

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().

Parameters
cmd_idThe 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_paramsPointer to a SMOCO_Parameters structure, to be filled with given values.
Returns
SMOCO_ST_SUCCESS if successful, any other value indicates an error.
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).

Parameters
ctxContext handle for this session
cmd_idThe ID of the command to be sent.
node_idThe SMOCO node ID to receive the command, or ALL_SMOCO_NODES to broadcast the command to all nodes.
act_idThe 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.
paramsA pointer to a SMOCO_Parameters structure containing parameter information specific to the given command.
Returns
The ID of the initial response returned by SMOCO, e.g. "Success" or "Motion Started".
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.

Parameters
ctxContext handle for this session
cmd_idThe ID of the command to be sent.
node_idThe SMOCO node ID to receive the command, or ALL_SMOCO_NODES to broadcast the command to all nodes.
act_idThe 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.
paramsA pointer to a SMOCO_Parameters structure containing parameter information specific to the given command.
Returns
SMOCO_ST_SUCCESS if send was successful, all other values indicate an error.