Functions for interacting with cached state information about SMOCO nodes and actuators.
More...
|
SMOCO_STATUS | smoco_cache_verify_node (SMOCO_CTX ctx, SMOCO_NodeID node_id) |
| Verify existence of cache information for a SMOCO node. More...
|
|
SMOCO_STATUS | smoco_cache_get_act_position (SMOCO_CTX ctx, unsigned *p_position, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id) |
| Find cached position of an actuator. More...
|
|
SMOCO_STATUS | smoco_cache_get_act_velocity (SMOCO_CTX ctx, unsigned *p_velocity, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id) |
| Get current velocity of actuator from cache. More...
|
|
SMOCO_STATUS | smoco_cache_get_act_vmax (SMOCO_CTX ctx, unsigned *p_vmax, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id) |
| Find maximum velocity setting for an actuator. More...
|
|
SMOCO_STATUS | smoco_cache_get_act_limitstatus (SMOCO_CTX ctx, uint8_t *p_lstat, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id) |
| Find cached limit switch status of an actuator, in the form of a bit field. More...
|
|
SMOCO_STATUS | smoco_cache_get_act_mvstatus (SMOCO_CTX ctx, uint8_t *p_mvstat, SMOCO_NodeID node_id, SMOCO_ActuatorID act_id) |
| Find cached movement status of an actuator, in the form of a bit field. More...
|
|
Functions for interacting with cached state information about SMOCO nodes and actuators.
Responses from SMOCO that contain state information are intercepted and cached automatically. smoco_cache functions provide an interface for accessing that cached state information. Note that the cached values may vary from the current real values; for best possible accuracy these functions should be invoked immediately after commands that refresh the cache information (eg. GETACTSTAT).
Find cached limit switch status of an actuator, in the form of a bit field.
- Parameters
-
ctx | Context handle for this session |
p_lstat | Pointer to receive limit status value. This value will consist of bits set corresponding to both upper and lower limit switches, at bit positions defined by the Actuator_Limit_Flags enumeration in smoco_types.h |
node_id | Identifier of node to query. Must be a single valid node; a value of ALL_SMOCO_NODES will result in an error. |
act_id | Identifier of an actuator to query. Must be a single valid actuator; a value of ACT_ALL or ACT_NONE will result in an error. |
- Returns
- SMOCO_ST_SUCCESS if cached limit switch value was found; all other values indicate an error.
Find cached movement status of an actuator, in the form of a bit field.
- Parameters
-
ctx | Context handle for this session |
p_mvstat | Pointer to receive movement status value. Bits in this value are defined in the SMOCO_Status_Flags enumeration in smoco_types.h |
node_id | Identifier of node to query. Must be a single valid node; a value of ALL_SMOCO_NODES will result in an error. |
act_id | Identifier of an actuator to query. Must be a single valid actuator; a value of ACT_ALL or ACT_NONE will result in an error. |
- Returns
- SMOCO_ST_SUCCESS if cached limit switch value was found; all other values indicate an error.
Find cached position of an actuator.
- Parameters
-
ctx | Context handle for this session |
p_position | Pointer to receive position value. |
node_id | Identifier of node to query. Must be a single valid node; a value of ALL_SMOCO_NODES will result in an error. |
act_id | Identifier of an actuator to query. Must be a single valid actuator; a value of ACT_ALL or ACT_NONE will result in an error. |
- Returns
- SMOCO_ST_SUCCESS if cached position was found; all other values indicate an error.
Get current velocity of actuator from cache.
Be aware that the value fetched by this function is likely to be stale unless immediately preceded by a status response from the SMOCO controller.
- Parameters
-
ctx | Context handle for this session |
p_velocity | Pointer to receive velocity value, in steps per second. |
node_id | Identifier of node to query. Must be a single valid node; a value of ALL_SMOCO_NODES will result in an error. |
act_id | Identifier of an actuator to query. Must be a single valid actuator; a value of ACT_ALL or ACT_NONE will result in an error. |
- Returns
- SMOCO_ST_SUCCESS if cached position was found; all other values indicate an error.
Find maximum velocity setting for an actuator.
- Parameters
-
ctx | Context handle for this session |
p_vmax | Pointer to receive maximum velocity value. |
node_id | Identifier of node to query. Must be a single valid node; a value of ALL_SMOCO_NODES will result in an error. |
act_id | Identifier of an actuator to query. Must be a single valid actuator; a value of ACT_ALL or ACT_NONE will result in an error. |
- Returns
- SMOCO_ST_SUCCESS if cached maximum velocity was found; all other values indicate an error.
Verify existence of cache information for a SMOCO node.
- Parameters
-
ctx | Context handle for this session |
node_id | Identifier of node to query |
- Returns
- SMOCO_ST_SUCCESS if node cache found, SMOCO_ST_BADNODE if not found