
Description | Cautions | Example | Errors
Name: |
int d42_display(devh, bufferp) | |
Inputs: |
int devh |
|
char *bufferp |
| |
Returns: |
ED42_NOERROR |
|
Includes: |
D42LIB.H | |
Mode: |
synchronous | |
Supports: |
D/42-SL, D/42-SX, D/42-NS, D/42-NE2 | |
The d42_display( ) function retrieves the current LCD/LED display (alphanumeric) data and places it in an application buffer. The application buffer must be 49 bytes, and will hold the entire data string (see below) plus a NULL character. The length of the data string is variable. Byte 0 of the display data corresponds to the top, left-most display element. The display data is stored as a null-terminated ASCII string. Refer to the D/42 Series User's Guide for more information specific to your PBX. Examples showing the contents of the application buffer for each supported switch are as follows:
MITEL PBX (D/42D-SX) - 16-digit display
Data |
20 20 4E 4F 4E 45 20 41 43 54 49 56 45 20 20 20 |
00 xx xx xx xx xx xx xx |
Byte |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
16 17 18 19 20 21 22 23 |
Data |
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx |
xx xx xx xx xx xx xx xx |
Byte |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
40 41 42 43 44 45 46 47 |
Northern Telecom SL-1 (D/42D-SL) - 16-digit display
data |
20 30 34 20 31 35 20 20 31 30 2D 30 38 2D 39 36 |
00 xx xx xx xx xx xx xx |
byte |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
16 17 18 19 20 21 22 23 |
data |
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx |
xx xx xx xx xx xx xx xx |
byte |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
40 41 42 43 44 45 46 47 |
Northern Telecom Norstar (D/42-NS) - 32-digit display
data |
54 72 61 6E 73 66 65 72 20 20 20 20 20 20 20 20 |
byte |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
| |
data |
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
byte |
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
data |
00 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx |
byte |
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
NEC KTS/PBX (D/42-NE2) - 32-digit display
data |
20 50 52 4F 47 52 41 4D 00 4D 4F 44 45 20 20 20 |
byte |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
| |
data |
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
byte |
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
data |
00 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx |
byte |
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
Parameter |
Description |
devh: |
specifies the valid channel device descriptor obtained by a call to dx_open( ) |
bufferp: |
pointer to the application buffer. The buffer will contain the display data in ASCII format. |
The application buffer must be 49 bytes. The length of the LCD display data is variable (currently 16 or 32 bytes), and is stored as a null-terminated ASCII string. The 49 byte buffer size is for future expansion. An application that passes anything smaller will not be backward compatible in future releases.
If you execute a function that updates the display (e.g., set the message waiting indicator, or show the calling number ID), ensure that you allow time for the switch to update the display before using d42_display( ), or you can call the d42_display( ) function until valid display data is returned.
void main(void)
{
int devh;
int rc = 0;
char bufferp[49];
/* Open Channel Device */
if ( (devh = dx_open("dxxxB1C1",NULL))==-1)
{
printf("Error dx_open( )\n");
exit(-1);
} /* End dx_open */
/* Wait for incoming call */
if ( (rc = dx_wtring(devh, 2, DX_ONHOOK, -1))==-1)
{
printf("Error dx_wtring( )\n");
dx_close(devh);
exit(-1);
}
/* Get the Display Information */
if ( (rc = d42_display(devh, bufferp)) == -1)
{
printf("Error d42_display( )\n");
dx_close(devh);
exit(-1);
} /* End d42_display */
printf("Display = %s\n",bufferp);
dx_close(devh);
} /* End main */
If this function returns -1 to indicate a failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following (most common) errors. For a complete list of error codes and definitions, refer to Appendix C.
ED42_FWREQFAILURE |
Firmware error |
ED42_UNKNOWNBOARD |
Unknown D/42 board type |
ED42_BADDEVICE |
Invalid or wrong device handle |
ED42_INVALARG |
Invalid argument passed to function |
DXLIB_INVNRB |
Internal voice library error |
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation