
Description | Cautions | Example | Errors | See Also
Name: |
long ATDT_DNLDVER(devh) | |
Inputs: |
int devh |
|
Returns: |
version of firmware used by the device | |
Includes: |
srllib.h | |
Category: |
Extended Attribute | |
Mode: |
synchronous | |
The ATDT_DNLDVER( ) function returns the firmware version downloaded to the device specified in devh. This number is returned in the standard version numbering format.
Parameter |
Description |
devh: |
Specifies the valid Digital Network Interface logical board device handle returned by a call to dt_open( ) |
Version Numbering
A version number consists of two parts that provide:
This function returns the version number as a long integer (32 bits) in BCD (binary coded decimal) format.
Figure 11 shows the format of the version number returned. Each section in the diagram represents a nibble (4 bits).
Figure 11. Firmware Version Number Format

Nibble 1 returns the type of release in BCD numbers. A converted value of 0 indicates a Production release and a converted value of 1 indicates a Beta release.
Nibbles 2, 3, and 4 return the Production Release Number.
Nibbles 5, 6, 7, and 8 return the Internal Release Number used for pre-production product releases. Nibbles 5 and 6 hold the product's Beta number. Nibbles 7 and 8 hold additional information used for internal releases.
Table 2 displays a breakdown of the values returned by each nibble in the long integer.
Table 2. ATDT_DNLDVER( ) Return Values
Nibble (4 bits) | ||||
1 |
2 |
3 & 4 |
5 & 6 |
7 & 8 |
TYPE |
PRODUCTION RELEASE NUMBER |
INTERNAL NUMBER | ||
Production |
Major Release No. |
Minor Release No. |
N/A |
N/A |
Beta |
Major Release No. |
Minor Release No. |
Beta Number |
N/A |
Major and Minor Release Numbers
Major and minor release numbers distinguish major revisions from minor revisions to Production releases. The major number converts to a single digit integer that increments with each major revision to the release. The minor number converts to a two digit integer that increments with each minor revision to the release.
In decimal number format, the major number is the number before the decimal point, and the minor number is the number after the decimal point.
The following list gives examples of each type of release. The values used in these examples have been converted from the binary coded decimal numbers returned in the long integer and are displayed according to the convention.
This function will fail if an invalid Digital Network Interface logical board device handle is specified.
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
void main()
{
int bdev;
long version;
if ((bdev = dt_open("dtiB1", 0)) == -1) {
printf("Error in dt_open\n");
}
/* Get the version number */
version = ATDT_DNLDVER(bdev);
if (version == AT_FAILURE) {
printf("ERROR in getting version #\n");
}
else {
/* display the version # */
printf("DTI version number is %x.%02x ",
(int) ((version >>24)&0x0F), ((version >> 16)&0xFF));
// check for the download type
switch (version >> 28) {
case 0:
printf("beta %02x \n", ((version >> 16)&0xFF));
case 1:
printf("production\n");
} // end switch
}
dt_close(bdev);
printf("\nend of prog\n");
}
If the function returns AT_FAILURE, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive error message. See Appendix A - Standard Runtime Library for more information on SRL functions. The error codes returned by ATDV_LASTERR( ) are:
Error defines can be found in the file dtilib.h.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation