S
Sikandar
typedef struct
{
int (*close)( void );
void (*enable)( bool );
void (*tx)( void );
int (*sergetchar)( bool );
}SERINTERFACE, *PSERINTERFACE;
typedef enum
{
SER_NONE,
SER_TELEGRAPH, /* telegraph plug in board */
SER_MEMORY, /* Trace messages dumped to a RAM buffer */
SER_DBGCOMM, /* the muli-ice debug comms channel */
SER_HOSTMODEM /* the host modem llserial interface */
} LLSERID;
typedef struct
{
void (*flowHandler)( bool );
void (*flowReadyHandler)( bool );
void (*cdHandler)( bool );
void (*ringHandler)( void );
void (*rxHandler)( unsigned int, char* );
} LLSERCALLBACKS, *PLLSERCALLBACKS;
static PSERINTERFACE (*llseropen[])( PLLSERCALLBACKS ) =
{ NULL,
ll_Int0,
ll_Int1,
ll_Int2,
}
PSERINTERFACE llser_open( LLSERID id, PLLSERCALLBACKS pcb )
{
if( (id < 1) || (id > (sizeof( llseropen )/sizeof( PLLSERINTERFACE
)) ) )
{
return( NULL );
}
else
{
if (llseropen[id] != NULL) //LINE 1
{
return( llseropen[id]( pcb ) ); // LINE 2
}
else
{
return( NULL );
} /* endif */
}
What exactly is happening in Line 1 and line 2.
Regards in anticipation of your replies,
Sikandar
{
int (*close)( void );
void (*enable)( bool );
void (*tx)( void );
int (*sergetchar)( bool );
}SERINTERFACE, *PSERINTERFACE;
typedef enum
{
SER_NONE,
SER_TELEGRAPH, /* telegraph plug in board */
SER_MEMORY, /* Trace messages dumped to a RAM buffer */
SER_DBGCOMM, /* the muli-ice debug comms channel */
SER_HOSTMODEM /* the host modem llserial interface */
} LLSERID;
typedef struct
{
void (*flowHandler)( bool );
void (*flowReadyHandler)( bool );
void (*cdHandler)( bool );
void (*ringHandler)( void );
void (*rxHandler)( unsigned int, char* );
} LLSERCALLBACKS, *PLLSERCALLBACKS;
static PSERINTERFACE (*llseropen[])( PLLSERCALLBACKS ) =
{ NULL,
ll_Int0,
ll_Int1,
ll_Int2,
}
PSERINTERFACE llser_open( LLSERID id, PLLSERCALLBACKS pcb )
{
if( (id < 1) || (id > (sizeof( llseropen )/sizeof( PLLSERINTERFACE
)) ) )
{
return( NULL );
}
else
{
if (llseropen[id] != NULL) //LINE 1
{
return( llseropen[id]( pcb ) ); // LINE 2
}
else
{
return( NULL );
} /* endif */
}
What exactly is happening in Line 1 and line 2.
Regards in anticipation of your replies,
Sikandar