Loading...
Searching...
No Matches
Miscellaneous functions
Internal API 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.
void | ValidHandleCheck (int handle)
void | validate_digits (const char *digits)
| Validate a `NULL` terminated string of `DTMF` digits.
int | putevt (VPB_EVENT *event, unsigned long mask=0)
| Internal function to place an event on the API event queue.
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 Country * | get_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.

## Variables

Comm * | vpb_c
| Pointer to the global comm object.

## 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

  VpbException | will be thrown, stating where, if handle is invalid.

References Totalchans, vpb_dev, and VPB_OFF.

Referenced by vpb_close(), vpb_deltonedet(), vpb_disable_event(), vpb_disable_tone_event(), vpb_enable_event(), vpb_enable_tone_event(), vpb_flush_events(), vpb_get_card_type(), vpb_get_event_ch_async(), vpb_get_event_ch_sync(), vpb_get_event_mask(), vpb_get_hookstate(), vpb_get_model(), vpb_get_model(), vpb_get_port_country(), vpb_get_port_type(), vpb_get_tone_event_mask(), vpb_gettonedet(), vpb_play_buf_start(), vpb_play_get_gain(), vpb_play_get_hw_gain(), vpb_play_set(), vpb_play_set_gain(), vpb_play_set_hw_gain(), vpb_record_buf_start(), vpb_record_get_gain(), vpb_record_get_hw_gain(), vpb_record_set(), vpb_record_set_gain(), vpb_record_set_hw_gain(), vpb_reset(), vpb_ring_station_async(), vpb_set_country(), vpb_set_event_callback(), vpb_set_event_mask(), vpb_set_flashtime(), vpb_set_tone_event_mask(), vpb_sethook_async(), and vpb_settonedet().

## putevt()

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

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

Parameters

  event | The event to place on the API queue.
  mask | The mask to use for this event (set to 0 if not required).

References APIQ, VPB_DEV::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

  handle | The handle returned by a call to `vpb_open()`.
  addr | 8-bit address of the codec register.
  data | 8-bit data to write to the register.
  comm | The 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

  Wobbly | will be thrown if any of the digits are not valid.

Referenced by vpb_get_digits_async(), vpb_get_digits_sync(), vpb_play_set(), and vpb_record_set().

## Variable Documentation

## vpb_c

Comm* vpb_c

extern

Pointer to the global comm object.

Pointer to the global comm object.

Referenced by get_board_model(), get_board_type(), get_country(), get_driver_type(), get_port_type(), play_reset_hw_gain(), playrec_open(), record_reset_hw_gain(), VTCore::Reset(), ring_station_async(), set_country(), OpenPri::SetHookState(), V4PCI_DSP::SetHookState(), vpb_bridge(), vpb_close(), vpb_debug_tonedet(), vpb_echo_canc_get_sup_thresh(), vpb_echo_canc_set_sup_thresh(), vpb_get_card_info(), vpb_get_hookstate(), vpb_get_ports_per_card(), vpb_hostecho_off(), vpb_hostecho_on(), vpb_listen(), vpb_loopback_off(), vpb_loopback_on(), vpb_monitor_audio(), vpb_monitor_terminate(), vpb_open(), vpb_play_get_hw_gain(), vpb_play_set_hw_gain(), vpb_playtone_state(), vpb_record_get_hw_gain(), vpb_record_set_hw_gain(), vpb_reset(), vpb_set_country(), vpb_set_flashtime(), vpb_sethook_async(), and vpb_tone_terminate().