stack_cfg

Top  Previous  Next

struct stack_cfg{

void (*log)(char* text);

void (*statusUpdate)(struct stackStatus* sstat);

};

The structure stack_cfg has two members.

The parameters are pointers to callback functions.  Pointers to callback functions may be left NULL if the user doesn't need this information.

 

void (*log)(char* text);

The callback function log is called by the stack to pass information to the user.

Parameters

text

A message to the user.

The message is constructed in the following format: {n}:Description,

Where n is a number representing the severity level.  The possible values for n are defined in slog.h.

Description describes the event itself.

 

void (*statusUpdate)(struct stackStatus* sstat);

The callback function statusUpdate is called by the stack to inform the user about important status changes.

Parameters

sstat

A pointer to a structure that receives the status information.

struct stackStatus{

unsigned int linkStatus;

unsigned int stackStatus;

};

Member linkStatus gives information about link. Wether cable is connected or not and if so what is the current link speed.

Member stackStatus indicates the general status of the stack as defined in stackstatus.h.