Auxiliary and miscellaneous functions/macros

Auxiliary functions for handling & reporting errors.

Defines

#define SET_FLOAT(v, f)   v.type = DC_FLOAT; v.value.f = f
 Initialize float DCValue.
#define SET_INT(v, i)   v.type = DC_INT; v.value.f = i
 Initialize integer DCValue.
#define SET_STRING(v, s, l)
 Initialize string DCValue.

Typedefs

typedef int( PropCallback )(uint32_t t)
 Property callback function for recursive node walker.

Functions

int APIDECL dcDevice_GetHubName (DEVICE d, const char **name)
 Returns the Hub name of the open device.
int APIDECL dcValue_ToString (DCValue *val, char *outs, int len)
 Converts DCValue into string representation.
FeedbackFuncP APIDECL dcSetFeedback (DEVICE d, FeedbackFuncP func)
 Sets device feedback function.
LogFuncP APIDECL dcSetLogFunc (LogFuncP func)
 Set Log function.

Typedef Documentation

typedef int( PropCallback)(uint32_t t)

See source code for detailed information.

Parameters:
t The current node token
Returns:
1: success, continue walking 0: quit walking.

Function Documentation

int APIDECL dcDevice_GetHubName ( DEVICE  d,
const char **  name 
)

The hub name is merely the descriptor for the underlying transport protocol (TCP, USB, etc.)

Parameters:
d Device handle
name Pointer to a const char * to point to name of the associated Hub ("TCP", "USB", ...) after successfull call.
Returns:
Error code. The returned name is only valid when the error code is 0.
Examples:
master.c.
FeedbackFuncP APIDECL dcSetFeedback ( DEVICE  d,
FeedbackFuncP  func 
)

The feedback function must return a value = 0, if the caller should proceed. For example, a GUI based feedback routine may allow the user to cancel the procedure by hitting the ESC key. If the procedure was cancelled, the caller returns DCERR_CANCEL.

Parameters:
d Device handle
func Pointer to a feedback function of type FeedbackFuncP If equal 0, the default dummy routine (no feedback) is set.
Returns:
the previous feedback function pointer
LogFuncP APIDECL dcSetLogFunc ( LogFuncP  func  ) 

Sets the local log function. The function must be of type LogFuncP.

Returns previous log function.

int APIDECL dcValue_ToString ( DCValue val,
char *  outs,
int  len 
)
Parameters:
val DCValue to convert
outs Output string pointer
len Output string length
Returns:
error, if string length not sufficient
Examples:
master.c.

Generated on Thu Feb 24 13:50:16 2011 for Device Control library by  doxygen 1.6.1