SERDISP_GPEVENTS

Event-loop functions

int SDEVLP_start (struct serdisp_s *dd)
 
int SDEVLP_stop (struct serdisp_s *dd)
 
int SDEVLP_getstatus (struct serdisp_s *dd)
 
int SDEVLP_add_listener (struct serdisp_s *dd, byte gpid, fp_eventlistener_t eventlistener)
 add an event listener for a GPI More...
 
int SDEVLP_del_listener (struct serdisp_s *dd, byte gpid, fp_eventlistener_t eventlistener)
 delete an event listener defined for a GPI More...
 
int SDEVLP_purge_listeners (struct serdisp_s *dd, byte gpid)
 purge all event listeners defined for a GPI More...
 
int SDEVLP_count_listeners (struct serdisp_s *dd, byte gpid)
 count number of event listeners defined for a GPI More...
 

GPO specific functions

byte SDGPO_getamount (struct serdisp_s *dd)
 
byte SDGPO_gettype (struct serdisp_s *dd, byte gpid)
 
byte SDGPO_search (struct serdisp_s *dd, const char *gpname)
 
SDGPO_t * SDGPO_getdescriptor (struct serdisp_s *dd, byte gpid)
 
int SDGPO_invert (struct serdisp_s *dd, byte gpid)
 
int SDGPO_setvalue (struct serdisp_s *dd, byte gpid, int32_t value)
 
int SDGPO_setpackage (struct serdisp_s *dd, byte gpid, byte *data, int32_t length)
 

GPI specific functions

byte SDGPI_getamount (struct serdisp_s *dd)
 
byte SDGPI_gettype (struct serdisp_s *dd, byte gpid)
 
byte SDGPI_search (struct serdisp_s *dd, const char *gpname)
 
SDGPI_t * SDGPI_getdescriptor (struct serdisp_s *dd, byte gpid)
 
int SDGPI_isenabled (struct serdisp_s *dd, byte gpid)
 
int SDGPI_enable (struct serdisp_s *dd, byte gpid, int enable)
 
int SDGPI_getstreamfd (struct serdisp_s *dd, byte gpid)
 

Host byte order vs. network byte order conversion functions

void SDGPT_event_header_hton (struct SDGP_event_s *event)
 converts an event header from host byte order to network byte order More...
 
void SDGPT_event_header_ntoh (struct SDGP_event_s *event)
 converts an event header from network byte order to host byte order More...
 
void SDGPT_event_payload_hton (void *payload, int bytes, byte word_length)
 converts an event payload from host byte order to network byte order More...
 
void SDGPT_event_payload_ntoh (void *payload, int bytes, byte word_length)
 converts an event payload from network byte order to host byte order More...
 

Detailed Description

Introduction

serdisp_gpevents.h offers functions and definition for

Features

General Purpose Items

serdisplib supports both incoming and outgoing general purpose items

Event-Handling

Function Documentation

int SDEVLP_add_listener ( struct serdisp_s *  dd,
byte  gpid,
fp_eventlistener_t  eventlistener 
)
Parameters
dddevice descriptor
gpidGPI id
eventlistenereventlistener (function pointer) to be added
Return values
0successfully added eventlistener
1eventlistener already available
<0unsuccessful
Since
1.98.0
int SDEVLP_count_listeners ( struct serdisp_s *  dd,
byte  gpid 
)
Parameters
dddevice descriptor
gpidGPI id (0xFF -> count all listeners)
Return values
>=0number of event listeners in chain
<0unsuccessful
Since
1.98.0
int SDEVLP_del_listener ( struct serdisp_s *  dd,
byte  gpid,
fp_eventlistener_t  eventlistener 
)
Parameters
dddevice descriptor
gpidGPI id
eventlistenereventlistener (function pointer) to be deleted
Return values
0successfully deleted eventlistener
1eventlistener not in list
<0unsuccessful
Since
1.98.0
int SDEVLP_purge_listeners ( struct serdisp_s *  dd,
byte  gpid 
)
Parameters
dddevice descriptor
gpidGPI id (0xFF -> purge all listeners)
Return values
0successfully purged eventlisteners
<0unsuccessful
Since
1.98.0
void SDGPT_event_header_hton ( struct SDGP_event_s *  event)
Parameters
eventevent header
Since
1.98.0
void SDGPT_event_header_ntoh ( struct SDGP_event_s *  event)
Parameters
eventevent header
Since
1.98.0
void SDGPT_event_payload_hton ( void *  payload,
int  bytes,
byte  word_length 
)
Parameters
payloadevent payload
bytesamount of event payload data
word_lengthword length of a payload data
Since
1.98.0
void SDGPT_event_payload_ntoh ( void *  payload,
int  bytes,
byte  word_length 
)
Parameters
payloadevent payload
bytesamount of event payload data
word_lengthword length of a payload data
Since
1.98.0