- allow scriptcontext objects to be dynamic
- enhancements in scriptcontext (error messages stored as properties)
This commit is contained in:
14
devser.h
14
devser.h
@ -10,10 +10,12 @@ typedef struct DevSer DevSer;
|
||||
/** \brief The action handler to be called
|
||||
* \param actionData the data stored with the action
|
||||
* \param lastReply the last reply or NULL when no command was
|
||||
* sent in the last action
|
||||
* sent in the last action, or the error message (when commError == 1)
|
||||
* \param commError 0: ok, 1: there was a communication error
|
||||
* \return the command to be sent or NULL if no command has to be sent
|
||||
*/
|
||||
typedef char *DevActionHandler(void *actionData, char *lastReply);
|
||||
typedef char *DevActionHandler(void *actionData, char *lastReply,
|
||||
int commError);
|
||||
|
||||
/** \brief Check if an action matches the call data
|
||||
* \param callData the callers data
|
||||
@ -29,10 +31,12 @@ typedef void DevKillActionData(void *actionData);
|
||||
|
||||
/** \brief possible priorities.
|
||||
* NullPRIO and NumberOfPRIO must not be used as priority
|
||||
* if an action with StartPRIO is scheduled, all other activities
|
||||
* are blocked until the action is unscheduled
|
||||
*/
|
||||
typedef enum {
|
||||
NullPRIO, SlowPRIO, ReadPRIO, ProgressPRIO, WritePRIO, HaltPRIO,
|
||||
NumberOfPRIO
|
||||
StartPRIO, NumberOfPRIO
|
||||
} DevPrio;
|
||||
|
||||
/** \brief Make a new device serializer and async connection.
|
||||
@ -100,7 +104,7 @@ int DevSchedule(DevSer * devser, void *actionData,
|
||||
|
||||
/** \brief Unschedule matching actions
|
||||
* \param devser the device serializer
|
||||
* \param callData the callers data to be as first argument of the match function
|
||||
* \param actionData the callers data to be used as first argument of the match function
|
||||
* \param hdl the action handler
|
||||
* \param matchFunc the match function (callData does not need to have the same type as actionData)
|
||||
* \return the number of unscheduled actions
|
||||
@ -114,6 +118,7 @@ int DevUnschedule(DevSer * devser, void *actionData,
|
||||
*/
|
||||
int DevRemoveAction(DevSer * devser, void *actionData);
|
||||
|
||||
|
||||
/** \brief Convert integer priority to text
|
||||
* \param prio
|
||||
* \return text
|
||||
@ -126,5 +131,4 @@ char *DevPrio2Text(DevPrio prio);
|
||||
*/
|
||||
DevPrio DevText2Prio(char *text);
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user