5 fxo events, 1 m1966_fxo_event_t, Fxo events – Maxim Integrated 73M1866B/73M1966B Reference Driver User Manual
Page 15: M1966_fxo_event_t, Section 5

UG_1x66B_015
73M1866B/73M1966B Reference Driver User Guide
Rev. 2.7
15
5 FXO Events
The driver provides event service to the high level application by maintaining a FIFO queue of event
structures, M1966_FXO_EVENT_t. Events are created by the driver to reflect various conditions as
described in
. Once created, this new event is added to the FIFO queue and the driver notifies
the application layer via file descriptor status change mechanism. This in turn triggers the application to
request for the event via the M1966_EVENT_GET IOCTL. Upon retrieval, each event structure is removed
from the FIFO queue after its information is conveyed to the high level application.
To receive this FXO event notification the application must register for file descriptor status change using
the standard UNIX select() function. When this function returns the FXO event availability status will
reflect in the file descriptor parameter. The FD_ISSET macro can be used for checking the status, and if
available, the application can request for the event using M1966_EVENT_GET.
5.1 M1966_FXO_EVENT_t
Description
This structure is used by M1966_EVENT_GET to retrieve an event from the event queue. The event
structure consists of event ID indentifying the event, the channel ID identifying the FXO channel where
the event was generated, the number of remaining events in the queue, and up to four event data that
carries additional information pertaining to that specific event.
Prototype
typedef struct {
unsigned int event_id; /* Event ID */
unsigned int channel_id; /* Channel ID */
unsigned int event_cnt; /* number of remaining queued events */
unsigned int event_data1; /* additional data 1 */
unsigned int event_data2; /* additional data 2 */
unsigned int event_data3; /* additional data 3 */
unsigned int event_data4; /* additional data 4 */
}
M1966_FXO_EVENT_t;
Parameters
Data Type
Name
Description
unsigned int
event_id
unsigned int
channel_id
Channel ID.
unsigned int
event_cnt
Number of events that remain in the queue.
unsigned int
event_data1
Event data 1.
unsigned int
event_data2
Event data 2.
unsigned int
event_data3
Event data 3.
unsigned int
event_data4
Event data 4.