libvpb  4.2.61
Miscellaneous functions

A collection of internal implementation functions. More...

Collaboration diagram for Miscellaneous functions:

Functions

int RunTimeError (const Wobbly &w, const char *api_function)
 
void CheckHandle (VPBPortHandle handle, const char *where)
 Check for a valid device handle. More...
 
void ValidHandleCheck (int handle)
 
void validate_digits (const char *digits)
 Validate a NULL terminated string of DTMF digits. More...
 
int putevt (VPB_EVENT *event, unsigned long mask=0)
 Internal function to place an event on the API event queue. More...
 
void apifunc_trace (char s[])
 
int get_driver_type (int board)
 Return the symbolic type of the driver for board.
 
VPB_MODEL get_board_type (int board)
 Return the symbolic VPB_MODEL type of a board.
 
void get_board_model (int board, char *s)
 Return a descriptive model name for board in s.
 
VPB_PORT get_port_type (int board, int port)
 Return the type of a port on some board. VPB_FXO or VPB_FXS.
 
size_t get_total_port_count ()
 Return the total number of ports on all registered boards.
 
void set_country (int board, int port, const Country *country)
 Set the country data for port on board.
 
const Countryget_country (int board, int port)
 Return the country data for port on board.
 
void ring_station_async (int board, int port, int cadence)
 Internal function to control ringing on port of board.
 
void set_codec_reg (int handle, unsigned short addr, unsigned short data, Comm *comm)
 Write directly to a V4PCI codec register. More...
 

Variables

Commvpb_c
 Pointer to the global comm object. More...
 

Detailed Description

A collection of internal implementation functions.

These functions mostly mirror some of those from the public API but are implemented without error checking, or for invocation using already decomposed parameters.

Function Documentation

◆ CheckHandle()

void CheckHandle ( VPBPortHandle  handle,
const char *  where 
)

Check for a valid device handle.

The handle is valid if the device has been opened with a prior call to vpb_open().

Exceptions
VpbExceptionwill be thrown, stating where, if handle is invalid.

References Totalchans, vpb_dev, and VPB_OFF.

◆ putevt()

int putevt ( VPB_EVENT event,
unsigned long  mask = 0 
)

Internal function to place an event on the API event queue.

Parameters
eventThe event to place on the API queue.
maskThe mask to use for this event (set to 0 if not required).

References APIQ, VPB_DEV::callback_mutex, VPB_DEV::context, VPB_DEV::devstate, VPB_DEV::event_callback, VPB_DEV::evtmask, VPB_EVENT::handle, vpb_dev, and VPB_ON.

◆ set_codec_reg()

void set_codec_reg ( int  handle,
unsigned short  addr,
unsigned short  data,
Comm comm 
)

Write directly to a V4PCI codec register.

Parameters
handleThe handle returned by a call to vpb_open().
addr8-bit address of the codec register.
data8-bit data to write to the register.
commThe comm object used to send the message.

Used to set a register of the TS5070 codecs, allows driver-level config of codec, rather than hard-coding in DSP firmware.

References Comm::PutMessageVPB().

Referenced by playrec_open().

◆ validate_digits()

void validate_digits ( const char *  digits)

Validate a NULL terminated string of DTMF digits.

Note
this only includes the standard DTMF digits, user defined tone characters will fail if passed here, even if they are valid to be passed to vpb_dial_{a,}sync().
Exceptions
Wobblywill be thrown if any of the digits are not valid.

Variable Documentation

◆ vpb_c