- introduced <controller> actions function for listing actions

- introduced <controller> reconnect function
This commit is contained in:
zolliker
2010-04-13 14:17:58 +00:00
parent 38818e650c
commit 6c4f57ec6f
4 changed files with 113 additions and 18 deletions

View File

@ -29,6 +29,13 @@ typedef int DevActionMatch(void *callData, void *actionData);
*/
typedef void DevKillActionData(void *actionData);
/** \brief ActionData info function
* \param actionData action data
* \return textual information about action for listing
* the result is an allocated string and has to be freed after use
*/
typedef char * DevInfoFunc(void *actionData);
/** \brief possible priorities.
* NullPRIO and NumberOfPRIO must not be used as priority
* if an action with StartPRIO is scheduled, all other activities
@ -59,11 +66,16 @@ void DevDebugMode(DevSer * devser, int steps);
* \param devser the device serializer
*/
void DevKill(DevSer * devser);
/** \brief Disconnect
/** \brief disconnect and disable the serializer
* \param devser The device serializer to disconnect
*/
void DevDisconnect(DevSer * devser);
/** \brief reconnect the serializer
* \param devser The device serializer to reconnect
* \param hostport <host>:<port> to reconnect to another port
* ar an empty string to reconnect to the same port
*/
void DevReconnect(DevSer * devser, char *hostport);
/** \brief Queue an action
*
* If a matching action with the same action handler
@ -76,12 +88,14 @@ void DevDisconnect(DevSer * devser);
* \param killFunc the action data kill function (called from DevKill and
* after the action has finished, i.e. when hdl returned NULL)
* or NULL if no kill function is needed.
* \param infoFunc the actions info function or NULL if no info function
* is defined.
* \return 1 when this was a new action, 0 when an action was overwritten
* in the second case the actionData's kill Function is immediately called
*/
int DevQueue(DevSer * devser, void *actionData, DevPrio prio,
DevActionHandler * hdl, DevActionMatch * matchFunc,
DevKillActionData * killFunc);
DevKillActionData * killFunc, DevInfoFunc * infoFunc);
/** \brief Schedule a periodic action
*
@ -94,13 +108,15 @@ int DevQueue(DevSer * devser, void *actionData, DevPrio prio,
* \param hdl the action handler
* \param matchFunc a match function with two arguments of the same type
* \param killFunc the action data kill function or NULL if no kill function is needed.
* \param infoFunc the actions info function or NULL if no info function
* is defined.
* \return 1 when this was a new action, 0 when an action was overwritten
* in the second case the actionData's kill Function is immediately called
*/
int DevSchedule(DevSer * devser, void *actionData,
DevPrio prio, double interval,
DevActionHandler * hdl, DevActionMatch * matchFunc,
DevKillActionData * killFunc);
DevKillActionData * killFunc, DevInfoFunc * infoFunc);
/** \brief Unschedule matching actions
* \param devser the device serializer
@ -140,4 +156,10 @@ char *DevPrio2Text(DevPrio prio);
*/
DevPrio DevText2Prio(char *text);
/** \brief List registered actions
* \param devser the device serializer
* \return the listing text
*/
char * DevList(DevSer * devser);
#endif