User guide
August 2001 33
Sending and Receiving Digits
Example 1 shows how to send digits using RHT_DIAL_R2.
Example 1. RHT_DIAL_R2 Sample Code
#include “brktddm.h”
int main(int argc, char **argv)
{
BRKT_HANDLE VpHandle; /* VP device handle */
BOOLEAN IoctlResult; /* Result of IOCTL call */
BRKT_SIZE_T BytesReturned; /* Bytes returned from IOCTL call*/
USHORT DigitMode;
struct VPdialR2_s Dial;
/* Open VP device */
VpHandle = BrktOpenDevice (BRKT_DEVICE_VP, 0);
/* Set digit mode to detect forward R2 digits */
DigitMode = EN_R2_FORWARD;
IoctlResult = BrktDeviceIoControl (
VpHandle,
RHT_SET_DIGIT_MODE,
&DigitMode, /* Buffer to driver */
sizeof(DigitMode),
NULL,
0,
&BytesReturned,
NULL); /* Wait until I/O is complete */