API Ref
API Ref
GL Communications Inc.
GL T1/E1 Application Development Toolkit For Windows Programmers Guide and Reference Manual
Version 10.10
GL Communications Inc.
818 West Diamond Avenue - Third Floor Gaithersburg, MD 20878 USA
Contents
1. INTRODUCTION............................................................................................................................... 2 1.1 OBSOLETE AND INTERNAL (LOW LEVEL) FUNCTIONS .................................................................. 2 1.1.1 Obsolete Functions ................................................................................................................. 2 1.1.2 Internal (low level) Functions ................................................................................................ 2 1.2 SYMBOL CONVENTIONS ............................................................................................................... 4 2 PROGRAMMERS GUIDE............................................................................................................... 6 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 3 3.1 3.2 3.3 4 CREATING AND INITIALIZING INTERFACE OBJECT ........................................................................ 6 USING BUILT-IN DEBUGGING FEATURES ...................................................................................... 7 FUNCTION PARAMETERS .............................................................................................................. 8 FUNCTION GROUPS ...................................................................................................................... 8 INITIALIZATION AND TERMINATION FUNCTIONS .......................................................................... 8 CONFIGURATION FUNCTIONS ....................................................................................................... 9 MODE FUNCTIONS ...................................................................................................................... 10 CODEC FUNCTIONS ..................................................................................................................... 11 PORT INPUT/OUTPUT FUNCTIONS............................................................................................... 12 REGISTER FUNCTIONS ................................................................................................................ 12 BUFFER FUNCTIONS ................................................................................................................... 13 CROSS PORT FUNCTIONS ............................................................................................................ 14 DRIVER FUNCTIONS ................................................................................................................... 14 FRAMER FUNCTIONS .................................................................................................................. 16 BIT ERROR RATE FUNCTIONS..................................................................................................... 19 TIMESLOT FUNCTIONS................................................................................................................ 20 PATTERN FILE FUNCTIONS ......................................................................................................... 20 STREAM I/O FUNCTIONS ............................................................................................................ 21 MISCELLANEOUS FUNCTIONS ..................................................................................................... 22 SUBCHANNEL INPUT/OUTPUT .................................................................................................... 23 HDLC ENCODING/DECODING .................................................................................................... 24 FACILITY DATA LINK ................................................................................................................. 25 MEMORY MAPPED FILES AND VARRECBUF CLASS ................................................................... 26 DYNAMIC LIST BUFFER .............................................................................................................. 27 C INTERFACE.............................................................................................................................. 28 PERIODIC FILE SAVING............................................................................................................... 29 LINKER ....................................................................................................................................... 31 CONFIGURATION FILES .............................................................................................................. 32 BUILDING EXAMPLES................................................................................................................. 32
DRIVER API LIBRARY REFERENCE ........................................................................................ 33 4.1 EXCEPTIONS ............................................................................................................................... 33 4.2 ENABLING BUILT-IN DIAGNOSTIC MESSAGES IN DEBUG BUILDS ............................................ 35 4.3 CHECK WHETHER THE BUILT-IN DIAGNOSTIC MESSAGES ARE ENABLED .................................. 35 4.4 DISPLAY MESSAGE BOX USING PRINTF FORMATTING................................................................ 36 4.5 DISPLAY MESSAGE BOX USING PRINTF FORMATTING IN DEBUG BUILDS ONLY. ..................... 36 4.6 FORMAT AND DISPLAY CRITICAL ERROR MESSAGE BOX AND THROW AN EXCEPTION.............. 37 4.7 FORMAT ERROR MESSAGE BOX IN DEBUG BUILDS ONLY. APPEND GLCOMEXCEPTIONS TEXTUAL DESCRIPTION AND THROW A GLCOMEXCEPTIONS EXCEPTION. ............................................... 38 4.8 GET GLCOMEXCEPTIONS TEXTUAL DESCRIPTION ..................................................................... 38 4.9 GET TEXTUAL DESCRIPTION OF AN INTERNAL ERROR ............................................................... 39 4.10 CREATING A C INTERFACE OBJECT ............................................................................................ 40 4.11 DESTROYING A C INTERFACE OBJECT ........................................................................................ 41 4.12 CHECKING IF C INTERFACE OBJECT EXISTS .............................................................................. 41
II
4.13 4.14 4.15 4.16 4.17 4.18 4.19 4.20 4.21 4.22 4.23 4.24 4.25 4.26 4.27 4.28 4.29 4.30 4.31 4.32 4.33 4.34 4.35 4.36 4.37 4.38 4.39 4.40 4.41 4.42 4.43 4.44 4.45 4.46 4.47 4.48 4.49 4.50 4.51 4.52 4.53 4.54 4.55 4.56 4.57 4.58 4.59 4.60 4.61 4.62 4.63 4.64 4.65 4.66 4.67 4.68
GET POINTER TO DEVICE DRIVER INFORMATION FOR A DEVICE ................................................ 42 GET DEFAULT FILE PATTERN NAME .......................................................................................... 43 SET DEFAULT FILE PATTERN NAME ........................................................................................... 43 GET CURRENT PATTERN FILE NAME .......................................................................................... 43 SET CURRENT PATTERN FILE NAME .......................................................................................... 44 GET ACTIVE RECEIVE BUFFER POINTER .................................................................................... 44 GET ACTIVE TRANSMIT BUFFER POINTER.................................................................................. 45 GET ACTIVE RECEIVE BUFFER OFFSET ...................................................................................... 45 GET ACTIVE TRANSMIT BUFFER OFFSET ................................................................................... 46 GET INACTIVE RECEIVE BUFFER POINTER ................................................................................. 46 GET INACTIVE TRANSMIT BUFFER POINTER............................................................................... 47 GET ACTIVE RECEIVE BUFFER SEQUENTIAL NUMBER ............................................................... 48 GET ACTIVE TRANSMIT BUFFER SEQUENTIAL NUMBER ............................................................ 48 GET DATA TRANSMISSION RATE ............................................................................................... 49 FILL BOTH GLOBAL TRANSMIT BUFFERS WITH IDLE CODE ....................................................... 49 FILL BOTH GLOBAL TRANSMIT BUFFERS WITH A BYTE STRING................................................ 50 GET DRIVERS CURRENTLY SELECTED DEVICE NUMBER (OBSOLETE) ...................................... 50 GET NUMBER OF PHYSICAL DEVICES INSTALLED AND CONFIGURED ......................................... 51 GET NUMBER OF DEVICES FOUND DURING DRIVER INITIALIZATION ........................................ 52 GET RECEIVE/TRANSMIT GLOBAL BUFFER POINTERS ............................................................... 52 SELECT CURRENT DRIVER DEVICE NUMBER (OBSOLETE) ......................................................... 54 SYNCHRONIZE DEVICES ............................................................................................................. 54 GET IDLE CODE .......................................................................................................................... 54 GET NUMBER OF FRAMES PER MULTIFRAME ............................................................................. 55 GET MULTIFRAME SIZE.............................................................................................................. 56 GET MULTIFRAME DURATION.................................................................................................... 56 GET USABLE SOFTWARE BUFFER SIZE ....................................................................................... 57 GET NUMBER OF MULTIFRAMES PER SOFTWARE BUFFER ......................................................... 57 GET NUMBER OF FRAMES PER SOFTWARE BUFFER.................................................................... 58 GET ACTIVE GLOBAL TRANSMIT SOFTWARE BUFFER INDEX ..................................................... 58 GET ACTIVE GLOBAL RECEIVE SOFTWARE BUFFER INDEX ....................................................... 59 INITIALIZE INTERFACE ............................................................................................................... 60 CHECK CARD I/O AND MEMORY ................................................................................................ 61 CHECK CARD INPUT/OUTPUT ..................................................................................................... 61 CHECK CARD MEMORY.............................................................................................................. 62 LOAD DEFAULT CONFIGURATION (INTERNAL FUNCTION) ......................................................... 63 INITIALIZE IRQ, MEMORY OFFSET AND BASE ADDRESS (INTERNAL FUNCTION)....................... 63 CODEC INITIALIZATION (INTERNAL FUNCTION) ......................................................................... 64 READ FROM A PORT (INTERNAL FUNCTION)............................................................................... 64 WRITE TO A PORT (INTERNAL FUNCTION).................................................................................. 65 LOADING INTERNAL FPGA ........................................................................................................ 66 LOADING STATIC BER INTERNAL FPGA ................................................................................... 67 WAITING (INTERNAL FUNCTION) ............................................................................................... 68 FILL TRANSMIT BUFFERS WITH A FILLER BYTE (INTERNAL FUNCTION) .................................... 68 CHECKING MODE ....................................................................................................................... 69 SETTING MODE (INTERNAL FUNCTION) ..................................................................................... 70 WRITE TO TIMESLOT ASSIGNER (INTERNAL FUNCTION) ............................................................ 70 SPECIFYING THE TIMESLOT ASSIGNER RANGE ........................................................................... 71 WRITING TO DRIVER, FRAMER OR AUDIO REGISTERS (INTERNAL FUNCTION)........................... 72 SET CODEC GAIN OR TIME SLOT ................................................................................................ 73 SET CODEC CLOCK OR CASF..................................................................................................... 74 RESET CODEC FROM CASF TO BER .......................................................................................... 74 GET CODEC GAIN OR TIME SLOT ............................................................................................... 75 TURN ON CODEC SPEAKER OR VF TRANSMIT, OR ENABLE DROP INSERT .................................. 76 TURN OFF CODEC SPEAKER OR VF TRANSMIT, OR DISABLE DROP INSERT ............................... 77 CHECK CODEC SETTINGS ........................................................................................................... 78
III
4.69 ENABLE/DISABLE TIME SLOT FOR MULTIFRAME TRANSMISSION .............................................. 79 4.70 CHECK WHETHER A TIME SLOT IS AVAILABLE .......................................................................... 79 4.71 CHECK WHETHER ALL THE TIME SLOTS ARE AVAILABLE .......................................................... 80 4.72 MAKE ALL TIME SLOTS AVAILABLE/UNAVAILABLE ................................................................. 80 4.73 RESTORE TIME SLOT STATUS ..................................................................................................... 81 4.74 SAVE TIME SLOT STATUS........................................................................................................... 81 4.75 READ BER ERROR COUNTER AND CLEAR IT ............................................................................. 82 4.76 INSERT A LOGICAL OR BPV ERROR............................................................................................ 82 4.77 SELECT RECEIVE OR TRANSMIT BER......................................................................................... 83 4.78 DESELECT RECEIVE/TRANSMIT BER ......................................................................................... 84 4.79 LOAD BER STATIC PATTERN ..................................................................................................... 84 4.80 SETTING CROSS PORT MODE...................................................................................................... 84 4.81 GETTING CROSS PORT MODE ..................................................................................................... 85 4.82 DISABLING DRIVER INTERRUPT EVENTS .................................................................................... 85 4.83 ENABLING DRIVER INTERRUPT EVENTS ..................................................................................... 86 4.84 GET DRIVER CHIP ATTRIBUTES.................................................................................................. 86 4.85 CHECK WHETHER A DRIVER ATTRIBUTE IS SET/SELECTED ....................................................... 87 4.86 SET DRIVER EQUALIZER CONTROL OR LINE LENGTH ................................................................ 88 4.87 SET DRIVER EQUALIZER GAIN ................................................................................................... 89 4.88 ENABLING DRIVER LOOPBACK, TRANSMISSION ALL ONES, NETWORK LOOP UP/DOWN, OR RX MONITOR MODE ....................................................................................................................................... 90 4.89 DISABLING DRIVER LOOPBACK, TRANSMISSION ALL ONES, NETWORK LOOP UP/DOWN, OR RX MONITOR MODE ....................................................................................................................................... 91 4.90 RESETTING DRIVER REGISTERS ................................................................................................. 92 4.91 CHECK DRIVER JITTER SETTINGS ............................................................................................... 92 4.92 SET DRIVER JITTER .................................................................................................................... 93 4.93 CHECKING T1 FRAMER .............................................................................................................. 94 4.94 CHECKING E1 FRAMER .............................................................................................................. 96 4.95 CHECKING IF A FRAMER TIME SLOT IS ENABLED ....................................................................... 97 4.96 DISABLING FRAMER INTERRUPTS............................................................................................... 98 4.97 DISABLING FRAME INTERRUPTS SELECTIVELY .......................................................................... 99 4.98 ENABLING ALL FRAME INTERRUPTS ........................................................................................ 100 4.99 ENABLING FRAME INTERRUPTS SELECTIVELY ......................................................................... 101 4.100 GET FRAMER RECEIVE STATUS REGISTER (RSR) OR RECEIVE INTERRUPT MASK REGISTER (RIMR) 102 4.101 GETTING NUMBER OF FRAME ERRORS ..................................................................................... 103 4.102 SET FRAMER ERROR COUNTERS TO A START VALUE ............................................................... 104 4.103 ENABLING FRAMER FEATURES ................................................................................................ 105 4.104 DISABLING FRAMER FEATURES ............................................................................................... 106 4.105 SETTING FRAMER FEATURES ON.............................................................................................. 108 4.106 SELECTING FRAMER FEATURES ............................................................................................... 109 4.107 DESELECTECTING FRAMER CHANNELS .................................................................................... 110 4.108 SELECTING FRAMER TIME SLOTS ............................................................................................. 112 4.109 DESELECTECTING FRAMER TIME SLOTS .................................................................................. 113 4.110 DETECTING RX B8ZS OR COFA ( T1 ONLY ) .......................................................................... 114 4.111 RESYNC FRAMER ..................................................................................................................... 115 4.112 SET FRAMER TX EXTRA, NATIONAL OR INTERNATIONAL BITS (E1 ONLY)............................... 116 4.113 GET FRAMER TX EXTRA, NATIONAL OR INTERNATIONAL BITS (E1 ONLY) .............................. 117 4.114 RETRIEVING TIMESLOT DATA .................................................................................................. 118 4.115 RETRIEVING LATEST TIMESLOT DATA ..................................................................................... 119 4.116 GET DRIVER VERSION .............................................................................................................. 120 4.117 GET API LIBRARY VERSION .................................................................................................... 120 4.118 GET MAXIMUM TIME SLOT NUMBER ....................................................................................... 121 4.119 GET MAXIMUM NUMBER OF DEVICES SUPPORTED BY DEVICE DRIVER ................................... 121 4.120 SETTING ON-HOOK/OFF-HOOK IN A GLOBAL TRANSMIT BUFFER ............................................ 122 4.121 GET RECEIVE LINE FREQUENCY .............................................................................................. 123
IV
4.122 ENABLING RECEIVE AND TRANSMIT BUFFERS ......................................................................... 123 4.123 DISABLING RECEIVE AND TRANSMIT BUFFERS ........................................................................ 124 4.124 TRANSMITTING IDLE CODES .................................................................................................... 125 4.125 FILLING TRANSMIT BUFFER WITH A MULTIFRAME .................................................................. 125 4.126 DISABLING UNFRAMED INPUT ................................................................................................. 126 4.127 ENABLING UNFRAMED INPUT .................................................................................................. 127 4.128 SETTING TX INVERSION MASK ................................................................................................. 127 4.129 SETTING RX INVERSION MASK................................................................................................. 128 4.130 GETTING RX INVERSION MASK ................................................................................................ 128 4.131 GETTING TX INVERSION MASK ................................................................................................ 129 4.132 BIOSTREAM CLASS. STREAM INPUT/OUTPUT........................................................................... 130 4.132.1 Creating and Initializing the Basic Input Output Stream Object (BioStream constructor). 130 4.132.2 Creating and Initializing the Basic Input Output Stream Object (BioStream constructor). 131 4.132.3 Destroying the Basic Input Output Stream Object (BioStream destructor). .................. 131 4.132.4 Set Read Channel Mask. ................................................................................................ 132 4.132.5 Set Write Channel Mask................................................................................................. 132 4.132.6 Set Read Margins in Multiframes. ................................................................................. 133 4.132.7 Set Write Margins in Multiframes.................................................................................. 133 4.132.8 Set Read Margins in Bytes. ............................................................................................ 134 4.132.9 Set Write Margins in Bytes. ........................................................................................... 135 4.132.10 Get Missed Receive Bytes Count.................................................................................... 135 4.132.11 Get Missed Transmit Bytes Count.................................................................................. 136 4.132.12 Read Stream (Receive). .................................................................................................. 136 4.132.13 Write Stream (Transmit). ............................................................................................... 137 4.132.14 Reopen Stream for Receiving......................................................................................... 138 4.132.15 Reopen Stream for Transmitting. ................................................................................... 138 4.132.16 Reopen Stream for Receiving, Transmitting, or both..................................................... 139 4.132.17 Fill Global Transmit Buffers with Idle Code ................................................................. 139 4.132.18 Fill Global Transmit Buffers with Byte String ............................................................... 140 4.132.19 Calculate Channel Mask................................................................................................ 141 4.133 BIOSTREAMEX CLASS. SIGNALING BITS PROCESSING. ............................................................ 142 4.133.1 BioStreamEx Constructor .............................................................................................. 142 4.133.2 Reading Signalling Bits and Data.................................................................................. 143
4.133.2.1 4.133.2.2 4.133.2.3 Signaling Bits Transition Item Structure.................................................................................. 143 Reading Data and Signalling Bits ............................................................................................ 144 Reading Signaling Transitions Only ........................................................................................ 145
Setting Signalling Bits for the Subsequent Signalling or Data+Signalling Transmission 146 4.133.4 Transmit Signalling Bits ................................................................................................ 147 4.133.5 Transmitting Data and Signalling Bits .......................................................................... 147 4.134 SIGBITSASYNCIO CLASS. RECEIVING AND TRANSMITTING SIGNALING BITS ONLY ON MULTIPLE CHANNELS.............................................................................................................................................. 149 4.134.1 SigBitsAsyncIo Constructor ........................................................................................... 149 4.134.2 Opening SigBitsAsyncIo for Singnaling Bits Reading or Writing.................................. 149 4.134.3 Stopping Receiving or Transmitting Signaling Bits ....................................................... 150 4.134.4 Reading Signaling Transitions....................................................................................... 150 4.134.5 Transmitting Signals on All Selected Timeslots ............................................................. 151 4.134.6 Access to BioStreamEx for Accesing Individual Timeslots ............................................ 151 4.134.7 Retrieving Receive Event Handle for Signaling Transitions.......................................... 152 4.134.8 Getting Number of Queued Signaling Transitions......................................................... 152 4.134.9 Getting Number of Skipped Signals ............................................................................... 152 4.134.10 Getting Number of Underruns ....................................................................................... 152 4.135 DETERMINING IF THE RECEIVE THREAD IS ALIVE .................................................................... 153 4.136 BITSTREAM CLASS. SUBCHANNEL INPUT ................................................................................. 154
4.133.3
4.136.1 BitStream Constructors.................................................................................................. 154 4.136.2 Setting Bit Mask ............................................................................................................. 155 4.136.3 Getting Bit Mask ............................................................................................................ 155 4.136.4 Set or Unset Bit Inversion .............................................................................................. 155 4.136.5 Get Inversion Setting...................................................................................................... 156 4.136.6 Resetting Stream ............................................................................................................ 157 4.136.7 Reading Stream.............................................................................................................. 157 4.136.8 Get Payload Bit Count ................................................................................................... 157 4.137 OUTBITSTREAM CLASS. SUBCHANNEL OUTPUT ...................................................................... 158 4.137.1 Constructor .................................................................................................................... 158 4.137.2 Reinitialization of the OutBitStream Instance................................................................ 158 4.137.3 Getting Bit Mask ............................................................................................................ 159 4.137.4 Get Inversion.................................................................................................................. 159 4.137.5 Get Filler for Zero Mask Bits......................................................................................... 159 4.137.6 Write Subchannel Stream............................................................................................... 160 4.138 MSBSTUFFBITS. HDLC BIT STUFFING..................................................................................... 161 4.139 BITREMOVE CLASS. HDLC ZERO BIT REMOVAL .................................................................... 162 4.139.1 BitRemove Constructor.................................................................................................. 162 4.139.2 Remove Stuffed Zero Bits ............................................................................................... 162 4.139.3 Reset Input ..................................................................................................................... 163 4.139.4 Get Statistics .................................................................................................................. 164 4.139.5 Set Counters................................................................................................................... 164 4.139.6 Get Statistics and Reset Counters .................................................................................. 165 4.140 FDLSTREAM CLASS. FACILITY DATA LINK (FDL) INPUT/OUTPUT........................................... 166 4.140.1 Constructor .................................................................................................................... 166 4.141 REINITIALIZE FDLSTREAM ....................................................................................................... 168 4.141.1 Set New Read Subchannel Mask .................................................................................... 169 4.141.2 Set New Write Subchannel Mask ................................................................................... 169 4.141.3 Set Safe Margins for Reading in Multiframes................................................................ 170 4.141.4 Set Safe Margins for Writing in Multiframes................................................................. 170 4.141.5 Set Safe Margins for Reading in Bytes........................................................................... 170 4.141.6 Set Safe Margins for Writing in Bytes............................................................................ 171 4.141.7 Get Used Read Bits per each Four Frames ................................................................... 171 4.141.8 Get Used Write Bits per each Four Frames................................................................... 171 4.141.9 Get Missed Bytes when Reading Underrun Occurrs ..................................................... 172 4.141.10 Get Missed Bytes when Writing Overrun Occurrs......................................................... 172 4.141.11 Reset Stream .................................................................................................................. 172 4.141.12 Read Stream................................................................................................................... 172 4.141.13 Write Stream .................................................................................................................. 173 4.141.14 Reset Input Stream ......................................................................................................... 173 4.141.15 Reset Output Stream ...................................................................................................... 173 4.141.16 Reset Both Input and/or Output Streams ....................................................................... 174 4.141.17 Open for Synchronous Reading ..................................................................................... 174 4.142 MEMFILE CLASS. MEMORY MAPPED INPUT/OUTPUT .............................................................. 175 4.142.1 Constructors................................................................................................................... 175 4.142.2 Reinitialize ( ReOpen) the Object .................................................................................. 176 4.142.3 Close File....................................................................................................................... 176 4.142.4 Return Unused Bytes...................................................................................................... 177 4.142.5 Return Unused Bytes...................................................................................................... 177 4.142.6 Check if File is Open ..................................................................................................... 177 4.143 VARRECBUF CLASS. VARIABLE RECORD BUFFER ................................................................... 177 4.143.1 Constructors................................................................................................................... 178 4.143.2 Initialization................................................................................................................... 178 4.143.3 Close .............................................................................................................................. 178 4.143.4 Append a Record............................................................................................................ 179 4.143.5 Append a Record Consisting of two Parts: Header and Data ....................................... 179
VI
4.143.6 Direct Record Access by Record Number...................................................................... 180 4.143.7 Sequential Access. Get Next Record .............................................................................. 180 4.143.8 Sequential Access. Get Previous Record ....................................................................... 181 4.143.9 Get Number of Records in the Buffer ( List ) ................................................................. 181 4.143.10 Get Memory Size used by Data in the List ..................................................................... 181 4.143.11 Flush MemFile Object Associated with VarRecBuf to Disk........................................... 182 4.143.12 Delete All Records ......................................................................................................... 182 4.144 CLASS DYNAMICLISTBUF. DYNAMIC LIST BUFFER IN CALLER SUPPLIED BUFFER. ................. 182 4.144.1 Constructors................................................................................................................... 182 4.144.2 Assignment Operator ..................................................................................................... 183 4.144.3 Appending a Record....................................................................................................... 183 4.144.4 Getting the First Record ................................................................................................ 183 4.144.5 Getting the Next Record................................................................................................. 184 4.144.6 Erase the List ................................................................................................................. 184 4.144.7 Get Total Size of All Records in the List ........................................................................ 184 4.144.8 Check if the List is Empty............................................................................................... 184 4.144.9 Get Number of Records in the List................................................................................. 185 4.145 CALCULATE CRC FOR HDLC .................................................................................................. 185 4.146 INVERT BYTE(S)....................................................................................................................... 185 4.146.1 Invert Bits In-place ........................................................................................................ 185 4.146.2 Invert a Byte................................................................................................................... 186 4.146.3 Copy Byte String with Inversion .................................................................................... 186 4.147 ASYNCHRONOUS HDLC FRAME PROCESSING .......................................................................... 187 4.147.1 Constructor .................................................................................................................... 187 4.147.2 Starting Transmission or Reception............................................................................... 188 4.147.3 Transmitting Frames...................................................................................................... 189 4.147.4 Receiving Frames .......................................................................................................... 190 4.147.5 Receiving Frames with Extended Frame Information ................................................... 191
4.147.5.1 HdlcFrameInfo......................................................................................................................... 191
4.147.6 Example of Loop Back ................................................................................................... 192 4.147.7 Stopping Receiving or Transmitting .............................................................................. 193 4.147.8 Getting the Rx or Tx Queue Size .................................................................................... 193 4.147.9 Getting Total Number of CRC Errors in Received Frames ........................................... 194 4.147.10 Getting Total Number of Malformed Received Frames ................................................. 194 4.147.11 Get Total Number of UnderRuns or OverRuns.............................................................. 194 4.147.12 Get Number of Discarded Frame Octets ....................................................................... 194 4.147.13 Get Number of Discarded Frames ................................................................................. 195 4.147.14 Setting Minimum Number of Flags Between Frames..................................................... 195 4.147.15 Getting the Minimum Number of Flags Between Frames.............................................. 195 4.148 ENABLING THE SOUND DRIVER ................................................................................................ 196 4.149 DISABLING THE SOUND DRIVER ............................................................................................... 196 4.150 QUERYING IF THE SOUND DRIVER IS ENABLED ........................................................................ 196 4.151 GET APPLICATION INSTANCE COUNT TRANSMITTING ON THE CARD ....................................... 197 4.152 GET APPLICATION INSTANCE COUNT RECEIVING ON THE CARD .............................................. 197 4.153 GET LINE LEVEL VOLTAGE ...................................................................................................... 197 4.154 GET HD CARD FPGA PARAMETERS ........................................................................................ 198 4.155 SET HD CARD FPGA PARAMETERS ......................................................................................... 199 4.156 CHECK IF SEPARATE FDL BUFFERS ARE USED ......................................................................... 200 4.157 GET SEPARATE FDL BUFFERS ADDRESSES .............................................................................. 200 4.158 GET SIGNALING INFORMATION FOR HD CARDS ....................................................................... 201 4.159 GET FIRMWARE VERSION......................................................................................................... 201 4.160 SET TX SIGNALING BITS FOR A TIMESLOT FOR HD CARDS ...................................................... 202 4.161 GET TX SIGNALING BITS FOR A TIMESLOT FOR HD CARDS ..................................................... 202 4.162 GET RX SIGNALING BITS FOR A TIMESLOT FOR HD CARDS ..................................................... 203 4.163 CHECK IF TX SIGNALING BITS FOR A TIMESLOT ARE ENABLED FOR HD CARDS ...................... 203 4.164 CFILECAPTURINGOPERATIONS, PERIODIC FILE SAVING CLASS ............................................... 204
VII
4.164.1 Creating the Periodic File Saving Class........................................................................ 204 4.164.2 Initializing the Periodic File Saving Class Data Members............................................ 204 4.164.3 Initializing the CFileCapturingOperations Data Members ........................................... 206 4.164.4 Opening Files for Capture ............................................................................................. 206 4.164.5 Allocating Memory for Device Information................................................................... 207 4.164.6 Deallocating Device Information................................................................................... 207 4.164.7 Closing the Periodic File Saving Class ......................................................................... 208 4.164.8 Close all Files ................................................................................................................ 208 4.164.9 Periodic File Saving Control Loop................................................................................ 209 4.164.10 Periodic File Saving Control Loop................................................................................ 209 4.164.11 Periodic File Saving Control Loop................................................................................ 210 4.164.12 Clear Messages.............................................................................................................. 210 4.164.13 Initialization of File Saving Object................................................................................ 210 4.164.14 Synchronize Captures .................................................................................................... 211 4.164.15 PeriodicFileSaving I/O Errors....................................................................................... 211 4.165.16 PeriodicFileSaving Disk Usage Limitations ..................................................................... 212 5 INDEX ............................................................................................................................................. 213
VIII
Figures
FIGURE 1. SYSTEM HIERARCHY ...................................................................................................................... 3
Tables
TABLE 1. DEVICE DRIVER FEATURES .......................................................ERROR! BOOKMARK NOT DEFINED. TABLE 2. INITIALIZATION FUNCTIONS ............................................................................................................. 8 TABLE 3. CONFIGURATION FUNCTIONS ......................................................................................................... 10 TABLE 4. MODE FUNCTIONS ......................................................................................................................... 10 TABLE 5. CODEC FUNCTIONS ........................................................................................................................ 11 TABLE 6. PORT I/O FUNCTIONS ..................................................................................................................... 12 TABLE 7. REGISTER FUNCTIONS .................................................................................................................... 12 TABLE 8. BUFFER FUNCTIONS ....................................................................................................................... 13 TABLE 9. DRIVER FUNCTIONS ....................................................................................................................... 15 TABLE 10. FRAMER FUNCTIONS .................................................................................................................... 18 TABLE 11. BER FUNCTIONS .......................................................................................................................... 19 TABLE 12. TIMESLOT FUNCTIONS ................................................................................................................. 20 TABLE 13. PATTERN FILE FUNCTIONS ........................................................................................................... 20 TABLE 14. STREAM INPUT/OUTPUT FUNCTIONS............................................................................................ 21 TABLE 15. MISCELLANEOUS FUNCTIONS ...................................................................................................... 23 TABLE 16. COMPILER DEFINES FOR DIFFERENT CARD TYPES ..................ERROR! BOOKMARK NOT DEFINED. TABLE 17. IMPORT LIBRARY AND DLL NAMES FOR DIFFERENT DEVICES .................................................... 31 TABLE 18. LIBRARY NAMING CONVENTION.................................................................................................. 31 TABLE 19. CONFIGURATION FILES ................................................................................................................ 32 TABLE 20. API LIBRARY EXCEPTIONS .......................................................................................................... 34 TABLE 21. GETFPGA CODES AND PARAMETERS........................................................................................... 198 TABLE 22. SETFPGA CODES AND PARAMETERS ........................................................................................... 199 TABLE 23. GETSIGNALINGINFO CODES AND PARAMETERS .......................................................................... 201
IX
1. Introduction
The GL T1/E1 Application Development Toolkit is an application programming interface (API) library that provides functions to access a wealth of GL Communications T1/E1 features. The toolkit consists of: Device Driver Analyzer Application API library implemented as a DLL Header and import library files This guide and reference manuals Sample code The Application Development Toolkit can be used to develop new applications that use GL Communications T1/E1 cards. The toolkit supports Windows XP and later operating systems and provides C++ class library to access hardware features. Only one application can access cards of the same type. If there are several different types installed, several applications (one per type) can be running simultaneously.
Note: Before one starts developing: 1. Install the devices into the PC as described in GLs users manual 2. Install the corresponding device driver(s) and the basic software provided by the GL Communications Inc. as described in GLs users manual. 3. User provided applications to verify whether hardware and software installation is correct.
T 1 Application
E1 Application
T 1 API Library
E1 API Library
T 1 Device Driver
E1 Device Driver
T 1 Cards
E1 Cards
Function Naming Conventions The toolkit API library functions use the following conventions: function name starts with a verb followed by a function group name and optional descriptive name, for example, CheckDr or ResetDrRegisters the first parameter of member functions is usually a device number starting with one and not exceeding number of installed devices the second parameter is usually a descriptive function name in the function group sharing the same function name time slots specified as a parameter have type BYTE and start from zero function names returning bool start with Check verbs used as the function prefix: Set, Reset, Read, Write, Enable, Disable, Check, Insert, Get, Resync, Select, Deselect, Load function groups: Mode, Codec, Port, Dr, Fr, Ber, Ts, Multi to specify mode, codec, port, driver, framer, bit error rate, timeslots and status function groups accordingly Function Calling Conventions The API library uses standard C++ exception mechanism to handle error conditions. This handling is chosen in favor of error codes because: it produces more robust code makes client code cleaner and easier to understands guaranties that most of the errors are caught at an early development phase provides consistent error recovery mechanisms The following two exception groups are used internally by the API library: enum GlComExceptions interface errors DWORD DriverAndSystemErrors driver and system errors To handle errors properly the client application code using the API library should incorporate code into try {} catch {} blocks.
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Must be first member function called!!! ... } catch (GlComExceptions except) { GlcMsg( "Driver Interface Error", "Exception description: %s", GetExceptionDescription( except ) ); return 11; } catch ( DWORD lastError ) { GlcMsg( "Driver Error", "GetLastError() = %ul", lastError ); return 12; } catch (...) { printf("Unexpected internal error\n"); return 13; }
2 Programmers Guide
This section explains how to use the API library in applications. It does not cover all the details for each function. The functions reference section covers all the details for each particular function. Read Redme.txt file supplied with examples before building the toolkit examples.
int main(int argc, char** argv) { try { GlComInterface Ifc; // Create a device driver interface object Ifc.Initialize(false, GL_CARD_TYPE_DPCI_DMA); // Must be first member // function called!!! // false specifies that hardware settings // will not be initialized BYTE devCount = (BYTE)Ifc.GetNoOfDevicesInstalled(); // devices installed #ifdef _DEBUG GlcEnableDbgMsg( false ); #endif this // By default in DEBUG build all the exceptions // thrown by the API library will be preceeded by // a message box unless explicitly disabled by // function. For console application the message // box is usually inconvenient and can be // suppressed by specifying false as a parameter } catch (GlComExceptions except) // Catch interface exceptions first { printf( "Driver interface error. Exception description: %s\n", GetExceptionDescription( except ) );//Textual description of the exception return 11; } catch ( DWORD lastError ) // Catch device driver error, see WinError.H { printf( "Driver error. GetLastError() = %ul\n", lastError ); return 12; } catch (...) // Other exceptions { printf("Unexpected internal error\n"); return 13; } return 14; }
There is another API library debugging feature that is always enabled. Use functions GlcGetLastErrorMsg() to get internal errors descriptions.
Applications usually do not have to call all the functions directly to initialize the cards. When Initialize(true) or Initialize() (true is the default) is invoked the following functions are called: ReadHardwareConfig LoadDefaultConfig InitializeCodec CheckCard ImplementTxIsr Additionally the true parameter: initializes framer and driver according to the default.cfg file, loads Xilinx file, sets Codec default parameters, initializes time slot assignor and setting mode, checks input/output, memory and interrupts. If Initialize(false) is specified most of the hardware settings remains unchanged: Hardware and default configuration is not loaded Codec and Framer settings remain unchanged Xilinx file is not loaded Mode and timeslot assignment remain unchanged Memory and I/O are not checked
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! ... } catch (GlComExceptions except)
GetMultiFrameSize GetMultiFrameDuration GetIdleCode GetNoOfFramesPerMF GetMultiFrameSize GetMultiFrameDuration GetUsableSoftBufferSize GetNoOfMultiFramesPerSoft Buffer GetProtocolBytesPerMs GetNoOfFramesPerSoftBuffer
Returns multiframe size Returns multiframe duration Returns idle code used for transmission Returns number of frames per multiframe Returns multiframe size Returns duration of multiframe Returns usable software buffer size Returns number of multiframes fit in software buffer Number of bytes transferred per mSec full frame Returns number of frames fit in software buffer
Table 3. Mode Functions One of the following three modes is used: Monitor Terminate Bridge
bool b1; GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!!
10
Ifc.SetMode( SelectedDeviceNo, _SetBridgeMode ); b1 = Ifc.CheckMode ( SelectedDeviceNo, _IsBridgeModeSelected); Ifc.SetMode( SelectedDeviceNo, _SetMonitorMode ); b1 = Ifc.CheckMode ( SelectedDeviceNo, _IsMonitorModeSelected); Ifc.SetMode( SelectedDeviceNo, _SetTerminateMode ); b1 = Ifc.CheckMode ( SelectedDeviceNo, _IsTerminateModeSelected);
GlComInterface Ifc; // Device driver interface object Ifc.Initialize(false, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! /********************************************************************/ /* Get current settings for the current device */ /********************************************************************/ TxTs = Ifc.GetCodec(DevNo, _GetTxTimeslot); // Read this setting from driver RxTs = Ifc.GetCodec(DevNo, _GetRxTimeslot); // Read this setting from driver RxGain = Ifc.GetCodec(DevNo, _GetGainForVfRx ); // Read VF gain for Rx TxGain = Ifc.GetCodec(DevNo, _GetGainForVfTx ); // and TX bSpeaker = Ifc.CheckCodec(DevNo, _IsSpeakerOn ); bInsert = Ifc.CheckCodec(DevNo, _IsVfTxOn ); Ifc.DisableCodec(DevNo, _TurnOffSpeaker ); // If was On set Off Ifc.EnableCodec(DevNo, _TurnOnSpeaker); // If was Off set On Ifc.DisableCodec(DevNo, _TurnOffVfTx ); // If was On set Off Ifc.EnableCodec(DevNo, _TurnOnVfTx); // If was Off set On Ifc.SetCodec( DevNo, _SetRxTimeslot, (BYTE)timeslot ); Ifc.SetCodec( DevNo, _SetTxTimeslot, (BYTE)timeslot ); Ifc.SetCodec( DevNo, _SetGainForVfRx, (BYTE)gain ); Ifc.SetCodec( DevNo, _SetGainForVfTx, (BYTE)gain );
11
Drv%X=%02X RxC%X=%02X TxC%X=%02X\n", SelectedDeviceNo, IoCtlCode, (BYTE)i ), SelectedDeviceNo, _DrReadRegister, (BYTE)i ), SelectedDeviceNo, _ReadRxAudioRegister, (BYTE)i ), SelectedDeviceNo, _ReadTxAudioRegister, (BYTE)i )
12
Description Get driver global receive buffer0 pointer (obsolete) Get driver global receive buffer1 pointer (obsolete) Get driver global transmit buffer0 pointer (obsolete) Get driver global transmit buffer1 pointer (obsolete) Returns receive/transmit global buffers size. Returns running count of transmit software buffers Returns running count of receive software buffers Get driver global receive buffer0 pointer for a device Get driver global receive buffer1 pointer for a device Get driver global transmit buffer0 pointer for a device Get driver global transmit buffer1 pointer for a device Get active global receive buffer pointer Get active global transmit buffer pointer Get inactive global receive buffer pointer Get inactive global transmit buffer pointer Get sequence number of the active receive global buffer Get sequence number of the active transmit global buffer Current driver position in the active global receive buffer Current driver position in the active global xmit buffer Fills transmit buffers with idle code or idle byte strings
13
SetDr EnableDr
Function Name
DisableDr
Description enables network loopback detect, sets transmission all ones, enables inbound network loopback up/down, and enables Rx monitor mode Disables jitter attenuation, disables analog, remote, local or network loopback, disables network loopback detect, resets transmission all ones, and disables inbound network loopback up/down Resets driver registers Checks if the driver jitter is set to 3Hz or 6Hz, whether jitter attenuation is enabled, whether jitter attenuation is set on Rx or Tx Sets jitter to 3Hz or 6Hz, sets jitter attenuation on Rx or Tx Returns number of cards installed and configured
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! bRet = Ifc.CheckDr(SelectedDeviceNo, _DrIsNLoopPerStatusSet); bRet = Ifc.CheckDr( SelectedDeviceNo, _DrIsEsOvrTransitionSet ); bRet = Ifc.CheckDr( SelectedDeviceNo, _DrIsEsUnTransitionSet ); bRet = Ifc.CheckDr( SelectedDeviceNo, _DrIsLosPerStatusSet ); bRet = Ifc.CheckDr( SelectedDeviceNo, _DrIsLosPerStatusSet ); bRet = Ifc.CheckDr( SelectedDeviceNo, _DrIsAisPerStatusSet); Ifc.EnableDr( SelectedDeviceNo, _DrEnableLocalLoopback); Ifc.DisableDr( SelectedDeviceNo, _DrDisableLocalLoopback); Ifc.EnableDr( SelectedDeviceNo, _DrEnableRemoteLoopback); Ifc.DisableDr( SelectedDeviceNo, _DrDisableRemoteLoopback); }
15
CheckFrTimeslotSelectedForTxIdleCo de
DisableFrInterrupts EnableFrInterrupts
16
GetFr GetFrErrorCounter
EnableFr
DisableFr
SetFr
SelectFr
DeselectFr
Description Reads receive status register (RSR) or interrupt mask register (IMR) T1 and E1 Retrieves bipolar error counter T1 only Retrieves out of frame and errorred superframe counters E1 only Retrieves CRC4 and frame error counters T1 and E1 Enables autoresync and local loopback T1 only Enables TxB8ZS, yellow and blue alarms, external S bit, robbed bit signal, external CRC, external FT FPS. E1 only Enables Tx/Rx CRC4 and HDB3, Tx signaling all ones, Tx extra, national and international bits, external signaling bits, unframed all ones, Tx remote alarm, Tx DMA and multiframe start with FAS T1 and E1 Disables autoresync and local loopback T1 only Disables TxB8ZS, yellow and blue alarms, external S bit, robbed bit signal, external CRC, external FT FPS. E1 only Disables Tx/Rx CRC4 and HDB3, Tx signaling all ones, Tx extra, national and international bits, external signaling bits, unframed all ones, Tx remote alarm, Tx DMA and multiframe start with FAS T1 Only Sets zero suppression B7, zero suppression transparent, OOF criteria 2of4 or 2of5 E1 Only Rx/Tx CCS or CAS mode, CAS multiframe sync criteria fixed or not fixed T1 Only Selects yellow alarm D4 B2 or S bit, or yellow alarm ESF FDL or S bit, D4/ESF, SLC96, T1DM, Tx idle code 7F or FF, out data unipolar, outdata NRZ E1 Only Tx 100 or 50 duty cycle T1 Only Deselects all channel for Tx idle code, all channels for transparent and all Rx channels for code insert E1 Only
17
SelectFrTimeslot
DeselectFrTimeslot
DetectFrRx ResyncFr
Description Deselects all timeslots for Tx idle codes T1 and E1 Selects channel for Tx idle code T1 Only Selects channel for transparent or code insert. T1 and E1 Deselects channel for Tx idle code T1 Only Deselects channel for transparent or code insert. T1 Only Detects Rx B8ZS or COFA T1 and E1 Causes forced resync T1 Only Resyncs: Algo10 or Algo24 bits, using FT bits, using FT FA bits, on OOF or OOF RCL E1 Only Resyncs with criteria fixed or not fixed, or CAS multiframe criteria fixed or not fixed Enables unframed input Disables unframed input E1 Only Sets Tx national, international or extra bits Retrieves Tx national, international or extra bits
GlComInterface Ifc; // Device driver interface object Ifc.Initialize(false, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! BYTE DevNo = 1; . . . #if defined (T1) FrameErrors = _Ifc.GetFrErrorCounter( DevNo, TfrGetErroredSuperFrameCounter ); #else //if defined (E1) FrameErrors = Ifc.GetFrErrorCounter( DevNo, _EfrGetFrameErrorCounter ); #endif
18
19
1 2
Used with BER example or drop insert Used with BER example or drop insert 3 Higher level functions maintain time slot usage for transmit direction
20
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! ... #ifdef CARD_V3 Ifc.SetDefaultPatternFileName("T1PASS.BIN"); #else Ifc.SetDefaultPatternFileName("LTPASS.BIN"); #endif } catch (GlComExceptions except) { ... }
Function Name BioStream SetReadChannelMask SetWriteChannelMask SetReadSafeMarginMultiFrames SetWriteSafeMarginMultiFrames SetReadSafeMarginBytes SetWriteSafeMarginBytes GetReadMissedBytesCount GetWriteMissedBytesCount Reset Read Write ReopenRead ReopenWrite Reopen FillTxChannels
Description Initializes and sets read/write channel masks Sets channel mask to read Sets channel mask to write Sets safe margins for reading Sets safe margins for writing Sets safe margins for reading Sets safe margins for writing Bytes missed when client application is too slow (Non-blocking only) when client application is too fast Resets current position and counters Reads T1/E1 channel(s) data Writes T1/E1 channel(s) data Reopens receive stream Reopens transmit stream Reopens both receive and transmit streams Fills channels with idle code or idle byte string
21
// Receive and retransmit received data GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! . BioStream Bs(&Ifc, SelectedDeviceNo, 0xC0000000 ); // Use channels 1 and 2 DWORD WriteSize = 12*24; BYTE Buf[65536]; DWORD XmitLen; Bs.SetWriteSafeMarginBytes( 16*WriteSize ); Bs.SetReadSafeMarginBytes( 0 ); for(;;) { try { XmitLen = Bs.Read( Buf, WriteSize, true ); Bs.Write( Buf, XmitLen, true, true ); } catch (GlComExceptions exception) { printf( "%s missed %d ", GetExceptionDescription( exception ), Bs.GetWriteMissedBytesCount() ); Bs.Reopen(); } }
22
This example reads a continuous stream from several timeslots into an intermediate buffer using the BioStream class and then it uses BitStream class to Extract 56 kbps payload Invert bits MSB to LSB It produces byte output that has integral number of bytes. Consecutive calls to BitStream::Extract assemble leftover bits from the previous call into continuous stream. The OutBitStream class is opposite to BitStream and is used to write to 8 kbps subchannels. This class uses bits from the input buffer to fill in the output buffer according to the subchannel mask. The unused bits are filled with zeroes or ones. To merge subchannels use two OutBitStream objects with non-interleaving subchannel masks and XOR the resulting streams (buffers) byte by byte.
OutBitStream Obs( 0xFE, true ); // 56 kbps, invert OutLen = Obs.Put( pBuf, BufLen, pOutBuf, OutLen ); // Get bits from pBuf and // put into pOutBuf stream
23
HDLC Decoding uses BitRemove class. This class not only decodes HDLC frames but also gathers statistics and timing information.
// BitRemove Br; Br.parse( pInpBuf, InputBufLen, pOutBuf, OutBufLen ); BrOutputList* pList = (BrOutputList*)( pOutBuf ); BrOutputFrame* pFr = &pList->OutputFrames; TotalFrCount += pList->pFrameCount + pList->pErrFrameCount; DWORD Time = pFr->TotalInputBytesBeforeFrame * 125 / Channels; // Time in mkS while ( bNotEndOf Frames ) { BrOutputFrame* pFrame = pFr; size_t len = pFrame->Length; if ( pFrame->bOkFrame) { BYTE Crc[2]; CalculateCrc( pFrame->Data, len, Crc ); if ( Crc[0] == 0xE2 && Crc[1] == 0xF0 ) Trec.ErrorFlag = 0; else Trec.ErrorFlag = ErrorFlagCrc; } pFr = (BrOutputFrame*)&(pFr)->Data[pFr->Length]; // Next frame }
24
The BitRemove::parse produces a list of output frames in the buffer supplied by the client application. Each frame has an error flag indicating that frame has a correct or erroneous encoding. Client must call CalculateCrc function to verify FCS field. The best way to iterate through frames is:
pFr = (BrOutputFrame*)&(pFr)->Data[pFr->Length]; // Next frame
For D4 format ( 193s) the FdlStream class allows to read and write Ft and Fs (terminal and system framing ) bits.
// Reading GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! Ifc.SelectFr( DevNo, _TfrSelectEsf); Ifc.LoadIntFpga( DevNo, "LTFDLX.BIN" ); // Necessary to enable FDL feature !!! FdlStream Fdl( &Ifc, DevNo, FdlEsfMaskData, 0 ); // FDL channel, read only DWORD SafeReadMargins = 3 * 32; Fdl.SetReadSafeMarginBytes( SafeReadMargins ); // Optional // To sync multiple cards for(all cards) { Fdl.SyncOpenRead(); } Fdl.Read( pBuf, BufLen ); // Ifc.LoadIntFpga(DevNo, "LTPASS.BIN"); // Restore Xilinx when done with FDL !!!
// Writing GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! Ifc.SelectFr( DevNo, _TfrSelectEsf); Ifc.LoadIntFpga( DevNo, "LTFDLX.BIN" ); // Necessary to enable FDL feature !!! FdlStream Fdl( &Ifc, DevNo, 0, FdlEsfMaskData ); // FDL channel, write only Fdl.Write(pBuf, BufLen ); Ifc.LoadIntFpga(DevNo, "LTPASS.BIN"); // Restore Xilinx when done with FDL !!!
25
When writing FPS or CRC bits some extra setup is required to enable these operations normally done by hardware.
// Writing GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! Ifc.SelectFr( DevNo, _TfrSelectEsf); Ifc.LoadIntFpga( DevNo, "LTFDLX.BIN" ); // Necessary to enable FDL feature !!! FdlStream Fdl( &Ifc, DevNo, 0, FdlEsfMaskFps ); // write frame pattern sequence Ifc.EnableFr( DevNo, _TfrEnableExternalFtFps ); // Required to write FPS !!! Fdl.Write(pBuf, BufLen ); // When done DisableFr(DevNo, _TfrDisableExternalFtFPS); // Enable hardware FPS writing Ifc.LoadIntFpga(DevNo, "LTPASS.BIN"); // Restore Xilinx when done with FDL !!!
26
// Writing MemFile m_MemFile; VarRecBuf m_VrBuf; m_MemFile.Init( (LPCTSTR)m_szFileName, m_BufSize, m_pBuffer, true ) // R/W open will open file and return mapped memory in m_pBuffer DWORD Offs = offsetof(FileHeader,VarRecords); m_VrBuf.Init( m_pBuffer+Offs, m_BufSize-Offs); RecCnt = m_VrBuf.AddTwoPartRecord( (PBYTE)&Header, sizeof(Header), pFrameData, FrameLen ); // Assemble record from two parts // m_MemFile.Flush(); // Call this function when you want to take over control // when updated data is flushed to disk, normally Windows do it automatically m_MemFile.SetEndOfFile( offsetof(FileHeader,VarRecords) + m_VrBuf.GetUsableSize() ); // Truncate file to get rid of unused // bytes before closing file m_MemFile.Close(); m_VrBuf.Close();
27
2.25 C Interface
In addition to the GlComInterface, a C version of GlComInterface is available. This interface is called CGlComInterface, and it behaves no differently than the normal GlComInterface with the exception of a few changes. Rather than creating a CGlComInterface object and calling member functions from it (a feature not available in C), once the CGlComInterface object is created, functions are called without a host object prefix. Only one CGlComInterface object can be used in an application. Since there can only be one CGlComInterface object, the functions are performed on the created object. As with GlComInterface, to use API library the CGlComInterface object must be created and initialized. Only one CGlComInterface object can be used in an application. This object controls all the cards of the corresponding type installed on the machine. Multiple applications cannot control the same type of cards, the application that starts first seizes controls over the cards and the next applications will not. Furthermore, if another application is already using the cards, the exception ExceptCardsInUse will be thrown and it should be handled by the application. If multiple types of cards are installed on the system, several applications can run concurrently, each handling different type(s) of cards.
Always destroy CGlComInterface object while exiting application. Failing to do so will make devices inaccessible for future use till the system is rebooted. Do not stop debugger while using CGlComInterface, the debugger will terminate the process leaving the object CGlComInterface running.
try { CreateCGlComInterface(); // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! ... DestroyCGlComInterface() } // Object NOT destroyed automatically when // leaving the scope. Must do explicitly.
28
// Device driver interface object // Must be first function called after // object creation!!! // false specifies that hardware settings // will not be initialized BYTE devCount = GlGetNoOfDevicesInstalled(); // devices installed #ifdef _DEBUG // By default in DEBUG build all the exceptions CGlcEnableDbgMsg( false ); // thrown by the API library will be preceeded by #endif // a message box unless explicitly disabled by //this function. For console application the // messagea box is usually inconvenient and can be // suppressed by specifying false as a parameter } catch (GlComExceptions except) // Catch interface exceptions first { printf( "Driver interface error. Exception description: %s\n", GetCExceptionDescription( except ) );//Textual description of the exception return 11; } catch ( DWORD lastError ) // Catch device driver error, see WinError.H { printf( "Driver error. GetLastError() = %ul\n", lastError ); return 12; } catch (...) // Other exceptions { printf("Unexpected internal error\n"); return 13; } return 14; }
29
DWORD CardType = GL_CARD_TYPE_DPCI_DMA; // can be only used with HD boards, or else an exception
2.
PeriodicLoadData perhd; // initialization data CFileCapturingOperations filecap; // periodic filesaving object GlComInterface Ifc; if (inifile.ReadIniFile(argv[1], perhd) == true)// read settings from ini file which is supplied as // commandline argument { Ifc.Initialize(!perhd.initialization, CardType); // initialize card }
3.
CapMsgs notifies the user of capture status ProcessFileSavingFlags performs the actual process of capturing data and writing to file 4. Closing the object and the sequential files
filecap.CloseAllPeriodicFiles(); // close periodic files
The initialization file, which is invoked as an argument on the commandline, consists of the following settings:
// framingformat options - D4, ESF (T1), CAS, CCS, CASCRC, CCSCRC (E1) FRAMINGFORMAT=CasCRC // cards #1, #2, and #3 DEVICEMASK = 1-3 // 0 - if sequential, 1 - if date/time FILENAMETYPE = 0 SEQFILENAMEPREFIX = temp // tsmask - timeslots selected, for example, valid input for timeslots can be something // like "1-5,11,13-14,19" TSMASK=5-31 // filenames will have the sequence temp000, temp001, , temp999 SEQFILENAMEDIGITS=3 SEQFILENAMESUFFIX=.PCM DATETIMEFILENAMESUFFIX = .PCM // %Y year, %M month, %D day, %H hour of day, %I - minute DATETIMEFILENAMEMASK = %Y%M%D_%H%I // 0 - bytes, 2 time SAVELIMITTYPE = 0 // if based on time, use 05:25 for 5 hours, 25 minutes SIZECOUNTLIMIT = 234333 // time limit in nanoseconds, 360,000,000,000 ns is 360 seconds TIMELIMIT = 360000000000 // RecycleType, 0 - Keep n latest files, 1 - stop after n files, 2 - unrestricted RECYCLETYPE = 2 RECYCLEFILECOUNT = 7FFFFFFF // where captured files are stored FILEDIRECTORY = g:\sequentialfiles // ignore ENABLEFILTER = off
30
3.1 Linker
The API library import library for the API DLL must be linked with the application. The import library names end with D for debug and have no D at the end for release versions. HD, USB, Universal, tProbe T1 HD, USB, Universal, tProbe E1
GlcIfcT1.lib and GlcIfcT1.dll - release, GlcIfcTd.lib and GlcIfcTd.dll - debug GlcIfcE1.lib and GlcIfcE1.dll - release, GlcIfcEd.lib and GlcIfcEd.dll - debug
Table 15. Import Library and DLL Names for Different Devices The naming convention is described in the following table. Compiler Prefix Debug/Release GlcIfc for HD, USB, D debug Universal and tProbe Table 16. Library Naming Convention
31
32
33
Exception ExceptAssert ExceptDriverNotOpen ExceptNotInitialized ExceptInvParm1 ExceptInvParm2 ExceptInvParm3 ExceptInvParm4 ExceptInvParm5 ExceptInvParm6 ExceptInvDeviceIndex ExceptCardsInUse ExceptCheckCardIo ExceptCheckCardMemory ExceptLoadDefaultConfig ExceptAltBufferNotAvailable ExceptOpenFile ExceptCreateObj ExceptDeadlockTimeout
Reason Assertion failed Driver is not open Driver is not initialized Invalid parameter 1 Invalid parameter 2 Invalid parameter 3 Invalid parameter 4 Invalid parameter 5 Invalid parameter 6 Device number exceeds number of installed devices Another application uses the driver Card I/O is not operating properly Card memory read/write does not return correct data Loading default configuration failed Alternative buffer is not available Error opening a file Error creating an object API library deadlock timed out
Table 18. API Library Exceptions Additionally to these exceptions the API library throws exception of type DWORD when the system call to the device driver returned an error. The value of this exception is the returned value of GetLastError(). Application should use the try {} catch {} blocks to handle the possible hardware and configuration errors properly.
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(true, GL_CARD_TYPE_DPCI_DMA); // Must be 1st function called!!! ... } catch (GlComExceptions except) { GlcMsg( "Driver Interface Error", "Exception description: %s", GetExceptionDescription( except ) ); return 11; } catch ( DWORD lastError ) { GlcMsg( "Driver Error", "GetLastError() = %ul", lastError ); return 12; } catch (...) { printf("Unexpected internal error\n"); return 13; }
34
C++ C
Parameters: bool bEnable if true enables, otherwise disables diagnostic error message boxes Returns: Nothing
Its recommended not to disable the diagnostic messages for the GUI applications. For console applications the diagnostic messages may be placed by system on the task bar and some users may prefer to disable them while debugging applications. The diagnostic messages are not displayed in the RELEASE builds.
#ifdef _DEBUG GlcEnableDbgMsg( false ); #endif // Disable MsgBoxes in debugging mode
C++ C
Parameters: None Returns: Bool true if the diagnostic messages are enabled (default), false otherwise
#ifdef _DEBUG GlcEnableDbgMsg( false ); // Disable MsgBoxes in debugging mode bool bDiagnostic = CheckGlcEnableDbgMsg(); // is set to false GlcEnableDbgMsg( true ); bDiagnostic = CheckGlcEnableDbgMsg(); // is set to true #endif
35
C++ C
void GlcMsg(LPCTSTR pszTitle, LPCTSTR pszFormat, ... ); void CGlcMsg(LPCTSTR pszTitle, LPCTSTR pszFormat, ... );
Parameters: LPCTSTR pszTitle message box caption (title) LPCTSTR pszFormat formatting string for the message box text identical to the printf formatting string. ... arguments for the formatting string Returns: Nothing
DWORD dw = GetLastError(); GlcMsg("System Error","%s failed. GetLastError returned %u\n",lpszFunction,dw );
4.5 Display Message Box Using printf Formatting in DEBUG Builds Only.
This function simplifies displaying message boxes using formatting strings identical to printf formatting strings in DEBUG builds and does nothing in RELEASE builds.
C++ C
Parameters: LPCTSTR pszTitle message box caption (title) LPCTSTR pszFormat formatting string for the message box text identical to the printf formatting string. ... arguments for the formatting string Returns: Nothing 36
4.6 Format and Display Critical Error Message Box and Throw an Exception.
This function formats error message and appends GetLastError() information in DEBUG builds only. Then it throws a DWORD exception using throw (DWORD)GetLastError();
C++ C
Parameters: LPCTSTR pszTitle dialog box caption, if pszTitle == NULL the default Critical Error is used. LPCTSTR pszFormat formatting string identical to printf formatting string ... parameters for printf formatting string Returns: Nothing
GlcCriticalMsg( "GlComInterface::OpenVxD", "%s Device Driver not found/loaded.", DeviceDriverName );
37
4.7 Format Error Message Box in DEBUG Builds only. Append GlComExceptions Textual Description and Throw a GlComExceptions Exception.
This function formats and display message in DEBUG builds only and throws GlComExceptions exception in DEBUG and Release builds. It appends the textual description of the exception to the formatting string passed in the parameters. C++ void throwDebug(GlComExceptions Exception, LPCTSTR pszTitle, LPCTSTR pszFormat, ... ) N/A C Parameters: GlComExceptions Exception exception to throw (both DEBUG and RELEASE) LPCTSTR pszTitle message box capture (title), ignored in RELEASE builds LPCTSTR pszFormat - printf formatting string, ignored in RELEASE builds ... printf formatting string Returns: Nothing
throwDebug( exception, "Error", "GlComInterface::LoadDefaultConfig Cannot process configuration file \"%s\"", pszDefFileName );
Parameters: GlComExceptions exception exception number to get description for Returns: LPCTSTR textual description 38
try { GlComInterface Ifc; Ifc.Initialize( false ); . . . // Device driver interface object // Do not set default hardware settings
} catch (GlComExceptions exception) { printf( "Driver interface error. Exception description: %s\n", GetExceptionDescription( exception ) ); return 11; } catch ( DWORD lastError ) { printf( "Driver error. GetLastError() = %lu\n", lastError ); return 12; } catch (...) { printf("Unexpected internal error\n"); return 13; } return 14; }
Use this function to include useful information into error messages for API Library errors.
This function should be used when the GlComInterface::Initialize() fails and in some other cases to find out the reason for an internal error. Usually the reason is in the incorrect hardware or device driver configuration and missing configuration files.
39
try { GlComInterface Ifc; // Device driver interface object // Do not set default hardware settings Ifc.Initialize( false, GL_CARD_TYPE_DPCI_DMA ); . . .
} catch (GlComExceptions exception) { printf( "Driver interface error. Exception description: %s\n", GetExceptionDescription( exception ) ); return 11; } catch ( DWORD lastError ) { printf( "Driver error. GetLastError() = %lu\n", lastError ); return 12; } catch (...) { printf( "Last error: %s\n", GlcGetLastErrorMsg() ); printf("Unexpected internal error\n"); return 13; } return 14; }
C++ C
Parameters: None Returns: bool true if object was created, otherwise false
// Device driver interface object // Must be first function called after object // creation! // Object NOT destroyed automatically when // leaving the scope. Must do explicitly.
DestroyCGlComInterface
40
C++ C
// Device driver interface object // Must be first function called after object // creation! // Object NOT destroyed automatically when // leaving the scope. Must do explicitly.
CreateCGlComInterface
C++ C
Parameters: None Returns: bool true if CGlComInterface object exists, otherwise false
// Device driver interface object // Must be first function called after object // creation! // Object NOT destroyed automatically when // leaving the scope. Must do explicitly.
DestroyCGlComInterface
41
C++ C
Parameters: int Index 0 relative device index. Returns: DevicePtr pointer to the device driver information structure defined in w32if.h
typedef struct DeviceShare { DWORD PPBaseAddr; DWORD PPIrq; DWORD MemoryAddr; DWORD NoOfFramesPerMF; DWORD BufferSize; Application DWORD buffer DWORD DWORD DWORD DWORD DWORD DWORD //DWORD DWORD DWORD DWORD DWORD DWORD DWORD DWORD } // parallel port base address // parallel port IRQ // memory address // Software buffer shared by VxD and // Max multiframe index in global // // // // // // // // // // // // // // Total no transmitted multiframes Byte offset into current buffer Current active global buffer Total global buffers received Start Channel End Channel Points to Software Rx Buffers Max multiframe index in glb buffer Total no received multiframes Byte offset into current buffer Current active global buffer Total global buffers received Start Channel End Channel
MaxNoOfTxMultiframes; NoOfTxMultiframesCount; TxCurrentPosition; TxActiveBuffer; NoOfTxBuffersFilledCount; TxStartChannel; TxEndChannel; ptrGlobalRxBuffer[2]; MaxNoOfRxMultiframes; NoOfRxMultiframesCount; RxCurrentPosition; RxActiveBuffer; NoOfRxBuffersFilledCount; RxStartChannel; RxEndChannel;
DWORD RxActiveBuf = Ifc.GetMultiSharedDevicePtr( SelectedDeviceNo-1)->RxActiveBuffer; if ( m_TrackSoftBuffer < RxActiveBuf ) { if ( m_TrackSoftBuffer != RxActiveBuf - 1 ) { MissingBytes += NoOfSamplesPerTs * TsCount * ( RxActiveBuf - 1 - m_TrackSoftBuffer ); printf("Missing Bytes: %d Bytes\n", MissingBytes); } }
42
Parameters: LPCTSTR pszFileName default file pattern name to set Returns: bool true if set OK, false if fails
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . Ifc.SetDefaultPatternFileName("T1PASS.BIN"); }
Parameters: int Index 0 relative device index Returns: LPCTSTR current pattern file name 43
Parameters: int Index zero relative device index LPCTSTR pszFileName pattern file name Returns: bool true OK, false failure
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . Ifc.SetCurrentPatternFileName(DeviceNo-1, pszFilename); }
Parameters: BYTE DeviceNo Returns: BYTE* pointer to the active receive buffer GetActiveTxBufPtr, GetPrevRxBufPtr, GetPrevTxBufPtr, GetRxActiveBufferNumber, GetRxActiveBufferOffs, GetTxActiveBufferNumber GetTxActiveBufferOffs - one relative device number
44
The device driver uses pairs of receive and transmit buffers to optimize the application interface performance. When the device driver is processing an active buffer the application can safely access the alternative buffer. When the device driver is finished with a buffer it switches to the alternative buffer. It takes approximately one second for device driver to process a global buffer.
Parameters: BYTE DeviceNo Returns: BYTE* pointer to the active transmit buffer GetActiveRxBufPtr, GetPrevRxBufPtr, GetPrevTxBufPtr, GetRxActiveBufferNumber, GetRxActiveBufferOffs, GetTxActiveBufferNumber GetTxActiveBufferOffs
The device driver uses pairs of receive and transmit buffers to optimize the application interface performance. When the device driver is processing an active buffer the application can safely access the alternative buffer. When the device driver is finished with a buffer it switches to the alternative buffer. It takes approximately one second for device driver to process a global buffer.
45
Parameters: BYTE DeviceNo Returns: DWORD offset in the active transmit buffer GetActiveRxBufPtr, GetActiveTxBufPtr, GetPrevRxBufPtr, GetPrevTxBufPtr, GetRxActiveBufferNumber, GetRxActiveBufferOffs, GetTxActiveBufferNumber - one relative device number
Parameters: BYTE DeviceNo Returns: BYTE* pointer to the inactive receive buffer - one relative device number
46
The device driver uses pairs of receive and transmit buffers to optimize the application interface performance. When the device driver is processing an active buffer the application can safely access the alternative buffer. When the device driver is finished with a buffer it switches to the alternative buffer. It takes approximately one second for device driver to process a global buffer.
Parameters: BYTE DeviceNo Returns: BYTE* pointer to the inactive transmit buffer GetActiveRxBufPtr, GetActiveTxBufPtr, GetPrevRxBufPtr, GetRxActiveBufferNumber, GetRxActiveBufferOffs, GetTxActiveBufferNumber GetTxActiveBufferOffs
The device driver uses pairs of receive and transmit buffers to optimize the application interface performance. When the device driver is processing an active buffer the application can safely access the alternative buffer. When the device driver is finished with a buffer it switches to the alternative buffer. It takes approximately one second for device driver to process a global buffer.
47
C++ C
Parameters: BYTE DeviceNo Returns: DWORD sequence number of the current receive global buffer GetActiveRxBufPtr, GetActiveTxBufPtr, GetPrevRxBufPtr, GetPrevTxBufPtr, GetRxActiveBufferOffs, GetTxActiveBufferNumber GetTxActiveBufferOffs
This function returns the number of global buffers received and this number should change in normal receive conditions each second
C++ C
Parameters: BYTE DeviceNo Returns: DWORD sequence number of the current transmit global buffer GetActiveRxBufPtr, GetActiveTxBufPtr, GetPrevRxBufPtr, GetPrevTxBufPtr, GetRxActiveBufferNumber, GetRxActiveBufferOffs, GetTxActiveBufferOffs - one relative device number
48
This functions returns number of global buffers transmitted and this number should change in normal receive conditions each second
C++ C
C++ C
void FillTxGlobalBuffers( BYTE DeviceNo, BYTE FillerByte ); void GlFillTxGlobalBuffers( BYTE DeviceNo, BYTE FillerByte );
- one relative device number - idle code value to use for filling in both global transmit buffers
49
50
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . BYTE devCount = Ifc.GetNoOfDevicesInstalled(); for (BYTE DevNo=1; DevNo <= devCount; DevNo++) Ifc.EnableDr( DevNo, _DrEnableNetworkLoopbackDetect ); }
51
Parameters: None Returns: int number of devices found during driver initialization
This is a backward compatibility function. Use GetNoOfDevicesInstalled() to obtain the number of installed and configured devices on the system.
GetNoOfDevicesInstalled
52
The device driver uses pairs of receive and transmit buffers to optimize the application interface performance. When the device driver is processing an active buffer the application can safely access the alternative buffer. When the device driver is finished with a buffer it switches to the alternative buffer. It takes approximately one second for device driver to process a buffer.
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . int TsCount = EndTs - StartTs +1; int NoOfSamplesPerTs = BufferSize / NoOfChannels; DWORD RxActiveBuf = Ifc.GetMultiSharedDevicePtr(SelectedDeviceNo-1)>RxActiveBuffer; PBYTE pGlobalBuffer; DWORD BytesToWrite; if ( m_TrackSoftBuffer < RxActiveBuf ) { //m_ProgressBar.StepIt( ); if ( m_TrackSoftBuffer != RxActiveBuf - 1 ) { MissingBytes += NoOfSamplesPerTs * TsCount * ( RxActiveBuf - 1 - m_TrackSoftBuffer ); printf("Missing Bytes: %d Bytes\n", MissingBytes); } m_TrackSoftBuffer = RxActiveBuf; BYTE *pTempBuf; if( m_TrackSoftBuffer & 0x00000001 ) pGlobalBuffer = Ifc.GetMultiRxGlobalBuffer0(SelectedDeviceNo-1); else pGlobalBuffer = Ifc.GetMultiRxGlobalBuffer1(SelectedDeviceNo-1); for (int i = 0; i < NoOfSamplesPerTs; i++ ) { pTempBuf = pGlobalBuffer + i*NoOfChannels + StartTs; memcpy( &pData[i * TsCount], pTempBuf, TsCount ); // Copy next ts range } // Check if we are over the limit BytesToWrite = NoOfSamplesPerTs * TsCount; if (bLimited && TotalWritten + BytesToWrite > BytesCnt) BytesToWrite = BytesCnt - TotalWritten; TotalWritten += fwrite( pData, 1, BytesToWrite, fh ); } } // end try
53
Parameters: int DeviceNumberToBeSelected one relative device number to be selected Returns: int device number selected
C++ C
BYTE GlGetIdleCode();
54
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . PBYTE pTempBuf; if ( bSendIdle ) for( i = 0 ; i < NoOfSamplesPerTs; i++ ) { pTempBuf = Ifc.GetMultiTxGlobalBuffer0(SelectedDeviceNo-1) + i*NoOfChannels + StartTs; memset( pTempBuf , Ifc.GetIdleCode(), TsCount ); pTempBuf = Ifc.GetMultiTxGlobalBuffer1(SelectedDeviceNo-1) + i*NoOfChannels + StartTs; memset( pTempBuf , Ifc.GetIdleCode(), TsCount ); } }
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: int number of frames per multiframe
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . #ifdef T1 if (Ifc.GetNoOfFramesPerMF(1) == 12) // check for framing format num_sigbits = 2; else num_sigbits = 4; #endif }
55
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: int multiframe size in bytes
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: float multiframe duration in ms (1/1000 sec)
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . MultiFrameTime = Ifc.GetMultiSharedDevicePtr(DeviceIndex)->NoOfRxMultiframesCount * Ifc.GetMultiFrameDuration(DeviceIndex + 1); }
56
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: int buffer size in bytes
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . BufferSize = Ifc.GetUsableSoftBufferSize(SelectedDeviceNo); assert ( pData = new BYTE[(BufferSize / NoOfChannels)*(EndTs - StartTs +1)] ); if ( fh = fopen(szFileName, "w" ) ) bCapturing = true; ... // start capturing to the file }
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: int number of multiframes fit in software buffer
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . SignalingBufferSize = Ifc.GetNoOfMultiFramesPerSoftBuffer(1) * NoOfChannels * DeviceCount; // size of signaling storage }
57
GetNoOfFramesPerSoftBuffer
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: int number of frames fit in software buffer
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize( false ); // Do not set default hardware settings . . . FramesCnt = Ifc.GetNoOfFramesPerSoftBuffer(CurrentSelDev); }
GetNoOfMultiFramesPerSoftBuffer
C++ C
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: int 0 if global transmit buffer 0 is active, 1 if global transmit buffer 1 is active
58
GetActiveRxSoftBuffer
C++ C
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: int 0 if global receive buffer 0 is active, 1 if global receive buffer 1 is active GetActiveTxSoftBuffer
59
C++ C
void Initialize(bool bInitializeHardware = true, DWORD CardType=0 ); void Initialize(bool bInitializeHardware, DWORD CardType);
Parameters: bool bInitializeHardware (default true for C++) initializes hardware (see notes) DWORD CardType Numerical value of GL Communications card type The CardType parameter must be set to: GL_CARD_TYPE_DPCI_DMA for HD PCI cards GL_CARD_TYPE_USB for USB cards GL_CARD_TYPE_UNIV for Universal cards GL_CARD_TYPE_USB_NG for tProbe cards Returns: Nothing.
If driver or hardware are not setup correctly or configuration files (*.bin and *.cfg) are missing in the application directory, an exception will be thrown.
The driver interface initialization: opens the device driver selects device creates global transmit and receive memory buffers initializes the device driver reads hardware configuration file
If parameter bInitializeHardware == true the function also initializes onboard 8255 chip loads FPGA initializes codec turns off VF output and speaker sets default codec transmit and receive gain checks card memory and input/output writes timeslot assigner and sets terminate mode refreshes framer information
60
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing. Throws an exception if checking fails.
Calls CheckCardIo(DeviceNo) and CheckCardMemory(DeviceNo) to check I/O and card memory.
CheckCardIo, CheckCardMemory
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing. Throws an exception if checking fails.
Writes framer register, reads it back and then compares data
61
CheckCardMemory, CheckCard
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing. Throws an exception if checking fails.
sets inward loopback of the framer chip, then writes one multiframe, reads it back and then compares data
CheckCardIo, CheckCard
62
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing. Throws an exception if fails.
4.49 Initialize IRQ, Memory Offset and Base Address (Internal Function)
Initializes IRQ, memory offset and base address using data from the HARDWARE.CFG file. C++ bool ReadHardwareConfig();
bool GlReadHardwareConfig();
63
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing.
This function is invoked in GlComInterface::Initialize when the initialize hardware parameter is set to true.
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) char Port port to read from. Valid values are A, B, C. This parameter is not case sensitive, therefore a, b and c can also be specified. Returns: BYTE data byte read from the port specified by the Port parameter.
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . for (cPort='A'; cPort <='C'; cPort++) printf("Port%c= %02X ", cPort, Ifc.ReadPort( SelectedDeviceNo, cPort ) ); }
WritePort
64
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) char Port port to write to. Valid values are A, B, C. This parameter is not case sensitive, therefore a, b and c can also be specified. BYTE data byte to write to the port specified by the Port parameter. Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #ifdef T1 if ( strNewPattern == "LTSTAT.BIN" || _bUnframed ) _bDs0SelectionEnabled = false; // Disable selection 56k/64k else _bDs0SelectionEnabled = true; // Enable selection 56k/64k if (_bDs0_56) { _pIfc->WritePort(_DevNo, 'B', _pIfc->ReadPort(_DevNo, 'B') | 0xC0 ); // Make TLINKERRS and TABCDERR1 HIGH Sleep(10); _pIfc->WritePort(_DevNo, 'B', _pIfc->ReadPort(_DevNo, 'B') & 0x3F ); //Make TLINKERRS and TABCDERR1 low } #endif }
ReadPort
65
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) LPCTSTR pszFilename file name to load data from Returns: bool - true success, false failure
This function is invoked in GlComInterface::Initialize when the initialize hardware parameter is set to true to load default patterns. Xilinx file name specified in the parameter pszFilename is saved as the current pattern file name.
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . // changing patterns if( (strNewPattern == "T1STAT.BIN") || (strNewPattern == "E1STAT.BIN") || (strNewPattern == "LTSTAT.BIN") || (strNewPattern == "LESTAT.BIN") || (strNewPattern == "LTCSU.BIN") || (strNewPattern == "LECSU.BIN") || (strNewPattern == "LEUCSU.BIN") || (strNewPattern == "LEUSTAT.BIN") ) { #ifdef E1 _pIfc->ResetCodec( _DevNo, _ResetCasf ); #endif _pIfc->LoadStaticBerIntFpga(_DevNo, strNewPattern.c_str(),_StaticPatBits ); } else _pIfc->LoadIntFpga( _DevNo, strNewPattern.c_str() ); }
66
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) LPCTSTR pszFilename file name to load data from unsigned long StaticBits static bits Returns: bool - true success, false failure
Xilinx file name specified in the parameter pszFilename is saved as the current pattern file name.
67
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies an event to wait for: _WaitForStartOfRmSync to wait for RMSYNC _WaitForStartOfTmo - to wait for TMO Returns: Nothing
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) BYTE DataByte filler byte WORD MultiframeSize multiframe size Returns: Nothing
68
C++ C
bool CheckMode(BYTE DeviceNo, DWORD IoCtlCode ); bool GlCheckMode(BYTE DeviceNo, DWORD IoCtlCode );
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies a mode to check _IsTerminateModeSelected _IsBridgeModeSelected _IsMonitorModeSelected Returns: bool - true the mode specified by IoCtlCode parameter is set, otherwise it returns false
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . if (Ifc.CheckMode ( SelectedDeviceNo, _IsTerminateModeSelected) ) { mode = ModeTerminate; pszMode = "Terminate"; } else if (Ifc.CheckMode ( SelectedDeviceNo, _IsBridgeModeSelected) ) { mode = ModeBridge; pszMode = "Bridge"; } else //(Ifc.CheckMode ( SelectedDeviceNo, _IsMonitorModeSelected) ) { mode = ModeMonitor; pszMode = "Monitor"; }
SetMode
69
C++ C
void SetMode(BYTE DeviceNo, DWORD IoCtlCode ); void GlSetMode(BYTE DeviceNo, DWORD IoCtlCode );
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies a mode to set _SetTerminateMode _SetBridgeMode _SetMonitorMode Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.SetMode( SelectedDeviceNo, _SetMonitorMode ); }
CheckMode
This function is invoked in GlComInterface::Initialize when the initialize hardware parameter is set to true to set the default mode Terminate.
70
BYTE Timeslot zero relative timeslot number. When START (bStart == true) is specified this parameter specifies the first timeslot in the timeslot range. When STOP (bStart == false) is specified this parameter should be LastTimeSlot + 1. bool bStart true to start, false to stop Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . WriteTsAssigner( DeviceNo, 0, true ); // start WriteTsAssigner( DeviceNo, NoOfChannels, false ); // stop (last+1) }
Always use pairs of functions, one with bStart = true and another with bStart = false to specify the timeslot range for the timeslot assigner. Use WriteTsAssignerRange ( BYTE DeviceNo, BYTE StartTimeslot, BYTE StopTimeslot ) to specify the range in one call instead of two calls to WriteTsAssigner.
WriteTsAssignerRange
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) BYTE StartTimeslot zero relative start timeslot number. BYTE StopTimeslot zero relative stop timeslot number. This parameter should be LastTimeSlot + 1.
71
Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings // Assign all timeslots WriteTsAssignerRange( DeviceNo, 0, NoOfChannels ); // 0..(NoOfChannels-1) }
If you need to specify the range 0..5 call WriteTsAssignerRange( DeviceNo, 0, 6);
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies type of register to write to _WriteRxAudRegi writes to a receive audio register _WriteTxAudRegi writes to a transmit audio register _drWriteRegister writes to a driver register _frWriteRegister writes to a framer register (T1 only) _E1frWriteRegister writes to a framer register (E1 only) BYTE RegiNo specifies the register number BYTE Data data to write to the register Returns: Nothing
72
ReadRegister
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies type of register to write to _SetRxTimeslot set receive time slot _SetTxTimeslot set transmit time slot _SetGainForVfRx set gain for receive in dB _SetGainForVfTx set gain for transmit in dB BYTE Data gain or time slot number depending on the IoCtlCode Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.SetCodec( SelectedDeviceNo, _SetRxTimeslot, (BYTE)timeslot ); Ifc.SetCodec( SelectedDeviceNo, _SetGainForVfRx, (BYTE)gain ); }
73
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies type of register to write to _SetTxSetToRecovered sets clock to recoverd _SetTxSetToInternal - sets clock to internal _SetTxSetToExternal set sclock to external _SetCasf sets CASF Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.SetCodec( SelectedDeviceNo, _SetTxToInternal ); }
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies type of register to write to _ResetCasf set to BER Returns: Nothing
74
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.ResetCodec( SelectedDeviceNo, _ResetCasf ); }
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies type of register to write to _GetTxTimeslot gets transmit time slot _GetRxTimeslot gets receive time slot _GetGainForVfTx gets gain for transmit _GetGainForVfRx gets gain for receive Returns: BYTE Gain or timeslot number depending on the IoCtlCode parameter
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . TxTs = Ifc.GetCodec(DevNo, _GetTxTimeslot); // Read this setting from driver RxTs = Ifc.GetCodec(DevNo, _GetRxTimeslot); // Read this setting from driver RxGain = Ifc.GetCodec(DevNo, _GetGainForVfRx ); // Read VF gain for Rx TxGain = Ifc.GetCodec(DevNo, _GetGainForVfTx ); // and TX }
75
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies type of register to write to _TurnOnSpeaker turns speaker on _TurnOnVfTx turns VF transmit on _EnableDropInsert enables drop insert Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.EnableCodec(SelectedDeviceNo, _TurnOnSpeaker); // If was Off set On Ifc.EnableCodec(SelectedDeviceNo, _TurnOnVfTx); // }
76
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies type of register to write to _TurnOffSpeaker turns speaker off _TurnOffVfTx turns VF transmit off _DisableDropInsert disables drop insert Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.DisableCodec(SelectedDeviceNo, _TurnOffSpeaker); Ifc.DisableCodec(SelectedDeviceNo, _TurnOffVfTx); }
77
C++ C
bool CheckCodec( BYTE DeviceNo, DWORD IoCtlCode ); bool GlCheckCodec( BYTE DeviceNo, DWORD IoCtlCode );
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode specifies type of register to write to _IsSpeakerOn is speaker on? _IsVfTxOn is VF transmit on? _IsCasfNotBer is CASF set? _IsTxSetToRecovered is clock set to recovered? _IsTxSetToInternal - is clock set to internal? _IsTxSetToExternal is clock set to external?
Returns: Bool true if the option in question is enabled/on, false if the option is disabled/off
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . bool bSpeaker = Ifc.CheckCodec(SelectedDeviceNo, _IsSpeakerOn ); bool bInsert = Ifc.CheckCodec(SelectedDeviceNo, _IsVfTxOn ); }
78
Parameters: int DevIndex zero relative device index ( < GetNoOfDevicesInstalled() ) int tsnum timeslot number bool bAvail true to enable, false to disable Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . for (int i = 0; i <= NoOfChannels-1; i++) { if ( bEnableTs[I] ) Ifc.EnableMultiTs( DevNo 1, 0, true ); else Ifc.EnableMultiTs( DevNo 1, 0, false ); } }
Parameters: int DevIndex zero relative device index ( < GetNoOfDevicesInstalled() ) int tsnum timeslot number Returns: bool true if available, otherwise false
Parameters: int DevIndex zero relative device index ( < GetNoOfDevicesInstalled() ) Returns: bool true if available, otherwise false
Parameters: int DevIndex zero relative device index ( < GetNoOfDevicesInstalled() ) bool bAvail true make available, false make unavailable Returns: Nothing EnableMultiTs, CheckMultiTsAvailable, CheckMultiTsAllAvailable
80
void
Parameters: int DevIndex zero relative device index ( < GetNoOfDevicesInstalled() ) Returns: Nothing SaveMultiTsStatus
Parameters: int DevIndex zero relative device index ( < GetNoOfDevicesInstalled() ) Returns: Nothing RestoreMultiTsStatus
81
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: long BER error counter
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . if ( _bDropInsert ) Ifc.EnableCodec( _DevNo, _EnableDropInsert ); Ifc.ReadBerErrXlinx( _DevNo ); // Read First counter and discard it }
InsertBerError
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _InsertSingleError - inserts a logical error _InsertSingleBpvError inserts a BPV error Returns: Nothing
82
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.InsertBerError( SelectedDeviceNo, _InsertSingleError ); Ifc.InsertBerError( SelectedDeviceNo, _InsertSingleBpvError); }
ReadBerErrXilinx
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _SelectRxBer selects receive BER _SelectTxBer selects transmit BER Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . /************ Resync Card ************/ Ifc.SetBerTxRx( _DevNo, _SelectRxBer ); // Enable Rx Ifc.SetBerTxRx( _DevNo, _SelectTxBer ); // Enable Tx }
ResetBerTxRx
83
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing SetBerTxRx
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) EnT1E1CrossPortMode crossPortMode the desired cross port mode Returns: true if set ok, false if errors
84
See cross port functions in the users guide section for the definition of the cross port modes.
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: EnT1E1CrossPortMode crossPortMode the cross port mode setting The cross port values are defined as
enum EnT1E1CrossPortMode { EN_T1E1_CROSS_PORT_MODE_NO_CROSS_PORT = 0, EN_T1E1_CROSS_PORT_MODE_THROUGH = 1, EN_T1E1_CROSS_PORT_MODE_TRANSMIT = 2 };
See cross port functions in the users guide section for the definition of the cross port modes.
85
EnableDrInterruptEvents
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) BYTE Events - events to disable Returns: Nothing DisableDrInterruptEvents
C++ C
BYTE GetDr( BYTE DeviceNo, DWORD IoCtlCode ); BYTE GlGetDr( BYTE DeviceNo, DWORD IoCtlCode );
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DrGetAllTransitions _DrGetAllPerStatus _DrGetEqualizerControl _DrGetJitterAttenuation _DrGetRxLineAttenuation _DrGetLineLength - all transitions - all per status - equalizer control setting - jitter attenuation - receive line attenuation - line length
86
Returns:
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . printf(" Rx Line attenuation level = %5.1f\n", -2.9f * (float)Ifc.GetDr( SelectedDeviceNo, _DrGetRxLineAttenuation ) ); }
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DrIsLosTransitionSet - checks if LOS transition is set _DrIsNLoopTransitionSet - checks if network loop transition is set _DrIsAisTransitionSet - checks if AIS transition is set _DrIsDfmoTransitionSet - checks if DFMO transition is set _DrIsEsOvrTransitionSet checks if over-run transition is set _DrIsEsUnTransitionSet - checks if ES under-run transition set _DrIsLosPerStatusSet checks if LOS per status is set _DrIsNLoopPerStatusSet checks if network loop per status is set _DrIsAisPerStatusSet - checks if AIS per status is set _DrIsDrivOpenStatusSet checks if driver open status is set _DrIsBistPerStatusSet checks if BIST per status is set _DrIsRxMonitorModeSelected checks if driver monitor mode is selected _DrIs12dBRxEqualizerGain checks if equalizer gain is set to 12 dB _DrIs26dBRxEqualizerGain - checks if equalizer gain is set to 26 dB _DrIs36dBRxEqualizerGain - checks if equalizer gain is set to 36 dB _DrCheckLocalLoopback checks if local loopback is set _DrCheckAnalogLoopback checks if analog loopback is set _DrCheckRemoteLoopback checks if remote loopback is set _DrCheckNetworkLoopbackDetect checks if network loopback is detected _DrCheckTransmitAllOnes checks if transmit all ones is set 87
_DrBuiltInSelfTest built in self test Returns: bool true attribute is set/selected, false otherwise
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . bRet = Ifc.CheckDr(SelectedDeviceNo, _DrIsNLoopPerStatusSet); printf( "%s Network Loopback Active\n", bRet ? "Y" : "n"); }
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DrSetEqualizerControl _DrSetLineLength - sets equalizer control - sets line length
BYTE Data equalizer control value or line length depending on the IoCtlCode. Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.SetDr( DevNo, _DrSetLineLength, (BYTE)length ); }
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DrSet12dBRxEqualizerGain sets 12 dB equalizer gain _DrSet26dBRxEqualizerGain sets 26 dB equalizer gain _DrSet36dBRxEqualizerGain sets 36 dB equalizer gain Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.SetDr( DevNo, _DrSet12dBRxEqualizerGain ); }
89
4.88 Enabling Driver Loopback, Transmission All Ones, Network Loop Up/Down, or Rx Monitor Mode
C++ C
void EnableDr( BYTE DeviceNo, DWORD IoCtlCode ); void GlEnableDr( BYTE DeviceNo, DWORD IoCtlCode );
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DrEnableLocalLoopback _DrEnableAnalogLoopback _DrEnableRemoteLoopback _DrEnableNetworkLoopbackDetect _DrEnableTransmitAllOnes _DrEnableInBandNetworkLoopUp _DrEnableInBandNetworkLoopDown _DrEnableRxMonitorMode Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #ifdef T1 Ifc.DisableFr( SelectedDeviceNo, _TfrDisableLocalLoopback); #else // E1 Ifc.DisableFr( SelectedDeviceNo, _EfrDisableLocalLoopback); #endif Ifc.EnableDr( SelectedDeviceNo, _DrEnableLocalLoopback); }
- enables local loopback - enables analog loopback - enables remote loopback - enables network loopback detect - enables all ones transmission - enables in-band network loop up - enables in-band network loop down - enables driver Rx monitor mode
DisableDr
90
4.89 Disabling Driver Loopback, Transmission All Ones, Network Loop Up/Down, or Rx Monitor Mode
C++ C
void DisableDr( BYTE DeviceNo, DWORD IoCtlCode ); void GlDisableDr( BYTE DeviceNo, DWORD IoCtlCode );
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DrDisableLocalLoopback _DrDisableAnalogLoopback _DrDisableRemoteLoopback _DrDisableNetworkLoopbackDetect _DrDisableTransmitAllOnes _DrDisableInBandNetworkLoopUp _DrDisableInBandNetworkLoopDown _DrDisableRxMonitorMode _DrDisableJitterAttenuation Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.DisableDr( SelectedDeviceNo, _DrDisableLocalLoopback); Ifc.DisableDr( SelectedDeviceNo, _DrDisableRemoteLoopback); }
- disables local loopback - disables analog loopback - disables remote loopback - disables network loopback detect - disables all ones transmission - disables in-band network loop up - disables network loop down - disables driver Rx monitor mode - disables jitter attenuation
91
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.ResetDrRegisters( SelectedDeviceNo ); }
WriteRegister, ReadRegister
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DrIsJitterAttenuationOnTx - checks whether jitter attenuation is set on Tx _DrIsJitterAttenuationOnRx - checks whether jitter attenuation is set on Rx _DrIsJitterAttenuationDisabled - checks whether jitter attenuation is disabled _DrIsJitterSet6Hz - checks whether jitter is set on 6Hz _DrIsJitterSet3Hz - checks whether jitter is set on 3Hz Returns: bool true if set, false otherwise 92
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . bool b6Hz = Ifc.CheckDrJitter( SelectedDeviceNo, _DrIsJitterSet6Hz ); }
DisableDr, SetDrJitter
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DrSetJitterAttenuationOnRx sets driver jitter attenuation on Rx _DrSetJitterAttenuationOnTx sets driver jitter attenuation on Tx _DrSetJitter6Hz - sets jitter on 6Hz _DrSetJitter3Hz - sets jitter on 3Hz Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.SetDrJitter( SelectedDeviceNo, _DrSetJitter6Hz ); }
DisableDr, CheckDrJitter
93
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _TfrIsResyncInProgress - checks if resync is in progress _TfrIsBlueAlarmDetected - checks if blue alarm is detected _TfrIsB8ZSorCofaDetected - checks if B8ZS or COFA is detected _TfrIsFrameErrorDetected - checks if frame error is detected _TfrIsCarrierLossDetected - checks if carrier loss is detected _TfrIsYellowAlarmDetected - checks if yellow alarm is detected _TfrIsErrorCounterSaturated - checks if error counter is saturated _TfrIsBpvCounterSaturated - checks if BPV counter is saturated _TfrIsLocalLoopBackActive - checks if local loopback is active _TfrIsZeroSuppB7Set - checks if zero suppression B7 is set _TfrIsTxB8ZSActive - checks if Tx B8SZ is active _TfrIsD4YelAlarmSBit - checks if D4 yellow alarm SBit _TfrIsEsfYelAlarmFdl - checks if ESF yellow alarm FDL _TfrIsRxCofaDetectSelected - checks if Rx COFA detect is selected _TfrIsD4Selected - checks if D4 is selected _TfrIsEsfSelected - checks if ESF is selected _TfrIsSlc96Selected - checks if SLC96 is selected _TfrIsT1DMSelected - checks if T1DM is elected _TfrIsAutoResyncEnabled - checks if autoresync is enabled _TfrIsTxYellowAlarmEnabled - checks if Tx yellow alarm is enabled _TfrIsTxBlueAlarmEnabled - checks if Tx blue alarm is enabled _TfrIsExternalSBitEnabled - checks if external Sbit is enabled _TfrIsFFTxIdleCode - checks if the Tx idle code is 0xFF _TfrIs7FTxIdleCode - checks if Tx idle code is 0x7F _TfrIsRobbedBitSigEnabled - checks if robbed bit sig is enabled _TfrIsExternalCrcEnabled - checks if external CRC is enabled _TfrIsExternalFtFpsEnabled - checks if external FT FPS is enabled _TfrIsOutDataNrzSelected - checks if output data NRZ is selected _TfrIsResyncAlgo10Bits - checks if resync algorithm is 10 bits _TfrIsResyncUsingFtBits - checks if resync uses FT bits _TfrIsOofCriteria2of4 - checks if OFF criteria is 2 of 4 _TfrIsResyncOnOof - checks if resync is on OOF Returns:
94
This group of IoCtlCodes is defined only for T1 devices. They cannot be used for E1 cards !!!
SetFr,SelectFr,DeselectFr,GetFr,EnableFr,DisableFr
95
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _EfrIsErrorCounterSaturation - checks if error counter is saturated _EfrIsReceiveLossOfSync - checks if receive loss of sync _EfrIsCasMultiframeResync - checks if CAS multiframe resync _EfrIsFrameResync - checks if frame resync _EfrIsReceiveUnframedAllOnes - checks if receive unframed all ones is selected _EfrIsReceiveSignalingAllOnes - checks if receive signaling all ones is selected _EfrIsReceiveDma - checks if receive DMA is selected _EfrIsReceiveRemoteAlarm - checks if receive remote alarm _EfrIsAutoResyncEnabled - checks if autoresync is enabled _EfrIsRxCcsMode - checks if Rx is in CCS mode _EfrIsRxCasMode - checks if Rx is in CAS mode _EfrIsLocalLoopBackActive - checks if local loopback is active _EfrIsRxCrc4Enabled - checks if Rx CRC4 is enabled _EfrIsTxCrc4Enabled - checks if Tx CRC4 is enabled _EfrIsRxHdb3Enabled - checks if Rx HDB3 is enabled _EfrIsTxHdb3Enabled - checks if Tx HDB3 is enabled _EfrIsTx100DutyCycle - checks if Rx 100 duty cycle is selected _EfrIsTx50DutyCycle - checks if Tx 50 duty cycle is selected _EfrIsTxSignalingAllOnes - checks if Tx signaling all ones is selected _EfrIsTxExtraBits - checks if Tx extra bits are selected _EfrIsTxNationalBits - checks if Tx national bits are selected _EfrIsTxInternationalBits - checks if Tx international bits are selected _EfrIsTxCcsMode - checks if Tx CCS mode is selected _EfrIsTxCasMode - checks if Tx CAS mode is selected _EfrIsExtSignalingBits - checks if ext signaling bits are selected _EfrIsUnframeAllOnes - checks if unframed all ones is selected _EfrIsTxRemoteAlarm - checks if Tx remote alarm is selected _EfrIsTxDma - checks if Tx DMA is selected _EfrIsFrameResyncCriteriaFixed - checks if framere sync criteria is fixed _EfrIsCasMfResyncCriteriaFixed - checks if CAS MF resync criteria is fixed _EfrIsCasMultiframeSyncCriteriaFixed - checks if CAS multiframe sync criteria is fixed _EfrIsTxMfStartWithFas - checks if Tx multiframe starts with FAS Returns: bool true if set, false otherwise
96
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . /********************************************************************/ /* Resync status */ /********************************************************************/ #if defined(T1) bRet = Ifc.CheckFr( SelectedDeviceNo, _TfrIsResyncInProgress) ; #else // defined(E1) bRet = Ifc.CheckFr( SelectedDeviceNo, _EfrIsReceiveLossOfSync); #endif printf( "%s Sync Loss\n", bRet ? "Y" : "n"); }
This group of IoCtlCodes is defined only for E1 devices. They cannot be used for T1 cards !!!
SetFr,SelectFr,DeselectFr,GetFr,EnableFr,DisableFr
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _TfrIsChannelSelectedForTxIdleCode - checks if timeslot is selected for Tx idle code _TfrIsChannelSelectedForTransparent - checks if timeslot is selected for transparent _TfrIsRxChannelSelectedForCodeInsert - checks if Rx timeslot is selected for code insert _EfrIsTimeslotSelectedForTxIdleCode - checks if timeslot is selected for Tx idle code
BYTE TimeslotNo zero relative timeslot number 0..31 (E1), 0-23(T1) Returns: bool true if set, false otherwise
97
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined(E1) bRet = Ifc.CheckFrTimeslotSelectedForTxIdleCode(DevNo, 0); #endif }
This function is defined only for E1 devices and cannot be used for T1 cards !!!
CheckFr, SetFr,SelectFr,DeselectFr,GetFr,EnableFr,DisableFr
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrDisableAllInterrupts disables all interrupts _TfrDisableAlarmsInterruptsOnly disables alarm interrupts only E1 only _EfrDisableAllInterrupts disables all interrupts _EfrDisableAlarmsInterruptsOnly disables alarm interrupts only Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined(T1) Ifc.DisableFrInterrupts ( SelectedDeviceNo, _TfrDisableAlarmsInterruptsOnly) ; #else // defined(E1) Ifc.DisableFrInterrupts ( SelectedDeviceNo, _EfrDisableAlarmsInterruptsOnly); #endif }
98
_TfrDisableXxx IoCtlCodes must be used only for T1 devices, and _EfrDisableXxx IoCtlCodes must be used only for E1 devices.
EnableFrInterrupts
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) BYTE MaskBits bits in this parameter specify interrupts to be disabled Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.DisableFrInterrupts ( SelectedDeviceNo, BitMask ) ; }
EnableFrInterrupts
99
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrEnableAllInterrupts enables all interrupts E1 only _EfrEnableAllInterrupts enables all interrupts Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined(T1) Ifc.EnableFrInterrupts ( SelectedDeviceNo, _TfrEnableAllInterrupts) ; #else // defined(E1) Ifc.DisableFrInterrupts ( SelectedDeviceNo, _EfrEnableAllInterrupts); #endif }
_TfrEnableAllInterrupts IoCtlCode must be used only for T1 devices, and _EfrEnableAllInterrupts IoCtlCode must be used only for E1 devices.
EnableFrInterrupts
100
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) BYTE MaskBits bits in this parameter specify interrupts to be enabled Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.EnableFrInterrupts ( SelectedDeviceNo, BitMask ) ; }
DisableFrInterrupts
101
4.100 Get Framer Receive Status Register (RSR) or Receive Interrupt Mask Register (RIMR)
C++ C
BYTE GetFr ( BYTE DeviceNo, DWORD IoCtlCode ); BYTE GlGetFr ( BYTE DeviceNo, DWORD IoCtlCode );
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrReadRsr reads receive status register _TfrReadRimr reads receive interrupt mask register E1 only _EfrReadRsr reads receive status register _EfrReadRimr reads receive interrupt mask register Returns: BYTE register data
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . BYTE RsrData; #if defined(T1) RsrData = Ifc.GetFr ( SelectedDeviceNo, _TfrReadRsr ) ; #else // defined(E1) RsrData = Ifc.GetFr ( SelectedDeviceNo, _EfrReadRsr ); #endif }
_TfrReadXxx IoCtlCodes must be used only for T1 devices, and _EfrReadXxx IoCtlCodes must be used only for E1 devices.
CheckFr,SetFr,SelectFr,DeselectFr,EnableFr,DisableFr
102
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrGetBipolarViolationCounter - gets number of bipolar violations _TfrGetOutOfFrameCounter gets out-of-frame counter _TfrGetErroredSuperFrameCounter gets number of superframe errors E1 only _EfrGetBipolarViolationCounter - gets number of bipolar violations _EfrGetCrc4ErrorCounter gets number of CRC4 errors _EfrGetFrameErrorCounter gets number of frame errors Returns: WORD number of errors
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (T1) BpvErrors = Ifc.GetFrErrorCounter( _DevNo, _TfrGetBipolarViolationCounter ); #else // (E1) BpvErrors = Ifc.GetFrErrorCounter( _DevNo, _EfrGetBipolarViolationCounter ); #endif }
_TfrGetXxx IoCtlCodes must be used only for T1 devices, and _EfrGetXxx IoCtlCodes must be used only for E1 devices.
SetFrErrorCounter
103
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrSetBipolarViolationCounter - sets start bipolar violations counter _TfrSetOutOfFrameCounter sets start out-of-frame counter _TfrSetErroredSuperFrameCounter sets start superframe error counter E1 only _EfrSetBipolarViolationCounter - sets start of bipolar violation counter _EfrSetCrc4ErrorCounter sets start of CRC4 error counter _EfrSetFrameErrorCounter sets start frame error counter Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (T1) Ifc.SetFrErrorCounter( _DevNo, _TfrSetBipolarViolationCounter, 0 ); #else // (E1) Ifc.SetFrErrorCounter( _DevNo, _EfrSetBipolarViolationCounter, 0 ); #endif }
_TfrSetXxx IoCtlCodes must be used only for T1 devices, and _EfrSetXxx IoCtlCodes must be used only for E1 devices.
GetFrErrorCounter
104
C++ C
void EnableFr( BYTE DeviceNo, DWORD IoCtlCode ); void GlEnableFr( BYTE DeviceNo, DWORD IoCtlCode );
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrEnableLocalLoopback enables local loopback _TfrEnableTxB8ZS enables Tx B8SZ _TfrEnableAutoResync enables auto resync _TfrEnableTxYellowAlarm enables Tx yellow alarm _TfrEnableTxBlueAlarm enables Tx blue alarm _TfrEnableExternalSBit enables external S bit _TfrEnableRobbedBitSig enables robbed bit signaling _TfrEnableExternalCrc enables external CRC _TfrEnableExternalFtFps enables external FT FPS E1 only _EfrEnableAutoResync enables auto resync _EfrEnableLocalLoopback enables local loopback _EfrEnableRxCrc4 enables Rx CRC4 _EfrEnableTxCrc4 enables Tx CRC4 _EfrEnableRxHdb3 enables Rx HDB3 _EfrEnableTxHdb3 enables Tx HDB3 _EfrEnableTxSignalingAllOnes enables Tx signaling all ones _EfrEnableTxExtraBits enables Tx extra bits _EfrEnableTxNationalBits enables Tx national bits _EfrEnableTxInternationalBits enables Tx international bits _EfrEnableExtSignalingBits enables ext signaling bits _EfrEnableUnframeAllOnes enables unframed all ones _EfrEnableTxRemoteAlarm enables Tx remote alarm _EfrEnableTxDma enables Tx DMA _EfrTxMfStartWithFas enables starting multiframes with FAS Returns: Nothing
105
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (T1) Ifc.EnableFr( _DevNo, _TfrEnableAutoResync ); #else // (E1) Ifc.EnableFr( _DevNo, _TfrEnableAutoResync ); #endif }
_TfrEnableXxx IoCtlCodes must be used only for T1 devices, and _EfrEnableXxx IoCtlCodes must be used only for E1 devices.
CheckFr,SetFr,SelectFr,DeselectFr,GetFr,DisableFr
C++ C
void DisableFr( BYTE DeviceNo, DWORD IoCtlCode ); void GlDisableFr( BYTE DeviceNo, DWORD IoCtlCode );
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrDisableLocalLoopback disables local loopback _TfrDisableTxB8ZS disables Tx B8SZ _TfrDisableAutoResync disables auto resync _TfrDisableTxYellowAlarm disables Tx yellow alarm _TfrDisableTxBlueAlarm disables Tx blue alarm _TfrDisableExternalSBit disables external S bit _TfrDisableRobbedBitSig disables robbed bit signaling _TfrDisableExternalCrc disables external CRC _TfrDisableExternalFtFps disables external FT FPS
106
E1 only _EfrDisableAutoResync disables auto resync _EfrDisableLocalLoopback disables local loopback _EfrDisableRxCrc4 disables Rx CRC4 _EfrDisableTxCrc4 disables Tx CRC4 _EfrDisableRxHdb3 disables Rx HDB3 _EfrDisableTxHdb3 disables Tx HDB3 _EfrDisableTxSignalingAllOnes disables Tx signaling all ones _EfrDisableTxExtraBits disables Tx extra bits _EfrDisableTxNationalBits disables Tx national bits _EfrDisableTxInternationalBits disables Tx international bits _EfrDisableExtSignalingBits disables ext signaling bits _EfrDisableUnframeAllOnes disables unframed all ones _EfrDisableTxRemoteAlarm disables Tx remote alarm _EfrDisableTxDma disables Tx DMA _EfrTxMfStartWithoutFas disables starting multiframes with FAS Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (T1) Ifc.DisableFr( _DevNo, _TfrDisableAutoResync ); #else // (E1) Ifc.DisableFr( _DevNo, _TfrDisableAutoResync ); #endif }
_TfrDisableXxx IoCtlCodes must be used only for T1 devices, and _EfrDisableXxx IoCtlCodes must be used only for E1 devices.
CheckFr,SetFr,SelectFr,DeselectFr,GetFr,EnableFr
107
C++ C
void SetFr( BYTE DeviceNo, DWORD IoCtlCode ); void GlSetFr( BYTE DeviceNo, DWORD IoCtlCode );
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrSetZeroSuppB7 sets zero bit suppression B7 _TfrSetZeroSuppTransparent sets zero bit suppression transparent _TfrOofCriteria2of4 sets OOF criteria to 2 of 4 _TfrOofCriteria2of5 sets OOF criteria to 2 of 5 E1 only _EfrSetRxCcsMode sets Rx CCS mode _EfrSetRxCasMode sets Rx CAS mode _EfrSetTxCcsMode sets Tx CCS mode _EfrSetTxCasMode sets Tx CAS mode _EfrCasMultiframeSyncCriteriaFixed sets CAS multiframe sync criteria fixed _EfrCasMultiframeSyncCriteriaNotFixed sets CAS multiframe sync criteria not fixed Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (T1) Ifc.SetFr( _DevNo, _TfrOofCriteria2of5 ); #endif }
108
_TfrXxx IoCtlCodes must be used only for T1 devices, and _EfrXxx IoCtlCodes must be used only for E1 devices.
CheckFr,SetFr,SelectFr,DeselectFr,EnableFr,DisableFr
C++ C
void SelectFr( BYTE DeviceNo, DWORD IoCtlCode ); void GlSelectFr( BYTE DeviceNo, DWORD IoCtlCode );
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrSelectD4YelAlarmB2 selects yellow alarm B2 for D4 _TfrSelectD4YelAlarmSBit selects yellow alarm S bit for D4 _TfrSelectEsfYelAlarmFdl selects yellow alarm FDL for ESF _TfrSelectEsfYelAlarmSBit selects yellow alarm S bit for ESF _TfrSelectD4 selects D4 superframe _TfrSelectEsf selects extended superframe _TfrSelectSlc96 selects SLC96 _TfrSelectT1DM selects T1DM _TfrSelectTxIdleCode7F selects idle code 0x7F _TfrSelectTxIdleCodeFF selects idle code 0xFF _TfrSelectOutDataUnipolar selects output data unipolar _TfrSelectOutDataNrz selects output data NRZ E1 only _EfrSelectTx100DutyCycle selects Tx 100 duty cycle _EfrSelectTx50DutyCycle selects Tx 50 duty cycle Returns: Nothing
109
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (T1) Ifc.SelectFr( _DevNo, _TfrSelectT1DM ); #endif }
_TfrXxx IoCtlCodes must be used only for T1 devices, and _EfrXxx IoCtlCodes must be used only for E1 devices.
CheckFr,SetFr,DeselectFr,EnableFr,DisableFr, EnableFr
C++ C
void DeselectFr( BYTE DeviceNo, DWORD IoCtlCode ); void GlDeselectFr( BYTE DeviceNo, DWORD IoCtlCode );
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrDeselectAllChannelForTxIdleCode - deselects all channels for Tx idle code _TfrDeselectAllChannelForTransparent - deselects all channels for transparent _TfrDeselectAllRxChannelForCodeInsert deselects all Rx channels for code insert E1 only _EfrDeselectAllTimeslotForTxIdleCode - deselects all channels for Tx idle code Returns: Nothing 110
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (T1) Ifc.DeselectFr( _DevNo, _TfrDeselectAllChannelForTxIdleCode); #else // (E1) Ifc.DeselectFr( _DevNo, _EfrDeselectAllTimeslotForTxIdleCode); #endif }
_TfrXxx IoCtlCodes must be used only for T1 devices, and _EfrXxx IoCtlCodes must be used only for E1 devices.
CheckFr,SetFr,SelectFr,EnableFr,DisableFr, EnableFr
111
C++ C
void SelectFrTimeslot( BYTE DeviceNo, DWORD IoCtlCode, BYTE TimeslotNo ); void GlSelectFrTimeslot( BYTE DeviceNo, DWORD IoCtlCode, BYTE TimeslotNo );
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrSelectChannelForTxIdleCode - selects a timeslot for Tx idle code _TfrSelectChannelForTransparent - selects a time slot for transparent _TfrSelectRxChannelForCodeInsert - selects a Rx time slot for code insert E1 only _EfrSelectTimeslotForTxIdleCode - selects a time slot for Tx idle code BYTE TimeslotNo zero relative time slot to select Returns: Nothing
try { GlComInterface Ifc; Ifc.Initialize(); . . . #if defined (T1) Ifc.SelectFrTimeslot( Ifc.SelectFrTimeslot( #else // (E1) Ifc.SelectFrTimeslot( Ifc.SelectFrTimeslot( #endif }
// Device driver interface object // Set default hardware settings _DevNo, _TfrSelectChannelForTxIdleCode, 0); _DevNo, _TfrSelectChannelForTxIdleCode, 23); _DevNo, _EfrSelectTimeslotForTxIdleCode, 0); _DevNo, _EfrSelectTimeslotForTxIdleCode, 31);
_TfrXxx IoCtlCodes must be used only for T1 devices, and _EfrXxx IoCtlCodes must be used only for E1 devices.
DeselectFrTimeslot
112
C++ C
void DeselectFrTimeslot( BYTE DeviceNo, DWORD IoCtlCode, BYTE TimeslotNo ); void GlDeselectFrTimeslot( BYTE DeviceNo, DWORD IoCtlCode, BYTE TimeslotNo );
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrDeselectChannelForTxIdleCode - deselects a timeslot for Tx idle code _TfrDeselectChannelForTransparent - deselects a time slot for transparent _TfrDeselectRxChannelForCodeInsert - deselects a Rx time slot for code insert E1 only _EfrDeselectTimeslotForTxIdleCode - deselects a time slot for Tx idle code BYTE TimeslotNo zero relative time slot to deselect Returns: Nothing
try { GlComInterface Ifc; Ifc.Initialize(); . . . #if defined (T1) Ifc.DeselectFrTimeslot( Ifc.DeselectFrTimeslot( #else // (E1) Ifc.DeselectFrTimeslot( Ifc.DeselectFrTimeslot( #endif }
// Device driver interface object // Set default hardware settings _DevNo, _TfrDeselectChannelForTxIdleCode, 0); _DevNo, _TfrDeselectChannelForTxIdleCode, 23); _DevNo, _EfrDeselectTimeslotForTxIdleCode, 0); _DevNo, _EfrDeselectTimeslotForTxIdleCode, 31);
113
_TfrXxx IoCtlCodes must be used only for T1 devices, and _EfrXxx IoCtlCodes must be used only for E1 devices.
SelectFrTimeslot
4.110
C++ C
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _TfrDetectRxB8ZS detects B8ZS _TfrDetectRxCofa detects COFA Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (T1) Ifc.DetectFrRx( _DevNo, _TfrDetectRxB8ZS ); #endif }
114
4.111
Resync Framer
T1 only. Call this function to force resync, or to resync using algo 10 or 24 bits, or to resync using FT or FT FS bits, or to resync on OOF or on OOF RCL E1 only. Call this function to force resync, or with frame or CAS multiframe criteria fixed or not fixed.
C++ C
void ResyncFr( BYTE DeviceNo, DWORD IoCtlCode ); void GlResyncFr( BYTE DeviceNo, DWORD IoCtlCode );
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode T1 only _TfrForcedResync forces resync _TfrResyncAlgo10Bits resyncs using algo 10 bits _TfrResyncAlgo24Bits resyncs using algo 24 bits _TfrResyncUsingFtBits resyncs using FT bits _TfrResyncUsingFtFsBits resyncs using FT FS bits _TfrResyncOnOof - resync on OOF _TfrResyncOnOofRcl resync on OOF RCL E1 only _EfrForcedResync - forces resync _EfrFrameResyncCriteriaFixed frame resync with criteria fixed _EfrFrameResyncCriteriaNotFixed frame resync with criteria not fixed _EfrCasMfResyncCriteriaFixed CAS multiframe resync with criteria fixed _EfrCasMfResyncCriteriaNotFixed CAS multiframe resync with criteria not fixed Returns: Nothing
115
try { GlComInterface Ifc; Ifc.Initialize(); . . . Ifc.ResyncFr( _DevNo, #if defined (T1) _TfrForcedResync ); #else // (E1) _EfrForcedResync ); #endif }
_TfrXxx IoCtlCodes must be used only for T1 devices, and _EfrXxx IoCtlCodes must be used only for E1 devices.
CheckFr,SetFr,SelectFr,DeselectFr,GetFr,EnableFr,DisableFr
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _EfrSetTxExtraBits sets extra bits _EfrSetTxNationalBits sets national bits _EfrSetTxInternationalBits sets international bits BYTE Bits bits to set Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (E1) Ifc.SetFrBits( DevNo, _EfrSetTxExtraBits, Bits ); #endif }
116
This member function is defined for E1 devices only.
GetFrBits
BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _EfrGetTxExtraBits gets extra bits _EfrGetTxNationalBits gets national bits _EfrGetTxInternationalBits gets international bits Returns: BYTE Bits bits that are set
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . #if defined (E1) BYTE BitsSet = Ifc.GetFrBits( DevNo, _EfrGetTxNationalBits ); #endif }
SetFrBits
117
118
During execution of this function the global active receive buffer can switch to the alternative. Use GetLatestTimeslotData to avoid this possibility.
GetLatestTimeslotData
C++ C
int GetLatestTimeslotData(BYTE DeviceNo, BYTE *BufferPtr, int BufferSize, int TimeslotNo); int GlGetLatestTimeslotData(BYTE DeviceNo, BYTE *BufferPtr, int BufferSize, int TimeslotNo);
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) BYTE *BufferPtr buffer to retrieve data into int BufferSize bytes to retrieve int TimeslotNo zero relative time slot to retrieve Returns: int number of bytes copied into user buffer
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . int nbytes = Ifc.GetLatestTimeslotData(DevNo, pBuffer, BuffSize, nTimeSlot ); }
GetTimeslotData 119
4.116
C++ C
Parameters: None Returns: DWORD driver version (major in high byte and minor in low byte)
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . DWORD Version = Ifc.GetVersion(); printf("Driver Version %d.%02d\n", HIBYTE(Version), LOBYTE(Version)); }
4.117
C++ C
120
Parameters: None Returns: BYTE maximum timeslot number (23 for T1 and 31 for E1)
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . for (int j = 0; j <= Ifc.GetMaxTimeslot(); j++) { if ( CheckTsAvailable(j) ) { memset(pGlBuf0 + i*NoOfChannels + j, multiframe[(i % NoOfFrames)*NoOfChannels+j], 1); memset(pGlBuf1 + i*NoOfChannels + j, multiframe[(i % NoOfFrames)*NoOfChannels+j], 1); } } }
Parameters: None Returns: BYTE maximum number of cards supported by device driver
121
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . BYTE MaxDevices = Ifc.GetMaxDeviceCount(); }
GetNoOfDevicesInstalled
4.120
C++ C
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) int SoftBufferNo 0 set in Tx global buffer 0, otherwise in Tx global buffer 1 int TS zero relative time slot number bool bOnHook true set on-hook, false off-hook. If omitted, the default is true; Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . // Setting on-hook in global Tx buffer 1 Ifc.SetOnHook( DevNo, 1, 23, true ); }
122
4.121
C++ C
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: unsigned long - frequency on the receive line
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . unsigned long freq = Ifc.ReadRxLineFrequency( DevNo ); }
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _ActivateTxBuffer enables Tx buffer _ActivateRxBuffer enables Rx buffer Returns: bool - true OK, false failure
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . if ( EnableTxRxBuffer( DevNo, _ActivateRxBuffer ) ) { . . . } }
123
DisableTxRxBuffer
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD IoCtlCode _DeActivateTxBuffer disables Tx buffer _DeActivateRxBuffer disables Rx buffer Returns: bool - true OK, false failure
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . if ( DisableTxRxBuffer( DevNo, _DeActivateTxBuffer ) ) { . . . } }
EnableTxRxBuffer
124
4.124
C++ C
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) UINT StartTs, UINT EndTs specify the time slot range to transmit idle code on Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.LoadTxBufferWithIdleCode( DevNo, 0, Ifc.GetMaxTimeslot() ); }
LoadTxBufferWithMf
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) BYTE* pMultiframe pointer to the multiframes bytes to load Returns: Nothing
125
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.LoadTxBufferWithMF(DevNo, pMultiframe ); Ifc.EnableTxRxBuffer( DevNo, _ActivateTxBuffer); Sleep(200); Ifc.DisableTxRxBuffer( DevNo, _DeActivateTxBuffer); }
LoadTxBufferWithIdleCode
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.DisableUnframedInput( DevNo ); }
EnableUnframedInput
126
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . Ifc.EnableUnframedInput( DevNo ); }
DisableUnframedInput
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD TsMask timeslots to apply selection mask to (0x80000000 ts0) BYTE InvMask bits to invert (1 causes apropriate bit to invert) Returns: true OK, false - error
Bits defined by the mask in the speicified timeslots from the global buffers are are inverted before transmission.
127
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD TsMask timeslots to apply selection mask to (0x80000000 ts0) BYTE InvMask bits to invert (1 causes apropriate bit to invert) Returns: true OK, false - error
Bits defined by the mask in the speicified timeslots are inverted upon reception before being placed into global buffers.transmission.
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD TsMask timeslots to apply selection mask to (0x80000000 ts0) BYTE InvMask bits to invert (1 causes apropriate bit to invert) Returns: true OK, false - error
Current values of Rx inversion mask and timeslot mask set by the latest SetRxInvMask is retrieved.
128
4.131
C++ C
Parameters: BYTE DeviceNo one relative device number ( <= GetNoOfDevicesInstalled() ) DWORD TsMask timeslots to apply selection mask to (0x80000000 ts0) BYTE InvMask bits to invert (1 causes apropriate bit to invert) Returns: true OK, false - error
Current values of Tx inversion mask and timeslot mask set by the latest SetTxInvMask is retrieved.
129
4.132.1 Creating and Initializing the Basic Input Output Stream Object (BioStream constructor).
C++ C
BioStream( GlComInterface* pIfc, BYTE DeviceNo, DWORD ReadChannelMask, DWORD WriteChannelMask ); StreamHandle BioOpenStream (BYTE DeviceNo, DWORD ReadChannelMask, DWORD WriteChannelMask );
Parameters: GlComInterface* pIfc - pointer to GlComInterface object BYTE DeviceNo one relative device number ( <=GlComInterface::GetNoOfDevicesInstalled() ) DWORD ReadChannelMask read channel mask ( 0xC0000000, for example, specifies channels 1 and 2) DWORD WriteChannelMask write channel mask ( 0xFFFFFF00, for example, specifies channels 1 through 24) Returns: Nothing for C++, or a handle to the BioStream Object for C (type StreamHandle).
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . BioStream Bs(&Ifc, SelectedDeviceNo, 0xC0000000, 0xC0000000 ); } }
130
4.132.2 Creating and Initializing the Basic Input Output Stream Object (BioStream constructor).
C++ C
Parameters: GlComInterface* pIfc - pointer to GlComInterface object BYTE DeviceNo one relative device number ( <=GlComInterface::GetNoOfDevicesInstalled() ) DWORD ChannelMask read and write channel mask ( 0xC0000000, for example, specifies channels 1 and 2) Returns: Nothing
try { GlComInterface Ifc; // Device driver interface object Ifc.Initialize(); // Set default hardware settings . . . BioStream Bs(&Ifc, SelectedDeviceNo, 0xC0000000 ); } }
Read and write channel masks are set to the same value
4.132.3 Destroying the Basic Input Output Stream Object (BioStream destructor).
C++ C
Parameters: StreamHandle hBios handle of BioStream object to perform the function on. Returns: bool -true if object was destroyed, otherwise false.
131
4.132.4
C++ C
void SetReadChannelMask( DWORD ChannelMask ); void BioSetReadChannelMask( StreamHandle pBios, DWORD ChannelMask );
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. DWORD ChannelMask read channel mask ( 0xC0000000, for example, specifies channels 1 and 2) Returns: Nothing
Read channel mask set by a constructor may be changed by this function. The function also reopens receive stream.
4.132.5
C++ C
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. DWORD ChannelMask write channel mask ( 0xC0000000, for example, specifies channels 1 and 2) Returns: Nothing
132
Write channel mask set by a constructor may be changed by this function. The function also reopens transmit stream.
4.132.6
These margins are needed when the application is slow to keep with current driver position so when the driver gets ahead 2*GlobalBufferSize SafeMargins an exception is thrown and the user application can easily catch this event.
C++ C
void SetReadSafeMarginMultiFrames( DWORD MultiFrames ) void BioSetReadSafeMarginMultiFrames( StreamHandle pBios, DWORD MultiFrames)
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. DWORD MultiFrames multiframes number in margins. Returns: Nothing SetWriteSafeMarginMultiframes, SetReadSafeMarginBytes, SetWriteSafeMarginBytes
4.132.7
These margins are needed to write ahead of the driver that is peeking up data from the global transmit buffers. C++ void SetWriteSafeMarginMultiFrames( DWORD MultiFrames )
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. DWORD MultiFrames multiframes number in margins. Returns: Nothing
133
4.132.8
These margins are needed when the application is slow to keep with current driver position so when the driver gets ahead 2*GlobalBufferSize SafeMargins an exception is thrown and the user application can easily catch this event.
C++ C
void SetReadSafeMarginBytes( DWORD Bytes ) void BioSetReadSafeMarginBytes( StreamHandle pBios, DWORD Bytes )
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. DWORD Bytes byte number in margins. Returns: Nothing SetReadSafeMarginMultiframes, SetWriteSafeMarginMultiframes, SetWriteSafeMarginBytes
134
4.132.9
These margins are needed to write ahead of the driver that is picking up data from the global transmit buffers.
C++ C
void SetWriteSafeMarginBytes( DWORD Bytes ) void BioSetWriteSafeMarginBytes( StreamHandle pBios, DWORD Bytes )
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. DWORD Bytes multiframes number in bytes. Returns: Nothing
It is recommended to have safe write margins not less than 4608 bytes (12*16*24)
4.132.10
Obtains number of total missed bytes when application is too slow to read C++ DWORD GetReadMissedBytesCount()
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. Returns: DWORD bytes missed GetWriteMissedBytesCount
135
4.132.11
Obtains number of total missed bytes when application is too fast to write in nonblocking mode C++ DWORD GetWriteMissedBytesCount()
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. Returns: DWORD bytes missed GetReadMissedBytesCount
4.132.12
C++ C
DWORD Read(PBYTE pOutBuffer, DWORD Length, bool bWait = true ); DWORD BioRead(StreamHandle pBios, PBYTE pOutBuffer, DWORD Length, bool bWait);
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. PBYTE pOutBuffer - user supplied buffer to read into DWORD Length - bytes to read bool bWait - true(default) read in the blocking mode (return after all requested bytes are read), false return only bytes that are available Returns: DWORD bytes read. If an error, typically an underrun error occurs, the C++ interface throws an exception, while C interface returns value -1 (0xFFFFFFFF). Write, BioWrite
136
Bytes are received from channels specified by the ReadChannelMask in constructor or SetReadChannelMask function. See Record.exe example for usage
4.132.13
C++ C
DWORD Write(PBYTE pInBuffer, DWORD Length, bool bWait = true, bool bContinuous = true ); DWORD BioWrite(StreamHandle pBios, PBYTE pInBuffer, DWORD Length, bool bWait);
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. PBYTE pInputBuffer - user supplied buffer to write from DWORD Length - bytes to write bool bWait - true(default) write in the blocking mode (return after all requested bytes are written), false write only bytes that are available for transmission bool bContinuous - true(default) write continuously, false write so driver can transmit them as soon as possible Returns: DWORD bytes written. If an error, typically an overrun error occurs, the C++ interface throws an exception, while C interface returns value -1 (0xFFFFFFFF).
Read, BioRead
137
Bytes are transmitted to the channels specified by the WriteChannelMask in constructor or SetWriteChannelMask function. First write is opening the stream safe margin bytes ahead of the current driver position. Application should at this point write sufficient bytes to stay ahead of driver to avoid underrun exception See play.exe example for usage
4.132.14
C++ C
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. Returns: Nothing ReopenWrite, Reopen
Use this function after overrun exception occurs
4.132.15
C++ C
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. Returns: Nothing
4.132.16
C++ C
void Reopen(bool bRead=true, bool bWrite=true) void BioReopen(StreamHandle pBios, bool bRead, bool bWrite)
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. bool bRead true reopen for receiving bool bWrite true reopen for transmitting Returns: Nothing ReopenRead, ReopenWrite
4.132.17
Fills transmit channels specified by the channel mask with the idle code
C++ C
void FillTxChannels( BYTE FillerByte ); void BioFillTxChannels( StreamHandle pBios, BYTE FillerByte );
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. BYTE FillerByte - byte to use as the idle code to fill in channels in global transmit buffers. Only channels specified by the channel mask are affected. Returns: nothing Overloaded FillTxChannels, FillTxGlobalBuffers
139
Bytes are filled according to the channels specified by the WriteChannelMask in constructor or SetWriteChannelMask function. See play.exe example for usage
4.132.18
Fills transmit channels specified by the channel mask with the idle code
C++ C
void FillTxChannels( BYTE* pFillerBytes, DWORD Length ); void BioFillTxChannelsWithLength( StreamHandle pBios, BYTE* pFillerBytes, DWORD Length );
Parameters: StreamHandle pBios handle of BioStream object to perform the function on. BYTE* pFillerBytes - byte string pointer to use to fill in channels in global transmit buffers. Only channels specified by the channel mask are affected. DWORD Length length of the filler byte string Returns: nothing Overloaded FillTxChannels, FillTxGlobalBuffers
140
Bytes are filled according to the channels specified by the WriteChannelMask in constructor or SetWriteChannelMask function.
4.132.19
C++ C
Parameters: int StartTs int EndTs Returns: DWORD -channel mask -starting timeslot of channel mask -ending timeslot of channel mask
141
The BioStreamEx class methods allows to receive and transmit data with signalling bits. The data should be transmitted and received on a single 64k channel, i.e. timeslot mask MUST specify exactly one channel for data.
SigBitsAsyncIo class provides transmitting and receiving signaling bits on multiple channels.
4.133.1
BioStreamEx Constructor
BioStreamEx( GlComInterface* pIfc, BYTE DeviceNo, DWORD ReadChannelMask, DWORD WriteChannelMask ) Parameters: GlComInterface* pIfc - pointer to the GlComInterface object BYTE DeviceNo - one relative device number (card #) DWORD ReadChannelMask - read channel mask (0x80000000 corresponds to timeslot 0, 0x40000000 - TS 1 etc.) When the read channel mask is not zero, the write channel mask MUST be zero and the object instance is used to read signalling bits and data DWORD WriteChannelMask - write channel mask (0x80000000 corresponds to timeslot 0, 0x40000000 - TS 1 etc.) When the write channel mask is not zero, the read channel mask MUST be zero and the object instance is used to write signalling bits only and/or signalling bits and data. Returns: Nothing 142
4.133.2
Signalling bits correspond to the following bit masks in the SigBits byte: A - 0x80, B - 0x40, C - 0x20, D - 0x10
143
list<SignalTransition>& SigTransitions - list of signalling transitions occurred. When the stream is just opened the initial signalling bit status is reported on the first read with the number of preceding bytes equal to zero. Only the signalling bit transitions are reported, i.e. if there is no change in the signalling bits the list will be empty. The list is cleared by the function before any signalling transitions are placed if the fClearTransitions parameter is set to true. See previous chapter on the SignalTransition structure description. signaling transition list, each item in the list is structure containing number of preceding bytes for timeline and the new signaling transition
struct SignalTransition { unsigned __int64 TotalBytesBeforeSig; // bytes since opening unsigned char SigBits; // Signaling bits SignalTransition( const unsigned __int64& Total, unsigned char Sig ) : TotalBytesBeforeSig(Total), SigBits(Sig) {} };
bool fWait
- true means do not return before the specified number of data bytes are read, false means read as much data as available - true - clear transition list parameter (SigTransitions) first DWORD - number of data bytes actually read
144
list<SignalTransition> TransitionHistory; // non-blocking clear transitions pBios->ReadDataAndSigBits( Data, sizeof(Data), SigTransitions, false ); for ( list<SignalTransition>::iterator it = TransitionHistory.begin(); it != TransitionHistory.end(); it++ ) { printf( "A=%c B=%c C=%c D=%c BytesBeforeSigTransitionMF = %I64u\n", (*it).SigBits & 0x80 ? '1' : '0', (*it).SigBits & 0x40 ? '1' : '0', (*it).SigBits & 0x20 ? '1' : '0', (*it).SigBits & 0x10 ? '1' : '0', (*it).TotalBytesBeforeSig ); }
list<SignalTransition>& SigTransitions - signaling transition list, each item in the list is structure containing number of preceding bytes for timeline and the new signaling transition
struct SignalTransition { unsigned __int64 TotalBytesBeforeSig; // bytes since opening unsigned char SigBits; // Signaling bits SignalTransition( const unsigned __int64& Total, unsigned char Sig ) : TotalBytesBeforeSig(Total), SigBits(Sig) {} };
bool bWait
- (default true) wait till all the specified bytes are transmitted
bool bClearTransions- true clears the SigTransitions list first, false just appends new transitions Returns: number of data bytes received and discarded
145
list<SignalTransition> TransitionHistory; // non-blocking clear transitions pBios->ReadSigBits( Length, SigTransitions, false ); for ( list<SignalTransition>::iterator it = TransitionHistory.begin(); it != TransitionHistory.end(); it++ ) { printf( "A=%c B=%c C=%c D=%c BytesBeforeSigTransitionMF = %I64u\n", (*it).SigBits & 0x80 ? '1' : '0', (*it).SigBits & 0x40 ? '1' : '0', (*it).SigBits & 0x20 ? '1' : '0', (*it).SigBits & 0x10 ? '1' : '0', (*it).TotalBytesBeforeSig ); }
4.133.3 Setting Signalling Bits for the Subsequent Signalling or Data+Signalling Transmission
bool SetSigBits( unsigned char SigBits) Prerequisite: the BioStreamEx instance must be created with single timeslot set in the write channel mask parameter and read channel mask set to zero. Parameters: unsigned char SigBits - signalling bits to be set for the subsequent transmission of signalling bits only or data and signalling. Signaling bits correspond to the following bit masks in the SigBits byte: A - 0x80, B - 0x40, C - 0x20, D - 0x10
Returns:
{
- true if successful
unsigned char SigBits = 0xF0; BioStreamEx Bios( &Ifc, SelectedDeviceNo, 0, TsMask ); // open for writing Bios.SetSigBits( SigBits ); Bios.WriteSigBits(); // write and wait till xmitted // or Bios.WriteSigBits( SigBits, true ) // instead of two calls SetSigBits+WriteSigBits(true); }
146
4.133.4
bool WriteSigBits(bool fWaitTillXmitted = true ) Prerequisite: the BioStreamEx instance must be created with single timeslot set in the write channel mask parameter and read channel mask set to zero. Parameters: bool fWaitTillXmitted - true waits several milliseconds to guaranty the signalling bits set by SetSigBits were transmitted. If false is specified, the function returns immediately, but if the BioStreamEx object is destroyed before signalling bits are processed, new signalling bits are not transmitted. Returns:
{ unsigned char SigBits = 0xF0; BioStreamEx Bios( &Ifc, SelectedDeviceNo, 0, TsMask ); // open for writing Bios.WriteSigBits( SigBits, true ); }
- true if successful
4.133.5
DWORD WriteDataAndSigBits(PBYTE pInBuffer, DWORD Length, bool bWait = true, bool bContinuous = true ); Prerequisite: the BioStreamEx instance must be created with single timeslot set in the write channel mask parameter and read channel mask set to zero. Signalling bits set by SetSigBits are transmitted along with data. No signalling transition will be possible until data is transmitted. Parameters: PBYTE pInBuffer DWORD Length bool bWait bool bContinuous Returns: - user supplied buffer to write from - bytes to write - true(default) write in the blocking mode (return after all requested bytes are written), false write only bytes that are available for transmission - true(default) write continuously, false write so driver can transmit them as soon as possible
DWORD bytes written. If an error, typically an overrun error occurs, the function throws an exception
147
To control time of the signalling transitions calculate amount of data transmitted and set bWait parameter to true to ensure all data bytes are transmitted:
SetSigBits( Sig1); // set initial signalling bits WriteDataAndSigBits( Data1, Data1Length, true ); // Data1Length specifies // time before the next signalling transition SetSigBits( Sig2); // set initial signalling bits WriteDataAndSigBits( Data2, Data2Length, true ); // data with new signalling SetSigBits(Sig3); WriteSigBits();
148
4.134 SigBitsAsyncIo Class. Receiving and Transmitting Signaling Bits only on Multiple Channels
The class has a higher level interface than BioStreamEx to the signaling bits. It also provides a thread for receiving signaling bits making application design simpler.
4.134.1
SigBitsAsyncIo Constructor
DWORD MaxQueuedSignals maximum number of signals to queue for receiving. Default is 64K.
149
SigBitsAsyncIo SigBitsAsyncRd; SigBitsAsyncIo SigBitsAsyncWr; assert( !SigBitsAsyncRd.open( &Ifc, SelectedDeviceNo, NoOfChannels == 24 ? 0xFFFFFF00 : 0xFFFFFFFF ) ); assert( !SigBitsAsyncWr.open( &Ifc, SelectedDeviceNo, NoOfChannels == 24 ? 0x55555500 : 0x55555555 ) );
4.134.3
void close();
4.134.4
Parameters:
The TimeStamp provides the time of transition with 100 nanoseconds resolution. The following function can be used to convert the time to the displayable time format:
void FormatSystemTime( const unsigned __int64& Time, // time to format char* pszFormattedTime ) // output of formatted time { unsigned __int64 mkSec; unsigned __int64 Sec; unsigned __int64 HH; unsigned __int64 MM; SYSTEMTIME systime;
150
mkSec = ( Time % 10000000 ) / 10; FileTimeToSystemTime( (LPFILETIME)&Time, &systime ); HH = systime.wHour; MM = systime.wMinute; Sec = systime.wSecond; sprintf( pszFormattedTime, "%I64u:%02I64u:%02I64u.%06I64u", HH, MM, Sec, mkSec ); }
DevNo specifies the device number ( 1 relative ) StartTs specifies the zero relative timeslot where signaling transition took place Signal specifies the signal in the first bits ( 0x80 A bit, 0x40 B bit etc ) DWORD WaitMs Returns: - time in milliseconds to wait ( 0 return immediately )
true if a signaling transition occurred in at least one timeslot selected in the open function.
4.134.5
bool write( unsigned char signal ) Parameters: ] unsigned char signal - signal to transmit on all timeslots specified in open. true if a signaling transition occurred in at least one timeslot selected in Signalling bits correspond to the following bit masks in the SigBits byte: A - 0x80, B - 0x40, C - 0x20, D - 0x10 Returns: true success
4.134.6
When SigBitsAsyncIo object is opened for xmitting a number of BioStreamEx objects are created one per each selected timeslot. The following function provides a direct access to these objects enabling individual control: list<BioStreamEx*>& GetBioStreamExList() Parameters: Returns: none STL list of pointers to the opened BioStreamEx objects handling individual timeslots.
151
4.134.7
When the SigBitsAsyncIo object is opened for reading and event is created that is signaled each time an unread signaling transition is queued for read-ing. An application can wait for the signaling transition on any of the selected timeslots along with waiting for some other event using WaitForMultipleObjects(Ex) API. If an application needs to wait just for signaling transition an easier way is just to use the bloking read function specifying INFINITE waiting period. HANDLE GetQueuedEventHandle() Parameters: none Returns: HANDLE of the event that is signaled when new signaling transitions are Queued. The SigBitsAsyncIo must be open for reading.
4.134.8
DWORD GetQueuedSignals() Parameters: none Returns: number of queued signaling transitions available to be read
4.134.9
DWORD GetSkippedSignals () Parameters: none Returns: number of skipped signals that will increment when the application does not issue read and the maximum size of the signaling transition queue is exceeded.
4.134.10
DWORD GetOverUnderRuns() Parameters: none Returns: number of underruns encountered during reading
152
153
4.136.1
BitStream() Parameters: none Returns: Nothing
BitStream Constructors
BitStream(BYTE BitMask, bool bInvert = false); Parameters: BYTE BitMask - specifies subchannels to use, 0xFE for example should be specified for 56 kbps. Bits MUST be consecutive. 0x3C, for example, is correct, 0x3D is incorrect. bool bInvert - false no bit inversion, true inverts bits in each byte, so byte 0x80 becomes 0x01 Returns: Nothing
154
4.136.2
void SetBitMask( BYTE BitMask ) Sets subchannel bit mask. This method also resets the stream. Parameters: BYTE BitMask - specifies subchannels to use, 0xFE for example should be specified for 56 kbps. Bits MUST be consecutive. 0x3C, for example, is correct, 0x3D is incorrect. Returns: Nothing
4.136.3
BYTE GetBitMask() This method returns bit mask set in constructor or in the SetBitMask method Parameters: none Returns: BYTE - subchannels bit mask used, 0xFE for 56 kbps
4.136.4
void SetInvert( bool bInvert ) This function sets or unsets bit inversion. The inversion produces output stream with bits inverted the most significant bit (MSB) in each byte becomes the least significant bit (LSB), for example byte 0x82 becomes 0x41 ( read bits right to left instead left to right ) Parameters: bool bInvert - true sets inversion, false - no inversion Returns: Nothing
155
4.136.5
bool GetInvert() Gets current inversion setting Parameters: none Returns: bool - true inversion is set, false - no inversion
156
4.136.6
void Reset()
Resetting Stream
This function interrupts continuous stream and starts it again. Parameters: none Returns: Nothing
4.136.7
Reading Stream
DWORD Extract( PBYTE pInp, DWORD InpLen, PBYTE pOut, DWORD OutLen ) This method extracts data from input stream (concatenation of timeslot(s) values usually produced by BioStream class according to bit mask and puts integral number of bytes in the output buffer. The method remembers incomplete bits and will put them first on the following Extract call before putting new bits. Parameters: PBYTE pInp DWORD InpLen PBYTE pOut DWORD OutLen Returns: DWORD - input buffer pointer - input buffer length - output buffer pointer - output buffer length, should be large enough to accommodate all the data including up to 7 bits that may have been left from previous call - number of bytes in the output buffer.
4.136.8
BYTE GetPayloadBitCount() Gets number of 8 kbps subchannels used Parameters: none Returns: BYTE - Number of subchannels used 1..8. For example, for mask 0xFE the returned value will be 7. 157
4.137.1
Constructor
OutBitStream(BYTE BitMask = 0, bool bInvert = false, bool bFillerOne = false) Parameters: BYTE BitMask - sets the 8 kbps subchannels used, specify 0xFE for 56 kbps bool bInvert bool bFillerOne true MSB to LSB invert, on byte by byte basis, so 0x80 becomes 0x01 true fill in bits correspondent to zero bits in the BitMask with ones, false (default) fill in bits correspondent to zero bits in the BitMask with zeroes.
4.137.2
Parameters:
void Init( BYTE BitMask, bool bInvert = false, bool bFillerOne = false )
BYTE BitMask
- sets the 8 kbps subchannels used, specify 0xFE for 56 kbps. Bits set to one define what output bits used when input bits are copied to output true MSB to LSB invert, on byte by byte basis, so 0x80 becomes 0x01 true fill in bits correspondent to zero bits in the BitMask with ones, false (default) fill in bits correspondent to zero bits in the BitMask with zeroes.
4.137.3
Parameters: Returns:
BYTE GetBitMask()
4.137.4
Parameters: Returns:
Get Inversion
none bool - true class set to invert MSB->LSB so 0x80 becomes 0x01
bool GetInvert()
4.137.5
Parameters: Returns:
bool GetFiller()
159
4.137.6
DWORD Put( PBYTE pInp, DWORD InpLen, PBYTE pOut, DWORD OutLen ) This function writes each input bit to the output stream bytes in the positions defined by ones in the bit mask. The output bits correspondents to the zero bits in the mask are filled with zeroes or ones depending on the filler flag. When several subchannels need to be multiplexed in an output timeslots, the filler flag should be false and two objects must be used. The output byte strings from these two objects should be then OR-ed to produce merged string.
For example, Input string=0x4A3BFE, BitMask=0xF0, Filler=false yield output=0x40A030B0F0E0 Input string=0x4A3BFE, BitMask=0xF0, Filler=true yield output=0x4FAF3FBFFFEF Input string=0x4A, BitMask=0x80, Filler=false yield output=0x0080000080008000
The output always has integral number of bytes. Carry over bits will be put at the beginning of the output buffer on the successive Put call. Parameters: PBYTE pInp DWORD InpLen PBYTE pOut DWORD OutLen - pointer to the input bytes - input length in bytes - pointer to output buffer, that should be large enough - output buffer length, must be large enough to accommodate all the input bits, OutLen >= ( InpLen + 2 ) * 8 / BitsInMask
Returns:
BioStream* pBios; OutBitStream Obs( 0xFE, false, false ); // 56 kbps, no inversion, filler zeroes DWORD OutLen = Obs.( (PBYTE)TempBuf, TempLen, OutBuf, OutLen ); // Make stream DWORD ActLen = pBios->Write( OutBuf, OutLen, false ); // Actually write to line
160
- (INPUT/OUTPUT) output buffer length. The output buffer should be large enough to accommodate stuffed bits ( 6 * InLen / 5 + flagCount ) DWORD& RemBits - (INPUT/OUTPUT) this parameter is used to remember the number of carry-over bits. Initially it should be multiple of 8 specifying the number of flags ( preceeding flags * 8 ). On the successive calls it add 8 * extraFlags if more than one flag should be put before each frame. Add nothing if just one flag. Returns: BitRemove
DWORD RemBits = InitialFlags * 8; MsbStuffBits( pInRecord, // pointer to input buffer to stuff 0, // just flags pOutBuf, OutLen, RemBits); // MsbStuffBits( pInRecord, // pointer to input buffer containing original frame InLength, // frame length pOutBuf, OutLen, RemBits+8*1); // One extra flag ( two flags before frame )
nothing
161
4.139.1
Parameters:
BitRemove Constructor
DWORD MaxFrameSize - maximum frame size, should not exceed 16K. It is recommended to use default value, i.e. specify no parameter.
4.139.2
DWORD parse( PBYTE pInpBuffer, DWORD InpLength, PBYTE pOutFrames, DWORD OutLength) Parameters: PBYTE pInpBuffer - pointer to the input buffer DWORD InpLength - input buffer length PBYTE pOutFrames - output buffer to fill with frames DWORD OutLength - bytes available in the output buffer, should be large enough to contain output frames with bits removed and header information Returns: DWORD - if OK, error code if failed The output buffer is filled with the output frames and malformed frames if any. The normal frames have zero bits removed, malformed frames include stuffed bits to help diagnosing the problem. The frames comprise a list using the following data structure at the beginning:
struct BrOutputList { DWORD pFrameCount; DWORD pErrFrameCount; BrOutputFrame OutputFrames; };
162
Followed by frames:
struct BrOutputFrame { unsigned __int64 TotalInputBytesBeforeFrame; // Since reset or initialization DWORD Length; // Data length bool bOkFrame; // true when OK, false - malformed BYTE OffsErrFrameStartBit; // Offset where the first bit of malformed // frame started BYTE reserved1; BYTE reserved2; BYTE Data[1]; // Data };
BitRemove Br; Br.parse( pInpBuf, InputBufLen, pOutBuf, OutBufLen ); BrOutputList* pList = (BrOutputList*)( pOutBuf ); BrOutputFrame* pFr = &pList->OutputFrames; TotalFrCount += pList->pFrameCount + pList->pErrFrameCount; DWORD Time = pFr->TotalInputBytesBeforeFrame * 125 / Channels; // Time in mkS while ( bNotEndOf Frames ) { BrOutputFrame* pFrame = pFr; size_t len = pFrame->Length; if ( pFrame->bOkFrame) { BYTE Crc[2]; CalculateCrc( pFrame->Data, len, Crc ); if ( Crc[0] == 0xE2 && Crc[1] == 0xF0 ) Trec.ErrorFlag = 0; else Trec.ErrorFlag = ErrorFlagCrc; } pFr = (BrOutputFrame*)&(pFr)->Data[pFr->Length]; // Next frame }
4.139.3
void clear();
Reset Input
Resets input, starts looking for the flags. Parameters: none Returns: nothing
163
4.139.4
Get Statistics
void getCounts( uint64& TotalInpBytes, uint64& TotalOutputBytes, uint64& TotalFrames, uint64& TotalFlags, uint64& DiscardedFrames) Parameters: uint64& TotalInpBytes uint64& TotalOutputBytes uint64& TotalFrames uint64& TotalFlags - returns total input bytes processed so far - returns total output bytes produced so far - returns total frames produced so far - returns total flags encountered
4.139.5
Set Counters
void setCounts( uint64 TotalInpBytes, uint64 TotalOutputBytes, uint64 TotalFrames, uint64 TotalFlags, uint64 DiscardedFrames) Parameters: uint64 TotalInpBytes uint64& TotalOutputBytes uint64& TotalFrames uint64& TotalFlags - total input bytes processed - total output bytes produced - total frames produced - total flags encountered
164
4.139.6
void resetCounts( uint64& TotalInpBytes, uint64& TotalOutputBytes, uint64& TotalFrames, uint64& TotalFlags, uint64& DiscardedFrames) This method first gets the statistics as getCounts and then resets all counters to zero Parameters: uint64& TotalInpBytes uint64& TotalOutputBytes uint64& TotalFrames uint64& TotalFlags - returns total input bytes processed so far - returns total output bytes produced so far - returns total frames produced so far - returns total flags encountered
165
4.140.1
Constructor
FdlStream( GlComInterface* pIfc, BYTE DeviceNo, BYTE ReadSubchannelMask, BYTE WriteSubchannelMask ) Parameters: GlComInterface* pIfc BYTE DeviceNo BYTE ReadSubchannelMask - pointer to the device drive interface object - one relative device number to read/write - defines what to read: FDL and/or FPS and or CRC bits for ESF Ft/Fs for D4 The following masks are defined for ESF: FdlEsfMaskData FdlEsfMaskCrc FdlEsfMaskFps FdlEsfMaskAll The following bit masks are defined for D4: FdlD4MaskTerminal FdlD4MaskSignal FdlD4MaskAll - defines what to write: FDL and/or FPS and or CRC bits Ft/Fs for D4
BYTE WriteSubchannelMask
166
The following masks are defined for ESF: FdlEsfMaskData FdlEsfMaskCrc FdlEsfMaskFps FdlEsfMaskAll The following bit masks are defined for D4: FdlD4MaskTerminal FdlD4MaskSignal FdlD4MaskAll
167
BYTE WriteSubchannelMask
Returns: nothing
168
4.141.1
void SetReadSubchannelMask( BYTE SubchannelMask ) Sets a new read mask and resets subchannel mask Parameters: BYTE SubchannelMask - defines what to read: FDL and/or FPS and or CRC bits for ESF Ft/Fs for D4 The following masks are defined for ESF: FdlEsfMaskData FdlEsfMaskCrc FdlEsfMaskFps FdlEsfMaskAll The following bit masks are defined for D4: FdlD4MaskTerminal FdlD4MaskSignal FdlD4MaskAll
Returns:
nothing
4.141.2
void SetWriteSubchannelMask( BYTE SubchannelMask ) Sets a new write mask and resets subchannel mask Parameters: BYTE SubchannelMask - defines what to write: FDL and/or FPS and or CRC bits for ESF Ft/Fs for D4 The following masks are defined for ESF: FdlEsfMaskData FdlEsfMaskCrc FdlEsfMaskFps FdlEsfMaskAll The following bit masks are defined for D4: FdlD4MaskTerminal FdlD4MaskSignal FdlD4MaskAll
Returns:
nothing
169
4.141.3
Sets safe margins for reading to avoid driver underrun condition void SetReadSafeMarginMultiFrames( DWORD MultiFrames ) Parameters: DWORD MultiFrames Returns: nothing - safe margins in multiframes, recommended value is at least 12 multiframes
It is recommended to use default values, i.e. do not call this function at all
4.141.4
Sets safe margins for reading to avoid the driver overrun condition void SetWriteSafeMarginMultiFrames( DWORD MultiFrames ) Parameters: DWORD MultiFrames Returns: nothing - safe margins in multiframes, recommended value is at least 12 multiframes
It 's recommended to use default values, i.e. do not call this function at all
4.141.5
Sets safe margins for reading to avoid the driver underrun condition void SetReadSafeMarginBytes( DWORD Bytes ) Parameters: DWORD Bytes - safe margins in multiframes, recommended value is at least 36 bytes Returns: nothing
It 's recommended to use default values, i.e. do not call this function at all
170
4.141.6
Sets safe margins for reading to avoid the driver overrun condition void SetWriteSafeMarginBytes( DWORD Bytes ) Parameters: DWORD Bytes Returns: - safe margins in multiframes, recommended value is at least 36
nothing
It is recommended to use default values, i.e. do not call this function at all
4.141.7
DWORD GetReadBitsPerQuadFrame() Parameters: none Returns: Used bits for reading per each four frames according to the bit mask
4.141.8
DWORD GetWriteBitsPerQuadFrame() Parameters: none Returns: Used bits for writing per each four frames according to the bit mask
171
4.141.9
4.141.10
4.141.11
void Reset()
Reset Stream
4.141.12
Read Stream
DWORD Read(PBYTE pOutBuffer, DWORD Length, bool bWait = true ) Read only bits specified by the mask, concatenating them into output byte buffer Parameters: PBYTE pOutBuffer - buffer pointer to read into DWORD Length bool bWait Returns: - bytes to read - true to wait until all the requested bytes read (default) otherwise return immediately placing only available bytes into user buffer DWORD - bytes actually read
Function always places integral number of bytes in the buffer supplied by caller
172
4.141.13
Write Stream
Write only bits specified by the mask DWORD Write(PBYTE pInBuffer, DWORD Length, bool bWait = true, bool bContinuous = true ) Parameters: PBYTE pInBuffer DWORD Length bool bWait bool bContinuous Returns: - pointer to input bytes to write - bytes to write - true wait until all the bytes are written (default), false - return immediately placing as many bytes as possible - true write a continuous stream (default), false write bursty bytes (rarely used)
4.141.14
void ReopenRead() Resets stream for reading. Parameters: none Returns: nothing
4.141.15
void ReopenRead() Resets stream for writing. Parameters: none Returns: nothing
173
4.141.16
void Reopen(bool bRead=true, bool bWrite=true) Resets stream for reading and/or writing. Parameters: bool bRead bool bWrite Returns: - true reopens for reading ( resets input stream) - true reopens for writing ( resets output stream) nothing
4.141.17
void SyncOpenRead() Is used when multiple cards must be synchronized. This function is then called for each card's FdlStream object. Parameters: none Returns: nothing
174
4.142.1
MemFile()
Constructors
- does nothing, need to call Init function to enable the object
MemFile(LPCTSTR pszFileName, DWORD& Size, PBYTE& pMem, bool bWriteAccess = true ) Opens a file for reading or creates a file for writing, initializes the memory pointer so caller can read or modify the file using this pointer. Parameters: LPCTSTR pszFileName DWORD& Size PBYTE& pMem bool bWriteAccess - file name to read or write to - mapped file size ( input parameter for writing, returned file size when opened for reading) - returned pointer to memory if file mapped successfully - true (default) create/replace file for writing, false - open existing file for reading
When opening a file for writing set size large enough to accommodate all the bytes. The unused bytes can be later trimmed before closing the file using SetEndOfFile method.
175
4.142.2
bool Init(LPCTSTR pszFileName, DWORD& Size, PBYTE& pMem, bool bWriteAccess = true ) Opens a file for reading or creates a file for writing, initializes the memory pointer so caller can read or modify the file using this pointer. Parameters: LPCTSTR pszFileName DWORD& Size PBYTE& pMem bool bWriteAccess Returns: - file name to read or write to - mapped file size ( input parameter for writing, returned file size when opened for reading) - returned pointer to memory if file mapped successfully - true (default) create/replace file for writing, false - open existing file for reading true - success, otherwise failed
When opening a file for writing set size large enough to accommodate all the bytes. The unused bytes can be later trimmed before closing the file using SetEndOfFile method.
4.142.3
void Close()
Close File
Closes file. If file is opened for writing and not all bytes are used call SetEndOfFile function to trim unused bytes at the end of file. Parameters: none Returns: nothing
176
4.142.4
void SetEndOfFile( PBYTE pMemEnd ) This method should be called for files opened for writing when there are unused bytes at the end of the file. The file size is truncated to include only useful bytes. Parameters: PBYTE pMemEnd - points to a byte immediately following the last byte to be written to file Returns: nothing
4.142.5
void SetEndOfFile( DWORD FileSize ) This method should be called for files opened for writing when there are unused bytes at the end of the file. The file size is truncated to include only useful bytes. Parameters: DWORD FileSize - size to truncate file to. This will be the size of the file after it's closed. Returns: nothing
4.142.6
bool IsOpen()
177
4.143.1
VarRecBuf( )
Constructors
Does nothing, requires Init() function to enable the object VarRecBuf( PBYTE pBuffer, DWORD BufSize ) Parameters: PBYTE pBuffer DWORD BufSize - buffer pointer to use - buffer size
4.143.2
Initialization
bool Init( PBYTE pBuffer, DWORD BufSize ) This function is required if the VarRecBuf() constructor is invoked to initialize the object Parameters: PBYTE pBuffer DWORD BufSize Returns: - buffer pointer to use - buffer size - true successful completion, false otherwise
4.143.3
void Close()
Close
178
4.143.4
Append a Record
DWORD AddRecord( PBYTE pRec, DWORD RecLen ) Adds a byte string (record) at the end of the list Parameters: PBYTE pRec DWORD RecLen Returns: - pointer to the byte string to add - length of the byte string to add
4.143.5
DWORD AddTwoPartRecord( PBYTE pHead, DWORD HeadLen, PBYTE pTail, DWORD TailLen ) Two parts are concatenated and appended to the end of the list Parameters: PBYTE pHead DWORD RecLen PBYTE pTail DWORD TailLen Returns: - pointer to the byte string to place at the beginning of the record - length of the byte string to place at the beginning of the record - pointer to the byte string to place at the end of the record - length of the byte string to place at the end of the record
179
4.143.6
bool GetRecord( DWORD RecNumber, PBYTE& pRecord, DWORD& RecLength) Gets pointer and length to the record data by record number ( array type access ). Parameters: DWORD RecNumber PBYTE& pRecord DWORD& RecLength Returns: - zero relative record number to get - returns pointer to the record - returns length of the record
Sets current record pointer that can be used for next/previous record access
4.143.7
bool GetNextRecord( PBYTE& pRecord, DWORD& RecLength) Retrieves next record, i.e. record that follows lately retrieved Parameters: PBYTE& pRecord DWORD& RecLength Returns: - returns pointer to the record - returns length of the record
Sets current record pointer that can be used for next/previous record access
180
4.143.8
bool GetPrevRecord( PBYTE& pRecord, DWORD& RecLength) Retrieves previous record, i.e. record that preceeds the record lately retrieved Parameters: PBYTE& pRecord DWORD& RecLength Returns: - returns pointer to the record - returns length of the record
Sets current record pointer that can be used for next/previous record access
4.143.9
DWORD GetRecordCount() Parameters: none Returns: DWORD number of records in the list
4.143.10
181
4.143.11
bool Flush()
Flushes MemFile to disk. Used to control when disk i/o should happen to equalize the disk activity Parameters: none Returns: bool - true if successful
4.143.12
void Clear()
4.144.1
Constructors
DynamicListBuf( DWORD InitialBufSize = 4096 ) Allocates buffer of the initial size Parameters: DWORD InitialBufSize - initial buffer size DynamicListBuf( const DynamicListBuf& BaseObj ) Copy constructor
DynamicListBuf b1; DynamicListBuf b2(b1);
182
4.144.2
Assignment Operator
4.144.3
Parameters:
Appending a Record
4.144.4
bool first(const BYTE*& pItem, DWORD& Length, DWORD& Offset) const Retrieves the first record pointer and length Parameters: const BYTE*& pItem DWORD& Length DWORD& Offset Returns: - returned pointer to the record data - returned length of the record
- offset to be used to call next method to retrieve the next record - true record retrieved, false - empty buffer
183
4.144.5
bool next(const BYTE*& pItem, DWORD& Length, DWORD& Offset) const Retrieves the next record pointer and length Parameters: const BYTE*& pItem DWORD& Length DWORD& Offset Returns: - returned pointer to the record data - returned length of the record
- offset to be used to call next method to retrieve the next record - true record retrieved, false - end of the list has been reached
4.144.6
void erase()
Deletes all the records from the list Parameters: none Returns: - nothing
4.144.7
DWORD size() const Parameters: none Returns: DWORD total size of all records' data
4.144.8
bool isEmpty() const Parameters: none Returns: bool true if list is empty, false if it contains records
184
4.144.9
DWORD count() const Parameters: none Returns: DWORD number of records in the list
4.146.1
void InvertBits( PBYTE pMsg, int Length ) Each byte of the input buffer is inverted MSB->LSB Parameters: PBYTE pMsg int Length Returns: - pointer to the byte string to invert - byte string length nothing
185
4.146.2
Invert a Byte
BYTE InvertBits( BYTE InpByte) Invert a byte MSB->LSB Parameters: BYTE InpMsg Returns: - byte to invert
4.146.3
void InvertBits( const BYTE* pInpBuf, int Length, PBYTE pOutBuf ) Copies input string to output inverting each byte MSB->LSB Parameters: PBYTE pInpBuf int Length PBYTE pOutBuf Returns: - pointer to the byte string to invert - byte string length - pointer to output buffer of length Length where to place inverted string
nothing
186
4.147.1
Constructor
HdlcAsyncIo() Parameters: None Parameters are passed when the open method is invoked.
187
4.147.2
int open(
Opens the "frame queue" for Rx or Tx, speicifies device, timeslot mask and size of the queue. Parameters: GlComInterface* pIfc - pointer to the GlComInterface object
HdlcAsyncIoAccess AccessFlag - HdlcAsyncRead for Rx or HdlcAsyncWrite for Tx BYTE DevNo DWORD TsMask BYTE ScMask one relative device number ( <= GetNoOfDevicesInstalled() ) - timeslot mask. 0x80000000, for example, specifies timeslot 0, 0xC0000000 specifies 128kbps stream on timeslots 0-1 must be 0xFF
DWORD MaxQueuedBytes - Rx or Tx queue size. The default is 1MB Returns: 0 - opened successfully 100x - invalid parameter x, 1002 if neither read nor write is specified 1003 usually when the timeslots are already used for transmission
188
Depending on the AccessFlag the Rx or Tx thread and queues are created and the application need to issue read or write to process frames. Separate HdlcAsyncIo instances must be used for receiving and transmitting. Examples:
try { GlComInterface Ifc; // Device driver interface object printf("0\n"); Ifc.Initialize( true, GL_CARD_TYPE_DPCI_DMA ); // true to set default hardware settings unsigned char Frame[4] = { 5, 6, 7, 8 }; printf("1\n"); HdlcAsyncIo hr; HdlcAsyncIo hw; if ( hr.open( &Ifc, HdlcAsyncRead, 1, 0x40000000 ) ) // read ts 1 return 11; if ( hw.open( &Ifc, HdlcAsyncWrite, 1, 0x20000000 ) ) // write ts 2 return 12; }
4.147.3
Transmitting Frames
bool write( const BYTE* pData, DWORD length, bool fAddCrc = false ) Parameters: const BYTE* pData - pointer to frame octets to transmit DWORD length - number of octets to transmit
bool fAddCrc = false add crc to the frame octets, default is false, i.e. CRC (FCS) is already included in the length, otherwise the function calculates CRC and appends it to the frame. When fAddCrc = true, the total frame length becomes length + 2 Returns: true if frame is queued successfully false if the HdlcAsyncIo object was opened for reading, parameters of the functions are incorrect or the queue limits are exceeded ( application writes too fast )
The write function does not actually transmit frames. It just queues frames for transmission. The Tx thread constantly removes frames from the Tx queue and transmits them placing flags between frames. If there are no frames queued for transmission the Tx thread transmitts flags. 189
If application invokes the write method faster than the frames are transmitted the queue size grows until it reaches the limit. Further frames will be discarded until some frames from the queue are transmitted and removed by Tx thread and the "skip" counter is incremented. When queue size grows, so increases the time between the frame is submitted for transmission by the write method and the time when the frame is actually transmitted.
4.147.4
Parameters:
Receiving Frames
- pointer to frame octets, application must release these memory using delete [] pData when frame is no longer needed - length of the frame including CRC (FCS) bytes milliseconds to wait if no frames are queued by the Rx thread. Default is INFINITE, i.e. blocking read. If wait times expires and still no frames received function returs false and pData is set to 0
Returns:
true - frame received, false - no frame received and/or timeout has expired
If application calls the read function slower than frames are received by the Rx thread, the frames are queued until the queue limit has been reached. When the queue limit has been reached, new frames are discarded by the Rx thread and "skip" counter is incremented.
190
4.147.5
bool read( BYTE*& pData, DWORD& length, HdlcFrameInfo& FrameInfo, DWORD WaitMs = INFINITE ) Parameters: BYTE*& pData DWORD& length - (out) pointer to frame octets, application must release these memory using delete [] pData when frame is no longer needed - (out) length of the frame including CRC (FCS) bytes
HdlcFrameInfo& FrameInfo - (out) extended frame information: timing, time slot, error etc. DWORD WaitMs milliseconds to wait if no frames are queued by the Rx thread. Default is INFINITE, i.e. blocking read. If wait times expires and still no frames received function returs false and pData is set to 0
Returns:
true - frame received, false - no frame received and/or timeout has expired
If application calls the read function slower than frames are received by the Rx thread, the frames are queued until the queue limit has been reached. When the queue limit has been reached, new frames are discarded by the Rx thread and "skip" counter is incremented.
4.147.5.1 HdlcFrameInfo
This structure is returned with each frame by the read function and contains the following information:
struct HdlcFrameInfo { BYTE TimeStamp[8]; unsigned char DevNo; unsigned char fSubchannelsUsed : 1; unsigned char TimeslotForSubchannels : 5; unsigned char StartTs : 5; // start ts or subchannel unsigned char EndTs : 5; // end ts or subchannel BYTE ErrorFlag; };
191
TimeStamp is 64 bit integer containing number of 100s of nanoseconds since the receive (Rx) thread has started. The difference in timestamps between any two frames is very accurate. To calculate number of microseconds between two frames, for example, HdlcFrameInfo Tstamp1; HdlcFrameInfo Tstamp2; // __uint64 DiffTimeMks = ( *( (__uint64*)Tstamp2.TimeStamp ) - *( (__uint64*)Tstamp1.TimeStamp ) ) / 10; DevNo - device number ( 1 relative ) StartTs - beginning timeslot number ( 0 relative ) EndTs - ending timeslot number ( 0 relative ) For 64 kbps ( one channel ) StartTs == EndTs ErrorFlag - is zero if zero bit removal was successful and CRC is correct. Otherwise, the flag is set to ErrorFlagMalformed or ErrorFlagCrc accordingly.
4.147.6
The following example loops back frames received on one chanel and transmitting the frames on another channel.
try { GlComInterface Ifc; // Device driver interface object printf("0\n"); Ifc.Initialize( true, GL_CARD_TYPE_DPCI_DMA ); // true to set default hardware settings HdlcAsyncIo hr; HdlcAsyncIo hw; if ( hr.open( &Ifc, HdlcAsyncRead, 1, 0x40000000 ) ) return 11; if ( hw.open( &Ifc, HdlcAsyncWrite, 1, 0x20000000 ) ) return 12; Sleep(0); PBYTE pData; DWORD DataLen; //DWORD TotalLen = 0; for ( ;; ) { if ( hr.read( pData, DataLen, 1000 ) ) { hw.write( pData, DataLen, false ); delete [] pData; } } return 0; }
192
/********************************************************************/ /* Process exceptions. All clients MUST use this error processing. */ /********************************************************************/ catch (GlComExceptions exception) { printf( "Last error: %s\n", GlcGetLastErrorMsg() ); printf( "Driver interface error. Exception description: %s\n", GetExceptionDescription( exception ) ); return 11; } catch ( DWORD lastError ) { printf( "Last error: %s\n", GlcGetLastErrorMsg() ); printf( "Driver error. GetLastError() = %lu\n", lastError ); return 12; } catch (...) { printf( "Last error: %s\n", GlcGetLastErrorMsg() ); printf("Unexpected internal error\n"); return 13; }
4.147.7
void close()
Terminates the Rx or Tx tread. No read or write function can be invoked when the object is "closed". Parameters: none Returns: nothing
4.147.8
Retrieves total number of frames queued by the Rx thread for receive object but not retrieved by application by recv function, or the total number of bytes queued for transmission but not transmitted yet. DWORD GetQueuedBytes() Parameters: none Returns: Total number of bytes in all the frames currently placed in the Rx or Tx queue. If the application submitting frames for transmission too fast using write function or the application is too slow to retrieve the frames by using read function the returned value increases till it reaches the limit specified in the open function. After this limit point the 193
new received or submitted for transmission frames will be discarded and GetSkippedFrame and GetSkippedBytes functions will return number of discarded frames and bytes accordingly.
4.147.9
DWORD GetCrcCount() Parameters: none Returns: Total number of CRC errors in the received frames since open
4.147.10
DWORD GetMalformedCount() Parameters: none Returns: Total number of malformed frames received since open
4.147.11
WORD GetOverUnderRuns() Parameters: none Returns: Total number of underruns or overruns since open
This count is incremented if the system is very busy and the Rx or Tx threads do not get enough time by Windows thread scheduler.
4.147.12
When application is calling write too fast or read too slow the Tx or Rx queue reaches the limit and some frames are discarded. The number of discarded bytes is counted and returned by this function. DWORD GetSkippedBytes() Parameters: none Returns: Total number of discarded bytes in discarded frames
194
4.147.13
When application is calling write too fast or read too slow the Tx or Rx queue reaches the limit and some frames are discarded. The number of discarded frames is counted and returned by this function. DWORD GetSkippedFrames() Parameters: none Returns: Total number of discarded frames
4.147.14
By default the minimum number of flags between transmitted frames is 2, hower the minimum number of flags between frames can be set to any positive value. void SetTxMinFlags( DWORD Flags ) Parameters: DWORD Flags - minimum number of flags to insert between transmitted frames Returns: Nothing
4.147.15
Retrieves the number of flags between transmitted frames DWORD GetTxMinFlags() Parameters: none Returns: - minimum number of flags to insert between transmitted frames
195
DisableSoundDriver(),IsSoundDriverEnable()
EnableSoundDriver(),IsSoundDriverEnable()
196
197
Parameters: BYTE DeviceNo DWORD IoCtlCode DWORD& Parm1 DWORD& Parm2 Returns:
This function is for HD cards only and will cause an exception for other card types
The following table contains the details for different IoCtlCode functions: IoCtlCode Parm1 Parm2 VXD_GetTxBERInversion 1 inversion on, 0 off Not used
VXD_GetRxBERInversion VXD_GetTxBERPattern VXD_GetRxBERPattern 0 - QRSS pattern 1 - 2^6-1 pattern 2 - 2^9 -1 pattern 3 - 2^11 -1 pattern 4 - 2^15-1 pattern 5 - 2^20-1 pattern 6 - 2^23-1 pattern 7 Static patterns
Not used
VXD_GetTxStaticPattern VXD_GetRxStaticPattern VXD_GetTxBERBitMask VXD_GetRxBERBitMask VXD_GetFDLBuffers VXD_GetRxBERUnframed VXD_GetTxBERUnframed VXD_GetDataErrorInsertionMode VXD_GetVFMemoryInsertionMode VXD_GetRxBERTotalBits
Static bits Bit mask for BER 0x000000FF 64k (all bits) Pointer to FDL TX buffer 1 unframed enabled 0 unframed disabled 1 set error insertion 0 no error isertion 1 set data insertion 0 no data isertion Bits compared
Static bit count Not used Pointer to FDL RX buffer Not used Not used Not used Not used
198
Parameters: BYTE DeviceNo DWORD IoCtlCode DWORD Parm1 DWORD Parm2 Returns:
This function is for HD cards only and will cause an exception for other card types
The following table contains the details for different IoCtlCode functions: IoCtlCode Parm1 Parm2 VXD_SetTxBERInversion 1 inversion on, 0 off 0
VXD_SetRxBERInversion VXD_SetTxBERPattern VXD_SetRxBERPattern
VXD_SetTxStaticPattern VXD_SetRxStaticPattern VXD_SetTxBERBitMask VXD_SetRxBERBitMask VXD_SetFDLBuffers VXD_SetRxBERUnframed VXD_SetTxBERUnframed VXD_SetDataErrorInsertionMode VXD_SetVFMemoryInsertionMode VXD_SetRxBERTotalBits
0 - QRSS pattern 1 - 2^6-1 pattern 2 - 2^9 -1 pattern 3 - 2^11 -1 pattern 4 - 2^15-1 pattern 5 - 2^20-1 pattern 6 - 2^23-1 pattern 7 - Static patterns Static bits Bit mask for BER 0x000000FF 64k (all bits) Pointer to FDL TX buffer 1 unframed enabled 0 unframed disabled 1 set error insertion 0 no error isertion 1 set data insertion 0 no data isertion Bits compared
199
Parameters: none Returns: true (TRUE) if separate buffers are used (HD card), false other types
GetSeparateFdlBuffers
Parameters: BYTE DeviceNo - one relative device number - (out) returns pointer to two adjacent FDL TX buffers - (out) returns pointer to two adjacent FDL TX buffers
This function is for HD cards only and will cause an exception for other card types
isSeparateFdlBuf
200
Parameters: BYTE DeviceNo DWORD IoCtlCode Unsigned long Timeslot Returns: request information depending on the IoCtlCode
This function is for HD cards only and will cause an exception for other card types
- one relative device number - information type to get - zero relative timeslot number
The following table contains the details for different IoCtlCode functions: IoCtlCode Returns VXD_GetTxSignalingBits Tx signaling bits ABCD (D in least significant bit) VXD_GetRxSignalingBits Rx signaling bits ABCD (D in least significant bit) VXD_GetTxEnableSignalingBits 1 enabled, 0 disabled Table 21. GetSignalingInfo codes and parameters
Parameters: Returns:
This function is for HD cards only and will cause an exception for other card types
201
Parameters: BYTE DeviceNo unsigned long Timeslot unsigned long SigBits Returns:
This function is for HD cards only and will cause an exception for other card types
- one relative device number - zero relative timeslot number - ABCD bits (D in least significant bit) - nothing
- one relative device number - zero relative timeslot number - Tx ABCD signaling bits (D in least significant bit)
202
- one relative device number - zero relative timeslot number - Rx ABCD signaling bits (D in least significant bit)
4.163 Check if Tx Signaling Bits for a Timeslot are enabled for HD Cards
C++ C
bool IsTxSignalingEnabled( BYTE DeviceNo, unsigned long Timeslot) bool GlIsTxSignalingEnabled ( BYTE DeviceNo, unsigned long Timeslot)
- one relative device number - zero relative timeslot number - true if enabled, false otherwise
203
4.164.1
C++ C
4.164.2
C++
204
Parameters: PeriodicSaveFileNameType FileNameType type of continuous capture, sequential or date/time const char *SeqFileNamePrefix beginning of filename unsigned long SeqFileNameDigits - determines maximum # of files to capture, a value of 3 would mean that up to 1000 contiguous files would be captured, e.g., temp000, temp001, , temp999. const char *SeqFileNameSuffix extension of captured file const char *DateTimeFileNameSuffix extension of captured file const char *DateTimeFileNameMask a formatting string similar to the printf formatting string. Formatting codes, preceded by a percent (%) sign, are replaced by the corresponding time component. %Y year %M month %D day %H hour %I minute PeriodicSaveLimitType LimitType specify type of capture, size or time-based unsigned long SizeCountLimit maximum # of Bytes that each captured file can contain unsigned __int64 TimeLimit100ns duration of capture for each file, based on nanoseconds PeriodicSaveStopRecycleType StopRecycleType options include a. Unrestricted captures after the file with the highest sequence # is captured, the sequence # resets, and starts at zero b. Keep StopRecycleFilecount latest files c. Stop after StopRecycleFileCount files unsigned long StopRecycleFileCount - # of files that StopRecycleType limitations depend on unsigned long FileSeqNum use value of 0 unsigned long NextSeqDigits use value of 0 unsigned long CurrCountSizeValue use value of 0 const char *FileDirectory folder where captures are stored bool fEnableFiltering use value of false Returns: - nothing
205
4.164.3
C++
Parameters: GlComInterface *pIfc pointer to GlComInterface object DWORD RdChannelMask timeslot mask to specify which timeslots to capture DWORD DevMask device mask to specify which devices to capture DWORD BufferSize size of buffer that contains capture data bool ByteReversal indicates whether capture data should be reversed for each byte Returns: - nothing Remarks Sets timeslot and device capture parameters along with other initialization. This function must be called first.
4.164.4
C++ C
Remarks This function performs the creation of the filename and opens the files that data will be written to.
206
4.164.5
C++ C
Remarks This function will allocate the space required to capture the data.
4.164.6
C++ C
207
4.164.7
C++ C
Parameters: Unsigned long RemainingBytesToWrite - # of bytes left to write for the currently open file DWORD BioStreamBytesLeft # of bytes left in the biostream which have not yet been written to a file CAPMESSAGES &capmsg contains filecapture status info. The data may be displayed for user info. Returns: -nothing Remarks This function shuts down the capture process and closes all files.
4.164.8
C++ C
Parameters: - none Returns: Remarks This function shuts down the capture process and closes all files. - nothing
208
4.164.9
C++ C
Parameters: CAPMESSAGES **capmsg contains filecapture status information. The data may be displayed for user information. Returns: - nothing Remarks The control loop which continuously runs, reads, and writes data. This is the main mechanism of the CFileCapturingOperations object.
4.164.10
C++ C
Parameters: char *filename name of the filename being captured without the device string prepended to it Returns: -nothing Remarks Retrieves the filename of the file that captured data is being written to.
209
4.164.11
C++ C
Parameters: char *dirname name of the folder where captured sequentials are stored Returns: -nothing Remarks Retrieve the folder name where captured sequential files are being stored.
4.164.12
Clear Messages
void ClearMessages() N/A
C++ C
4.164.13
C++ C
Parameters: int initvalue initialization value for the periodic filesaving object Returns: -nothing Remarks Initializes the object for periodic file saving.
210
4.164.14
Synchronize Captures
SynchronizeCaptures(); N/A
C++ C
Parameters: - none Returns: Remarks All of the cards designated to capture data are synchronized. This should be performed at the beginning of a capture. - nothing
4.164.15
C++ C
Parameters: int exceptiontype exceptions can be thrown with one of two values 1 file cannot opened for writing 2 file closing error Returns: Remarks
throw FileOpenErrors(1); // file opening error .. .. catch(CFileCapturingOperations::FileOpenErrors FileError) { switch (FileError.FiletypeError) { case 1: // file opening error break; case 2: // file closing error break; } }
- nothing
211
C++ C
- nothing
If the user has set file capturing limitations, the application control loop will halt when this limitation is reached.
212
5 Index
1 100 duty cycle (E1) selecting .....................................................109 5 50 duty cycle (E1) selecting .....................................................109 56 kbps reading .......................................................154 subchannels..................................................23 A abnormal termination getting description .........................................7 active global receive buffer getting index of............................................59 active global transmit buffer getting index of............................................58 active receive buffer get sequence number....................................48 active receive global buffer get offset ......................................................45 get pointer to................................................44 active transmit buffer get sequence number....................................48 active transmit global buffer get offset ......................................................46 get pointer to................................................45 AIS setting ..........................................................14 AIS per status set check............................................................87 AIS transition set check............................................................87 all per status getting ..........................................................86 all transitions getting ..........................................................86 analog loopback disabling ......................................................91 enabling .......................................................90 analog loopback in driver is set check if ........................................................87 API files ................................................................2 API library get version................................................... 22 Asyncronous Signaling Bits Transmission accessing multiple BioStreamEx objects .. 151 closing....................................................... 150 getting statistics ........................................ 152 Opening multiple timeslots for xmission .. 149 reading ...................................................... 150 retrieving event handle.............................. 152 writing to multiple timeslots ..................... 151 audio register write to ........................................................ 72 Auto resync disabling.................................................... 106 enabling.................................................... 105 auto resync enabled check if for E1 ............................................ 96 auto resync is enabled check if for T1 ............................................ 94 autoresync check........................................................... 16 disable ......................................................... 16 enable.......................................................... 16 available timeslot ....................................................... 79 B B8SZ (T1) detecting on Rx ......................................... 114 B8SZ or COFA detected check if for T1 ............................................ 94 B8ZS check........................................................... 16 Base I/O address querying ........................................... 9 BER deselect Tx/Rx ............................................ 19 get errors ..................................................... 19 load static pattern .............................19, 84, 85 select Tx/Rx ................................................ 19 BER error counter clear ............................................................ 82 read ............................................................. 82 BioCalculateChannelMask ............................ 141 BioCloseStream ............................................. 131 BioFillTxChannels......................................... 139
213
BioFillTxChannelsWithLenght ......................140 BioGetReadMissedBytesCount ......................135 BioGetWriteMissedBytesCount .....................136 BioOpenStream ..............................................130 BioRead..........................................................136 BioReopen ......................................................139 BioReopenRead..............................................138 BioReopenWrite .............................................138 BioSetReadChannelMask...............................132 BioSetReadSafeMarginBytes .........................134 BioSetReadSafeMarginMultiFrames..............133 BioSetWriteSafeMarginBytes ........................135 BioSetWriteSafeMarginMultiFrames.............133 BioStream Calculating Channel Mask.........................141 creating ..............................................130, 131 fill global transmit buffers with byte strings ..............................................................140 fill global transmit buffers with idle code..139 get missed receive bytes ............................135 get missed transmit bytes...........................136 receive........................................................136 reopen receiving ........................................138 reopen receiving and/or transmitting .........139 reopen transmitting ....................................138 set read safe margins..........................133, 134 set receive channel mask ...........................132 set transmit channel mask ..........................132 set write safe margins ........................133, 135 transmit ......................................................137 BioWrite .........................................................137 BIST setting ..........................................................14 BIST per status set check if ........................................................87 bit inversion ....................................................185 bit removing HDLC ..........................................................24 bit stuffing HDLC ..........................................................24 BitRemove Class ..........................................................162 BitRemove class using ............................................................24 BitStream class using ............................................................23 BitStream Class ..............................................154 blue alarm check............................................................16 disable..........................................................16 enable...........................................................16 blue alarm detected check if for T1 .............................................94 Borland C++ Builder API library ...................................................31
BPV error counter.............................................. 103 BPV counter check saturated............................................ 16 BPV counter saturated check if for T1 ............................................ 94 BPV error insert ........................................................... 82 BPV error counter get ............................................................... 16 resetting to a start value ............................ 104 bridge mode checking...................................................... 69 setting.......................................................... 70 Built-in debugging enable/disable messages.............................. 22 built-in diagnostic check whether enabled................................ 35 built-in self test ................................................ 87 activate........................................................ 14 C C interface object checking if object exists.............................. 41 creating ..................................................28, 40 destroying ................................................... 41 initializing ................................................... 28 CalculateCrc function .................................... 185 Calculating Channel Mask............................. 141 card I/O checking...................................................... 61 card memory checking...................................................... 62 card register initialization .................................................. 8 carrier loss detected check if for T1 ............................................ 94 CAS set 16 CAS multiframe resync check........................................................... 16 check if for E1 ............................................ 96 CAS multiframe resync criteria is fixed check if for E1 ............................................ 96 CAS multiframe sync criteria set fixed or not fixed ................................... 16 CAS multiframe sync criteria fixed (E1) setting........................................................ 108 CAS multiframe sync criteria is fixed check if for E1 ............................................ 96 CAS multiframe sync criteria not fixed (E1) setting........................................................ 108 CAS receive mode (E1) setting........................................................ 108 CAS transmit mode (E1) setting........................................................ 108
214
CASF or BER selection .......................................................11 CASF/BER set BER........................................................74 set to CASF..................................................74 CCS set 16 CCS or CAS check............................................................16 CCS receive mode setting (E1) ................................................108 CCS transmit mode (E1) setting ........................................................108 channel for transparent check if selected...........................................16 channel for Tx idle code check if selected...........................................16 check clock ............................................................78 check card I/O and memory...........................................61 check framing format ESF/D4 ........................................................16 CheckCard ........................................................61 CheckCardIo.....................................................61 CheckCardMemory ..........................................62 CheckCodec......................................................78 CheckDr ...........................................................87 CheckDrJitter....................................................92 CheckFr E1 96 T1 94 CheckFrTimeslotSelectedForTxIdleCode E1 only.........................................................97 CheckGlcEnableDbgMsg .................................35 CheckMode ......................................................69 CheckMultiTsAllAvailable ..............................80 CheckMultiTsAvailable ...................................79 clock check external ..............................................78 check internal...............................................78 check recovered ...........................................78 set to external...............................................74 set to internal ...............................................74 set to recovered............................................74 codec check drop insert enabled ............................78 check speaker on/off ....................................78 disable drop insert........................................77 enable drop insert.........................................76 get gain ........................................................75 get timeslot ..................................................75 initialization .................................................64 initialize .......................................................60 set BER........................................................74 set clock .......................................................74
set gain ........................................................ 73 set time slot ................................................. 73 turn off speaker ........................................... 77 turn off VF transmissioin ............................ 77 turn speaker on............................................ 76 turn VF transmission on.............................. 76 VF transmission on/off ............................... 78 Codec functions ..................................................... 11 Interface Latch ............................................ 11 set BER ....................................................... 11 set CASF..................................................... 11 Codec Interface Latch Check .......................................................... 11 Reset ........................................................... 11 Set ............................................................... 11 COFA check........................................................... 16 COFA (T1) detecting on Rx ......................................... 114 Compiler API library include file ............................... 31 defines for different cards ........................... 31 settings ........................................................ 31 configuration files for bit error rate testing ............................... 32 for hardware settings................................... 32 CRC calculation for HDLC ............................... 185 reading/writing............................................ 25 CRC4 get error counter.......................................... 16 CRC4 error counter E1 103 CRC4 error counter (E1) resetting to a start value ............................ 104 CRC4 Tx/Rx (E1) disabling.................................................... 106 enabling.................................................... 105 CreateCGlComInterface .................................. 40 Cross Port Functions..................................................... 14 GetCrossPort............................................... 14 Getting ........................................................ 85 Modes ......................................................... 14 SetCrossPort ............................................... 14 Setting ......................................................... 84 current pattern file name ..................................................... 67 get file name ............................................... 43 set file name ................................................ 44 D D4 framing (T1) selecting .................................................... 109 D4 is selected
215
check if for T1 .............................................94 D4 yellow alarm B2 (T1) selecting .....................................................109 D4 yellow alarm S bit (T1) selecting .....................................................109 D4 yellow alarm S Bit is set check if for T1 .............................................94 data transmission rate for T1 and E1 full frame (all channels)..........9 getting ..........................................................49 Debugging application ...................................................32 default configuration loading .........................................................63 deselect all channels for transparent ..........................16 all channels for Tx idle code........................16 all Rx channels for code insert.....................16 all timeslots for Tx idle codes......................16 channel for Tx idle code, transparent or code insert .......................................................16 deselect BER receive/transmit ...........................................84 DeselectFr.......................................................110 DeselectFrTimeslot ........................................113 deselecting time slots....................................................110 deselecting all time slots for Tx idle code..........................................110 DestroyCGlComInterface.................................41 detect Rx B8ZS or COFA ......................................16 DetectFrRx .....................................................114 device driver get selected device number ..........................50 Device driver get version....................................................22 Devices maximum number supported by device driver ..................................................................9 DFMO setting ..........................................................14 DFMO transition set check............................................................87 disable diagnostic error message boxes ...................35 interrupts......................................................16 disable all framer interrupts T1 and E1.....................................................98 disable framer alarm interrupts only T1 and E1.....................................................98 disable framer interrupts selectively T1 and E1.....................................................99 DisableCodec....................................................77 DisableDrInterruptEvents.................................85 DisableDriver ...................................................91
DisableFr ....................................................... 106 DisableFrInterrupts.......................................... 98 T1 and E1.................................................... 99 DisableTxRxBuffer ....................................... 124 DisableUnframedInput .................................. 126 disabling framer features .......................................... 106 display critical error in DEBUG builds only and throw GetLastError exception .......................... 37 driver disable interrupt events ............................... 14 enable interrupt events ................................ 14 equalizer control ......................................... 14 initialization ................................................ 60 initialization error description ................... 39 openning ..................................................... 60 query information ....................................... 14 driver attributes getting ......................................................... 86 driver interrupt events disable ......................................................... 85 enable.......................................................... 86 driver open status set check if........................................................ 87 driver register write to ........................................................ 72 driver registers resetting....................................................... 92 driver Rx monitor mode disabling...................................................... 91 enabling....................................................... 90 driver version getting ....................................................... 120 drop insert check enabled.............................................. 78 disable ......................................................... 77 enable.......................................................... 76 Drop Insert Disable ........................................................ 11 Enable ......................................................... 11 DynamicListBuf class using............................................................ 27 DynamicListBuf Class................................... 182 E enable diagnostic error message boxes .................. 35 interrupts ..................................................... 16 enable all framer interrupts T1 and E1.................................................. 100 EnableCodec.................................................... 76 EnableDrInterruptEvents ................................. 86 EnableDriver.................................................... 90 EnableFr ....................................................... 105 EnableFrInterrupts
216
T1 and E1...........................................100, 101 EnableMultiTs ..................................................79 EnableMultiTsAll.............................................80 EnableTxRxBuffer .........................................123 EnableUnframedInput ....................................127 enabling framer features..........................................105 enabling framer interrupts selectively T1 and E1...................................................101 equalizer control..........................................................14 gain setting...................................................14 equalizer control getting ..........................................................86 equalizer gain setting ..........................................................88 equalizer gain 12dB setting ..........................................................89 equalizer gain 26dB setting ..........................................................89 equalizer gain 36dB setting ..........................................................89 Error initializing....................................................32 error counter check saturated ............................................16 get BPV (T1 and E1) .................................103 get CRC4 error counter (E1)......................103 get errored superframe counter (T1) ..........103 get frame error counter (E1) ......................103 get out of frame counter (T1).....................103 error counter detected check if for T1 .............................................94 error counter is saturated check if for E1 .............................................96 error message formatting ........................................36, 37, 38 Error message displaying.....................................................22 formatting ....................................................22 errored superframe get error counter...........................................16 ES overrun transition set check............................................................87 ES OVR transition set check............................................................87 ES underrun transition set check............................................................87 ESF framing (T1) selecting .....................................................109 ESF yellow alarm check FDL ...................................................16 ESF yellow alarm FDL check if for T1 .............................................94 ESF yellow alarm FDL (T1) selecting .....................................................109
ESF yellow alarm S bit (T1) selecting .................................................... 109 exception handling ...........................................4, 6, 7, 28 suppressing messaging boxes in debug mode ............................................................. 6, 7 suppressing messaging boxes in debug mode with C interface...................................... 28 Exception get textual description................................. 22 exceptions caused by driver and system errors ............. 33 caused by invalid parameters ...................8, 33 in XE "exceptions:caused by invalid parameters" XE "exceptions:caused by driver and system errors" XE "invalid:parameters" API Library .......... 33 library, driver and system ............................. 4 ext signaling bits selected check if for E1 ............................................ 96 ext signalling bits (E1) disabling.................................................... 106 enabling.................................................... 105 external CRC check if enabled .......................................... 16 disable ......................................................... 16 external CRC (T1) disabling.................................................... 106 enabling.................................................... 105 external CRC is enabled check if for T1 ............................................ 94 external FT FPS check if enabled .......................................... 16 disable ......................................................... 16 external FT FPS (T1) disabling.................................................... 106 enabling.................................................... 105 external FT FPS is enabled check if for T1 ............................................ 94 external S bit check if enabled .......................................... 16 disable ......................................................... 16 enable.......................................................... 16 external S bit (T1) disabling.................................................... 106 enabling.................................................... 105 external S bit is enabled check if for T1 ............................................ 94 external signaling check bits set............................................... 16 external signaling bits disable ......................................................... 16 extra bits setting in framer ........................................ 116
217
F facility data link reading/writing.............................................25 Facility Data Link...........................................166 FAS check multiframe starts with........................16 FDL Input/Output...............................................166 reading/writing.............................................25 FDL Buffers checking if separate buffers are used .........200 getting Tx and Rx buffer addresses ...........200 FdlStream class using ............................................................25 FdlStream Class..............................................166 file pattern get default name...........................................43 set default name ...........................................43 fill transmit buffers............................................68 fill transmit buffer with byte string ............................................50 with idle code...............................................49 FillTxChannels .......................................139, 140 FillTxGlobalBuffers ...................................49, 50 Firmware Version retrieving....................................................201 force resync...........................................................16 format message box.....................................36, 37, 38 format and display message box in DEBUG and RELEASE builds.......................................................36 message box in DEBUG build only.............36 FPGA Attributes retrieving (HD card only) ..........................198 setting (HD card only) ...............................199 FPS reading/writing.............................................25 frame get error counter...........................................16 frame bits get national, international or extra ...............16 set national, international or extra................16 frame error detect............................................................16 frame error counter E1 103 get ................................................................16 frame error counter (E1) resetting to a start value .............................104 frame error detected check if for T1 .............................................94 Frame Information
Saving, Accessing and Loading .................. 26 frame pattern sequence reading/writing............................................ 25 frame resync check if for E1 ............................................ 96 frame resync criteria is fixed check if for E1 ............................................ 96 Framer functions ..................................................... 16 framer bits getting extra .............................................. 117 getting international .................................. 117 getting national ......................................... 117 framer receive interrupt mask register reading for T1 and E1 ............................... 102 framer receive status register reading for T1 and E1 ............................... 102 framer register write to ........................................................ 72 framer RIMR reading for T1 and E1 ............................... 102 framer RSR reading for T1 and E1 ............................... 102 framer setting check for E1................................................ 96 framer settings checking T1 ................................................ 94 framer timeslot is selected for Tx idle code E1 only........................................................ 97 Ft and Fs reading/writing............................................ 25 function calling conventions ....................................... 4 exceptions ..................................................... 4 groups ....................................................... 4, 8 naming conventions ...................................... 4 order.....................................................6, 7, 28 Function parameters..................................................... 8 functions Codec control.............................................. 11 initialization .................................................. 8 mode control (monitor, terminate, bridge).. 10 termination.................................................... 8 Functions driver control .............................................. 14 port I/O........................................................ 12 G gain set codec...................................................... 73 Gain Get .............................................................. 11 Set ............................................................... 11 get idle code...................................................... 54
218
interrupt mask register .................................16 status register ...............................................16 Get Cross Port ..................................................85 get device driver information byte offset into current buffer ......................42 current active global buffer..........................42 max multiframe index in global buffer ........42 number of frames per multiframe ................42 parallel port base address.............................42 parallel port IRQ ..........................................42 parallel port memory address.......................42 Software buffer shared by VxD and Application..............................................42 start and end channel ...................................42 start and end channels..................................42 total global buffers received ........................42 total number of received multiframes ..........42 total number of transmitted multiframes......42 get global receive buffer pointer.......................52 get global transmit buffer pointer .....................52 GetActiveRxBufPtr ..........................................44 GetActiveRxSoftBuffer....................................59 GetActiveTxBufPtr...........................................45 GetActiveTxSoftBuffer ....................................58 GetApiVersion................................................120 GetCodec ..........................................................75 GetCurrentlySelectedDeviceNo .......................50 GetCurrentPatternFileName .............................43 GetDefaultPatternFileName .............................43 GetDr................................................................86 GetExceptionDescription .................................38 GetFr T1 and E1...................................................102 GetFrBits ........................................................117 GetFrErrorCounter .........................................103 GetIdleCode......................................................54 GetLatestTimeslotData...................................119 GetMaxDeviceCount......................................121 GetMaxTimeslot.............................................121 GetMultiFrameDuration ...................................56 GetMultiFrameSize ..........................................56 GetMultiRxGlobalBuffer0 ...............................52 GetMultiRxGlobalBuffer1 ...............................52 GetMultiSharedDevicePtr ................................42 GetMultiTxGlobalBuffer0................................52 GetMultiTxGlobalBuffer1................................52 GetNoOfDevicesFound ....................................52 GetNoOfDevicesInstalled.................................51 GetNoOfFramesPerMF ....................................55 GetNoOfFramesPerSoftBuffer .........................58 GetNoOfMultiFramesPerSoftBuffer ................57 GetPrevRxBufPtr..............................................46 GetPrevTxBufPtr..............................................47 GetProtocolBytesPerMs ...................................49 GetReadMissedBytesCount............................135 GetRxActiveBufferNumber .............................48
GetRxActiveBufferOffs................................... 45 GetTimeslotData............................................ 118 GetTxActiveBufferNumber............................. 48 GetTxActiveBufferOffs................................... 46 GetUsableSoftBufferSize ................................ 57 GetVersion..................................................... 120 GetWriteMissedBytesCount .......................... 136 GlcCriticalMsg ................................................ 37 GlcDebugMsg.................................................. 36 GlcEnableDbgMsg enable/disable diagnostic error message boxes ............................................................... 35 GlcMsg ............................................................ 36 GlComExceptions............................................ 33 get description............................................. 38 global receive buffer get pointer of............................................... 52 Global receive buffer get active buffer driver position (offset) ..... 13 get active buffer pointer .............................. 13 get active buffer sequence number.............. 13 get address .................................................. 13 get address for a device............................... 13 get inactive buffer pointer........................... 13 global transmit buffer get pointer of............................................... 52 Global transmit buffer fill with idle byte strings ............................. 13 fill with idle code ........................................ 13 get active buffer driver position (offset) ..... 13 get active buffer pointer .............................. 13 get active buffer sequence number.............. 13 get address .................................................. 13 get address for a device............................... 13 get inactive buffer pointer........................... 13 H HDB3 Tx/Rx (E1) disabling.................................................... 106 enabling.................................................... 105 HDLC ............................................................ 161 Bit Removal .............................................. 162 bit stuffing................................................. 161 encoding/decoding ...................................... 24 HDLC Frames Getting Rx or Tx Queue Size.................... 193 Getting total number of CRC errors.......... 194 Getting total number of discarded frame octets .................................................... 194 Getting total number of discarded frames. 194 getting total number of over and under runs ............................................................. 194 processing ................................................. 187 receive and transmit example.................... 192 received frame information structure........ 191 received time............................................. 191
219
receiving ....................................................190 receiving with frame information (timestamp etc.) .......................................................191 Setting and getting minimum number of flags between frames .....................................195 starting receiving or transmitting...............188 stopping receiving or transmitting .............193 transmitting................................................189 High Level Data Link bit stuffing and bit removing .......................24 encoding/decoding.......................................24 High Level Data Link Control........................161 High Levele Data Link Control Bit Removal...............................................162 Hook set on/off ......................................................22 I I/O address ...........................................................8 port.................................................................8 I/O Stream ..............................................130, 131 specifying channel masks ..................130, 131 I/O Stream Fill Global tranmit buffers with byte strings ........................................................140 I/O Stream Fill Global tranmit buffers with idle code............................................................139 I/O Stream Missed Bytes........................135, 136 I/O Stream Receive ........................................136 I/O Stream Receive Channel Mask ................132 I/O Stream Reopen .................................138, 139 I/O Stream Safe Margins ................133, 134, 135 I/O Stream Transmit .......................................137 I/O Stream Transmit Channel Mask ...............132 idle code check if FF or 7F .........................................16 fill receive/transmit global buffers with.......21 getting ..........................................................54 loading Tx buffer with ...............................125 transmitting..........................................49, 125 Idle code querying .........................................................9 inactive receive global buffer get pointer to................................................46 inactive transmit global buffer get pointer to................................................47 in-band network loop down disabling ......................................................91 enabling .......................................................90 in-band network loop up disabling ......................................................91 enabling .......................................................90 Include file for API library .......................................31 initial setting ..........................................................60
initialization options .......................................................... 8 with and without hardware setup .................. 8 Initialization error ............................................................ 32 initialization error description .................................................. 39 initialize base address ................................................ 63 driver........................................................... 60 hardware ..................................................... 60 interface ...................................................... 60 IRQ ............................................................. 63 memory offset............................................. 63 Initialize........................................................... 60 InitializeCodec................................................. 64 Input/Output Stream fill channel(s) with idle code....................... 21 get overrun/underrun byte count................. 21 reopen ......................................................... 21 reset............................................................. 21 set read channel mask ................................. 21 set read/write safe margins.......................... 21 insert BPV error.................................................... 19 single error .................................................. 19 insert error BPV ............................................................ 82 logical ......................................................... 82 InsertBerError.................................................. 82 installed cards qurying number........................................... 14 installed devices get number .................................................. 51 INT FPGA loading ........................................................ 66 interface object creating ..................................................... 6, 7 initializing ................................................. 6, 7 international bits setting in framer ........................................ 116 Interrupt querying ........................................................ 9 invalid parameters................................................8, 33 Inversion Mask ...............................127, 128, 129 Getting Rx................................................. 128 Getting Tx................................................. 129 Setting Rx ................................................. 128 Setting Tx.................................................. 127 InvertBits overloaded functions................................. 185 inverting bits MSB->LSB ........................................ 185 IRQ number .......................................................... 8
220
IsObjectCreated ................................................41 J jitter attenuation ...................................................14 control..........................................................14 setting on 3Hz..............................................93 setting on 6Hz..............................................93 jitter attenuation check if disabled ..........................................92 check if set on 3Hz ......................................92 check if set on 6Hz ......................................92 disabling ......................................................91 getting ..........................................................86 set on Rx ......................................................93 set on Tx ......................................................93 jitter attenuation on Rx check if set ...................................................92 jitter attenuation on Tx check if set ...................................................92 L latest time slot data retrieving....................................................119 line attenuation getting ..........................................................86 line length getting ..........................................................86 setting ..........................................................88 Line Level Voltage retrieving....................................................197 link list of variable records using ............................................................27 Linked List .....................................................182 Linking API library ...................................................31 LoadBerStaticPattern..................................84, 85 LoadDefaultConfig...........................................63 LoadIntFpga .....................................................66 LoadStaticBerIntFpga.......................................67 LoadTxBufferWithIdleCode ..........................125 LoadTxBufferWithMf ....................................125 local framer loopback check............................................................16 enable/disable ..............................................16 local loopback disable..........................................................16 disabling ..............................................91, 106 enable...........................................................16 enabling ...............................................90, 105 local loopback in driver is set check if ........................................................87 local loopback is active check if for E1 .............................................96 check if for T1 .............................................94 logical error
insert ........................................................... 82 loopback querying analog, remot, local, remote......... 14 querying network loopback up/down.......... 14 setting analog, remot, local, remote ............ 14 setting network loopback up/down ............. 14 LOS per status set check........................................................... 87 LOS transition set check........................................................... 87 M mask interrupts ..................................................... 16 maximum devices supported by device driver getting ....................................................... 121 maximum timeslot number getting ....................................................... 121 MemFile class using............................................................ 26 MemFile Class............................................... 175 memory address .......................................................... 8 Memory Mapped Files class using............................................................ 26 Memory Mapped I/O ..................................... 175 Memory offset querying ........................................................ 9 message boxes suppressing in debug mode....................... 6, 7 suppressing in debug mode with C interface ............................................................... 28 Microsoft Visual C++ API library .................................................. 31 mode bridge .......................................................... 10 checking...................................................... 69 monitor........................................................ 10 setting.......................................................... 70 terminate ..................................................... 10 monitor mode checking...................................................... 69 setting.......................................................... 70 MsbStuffBits.................................................... 24 function ..................................................... 161 multiframe filling Tx buffer with ................................ 125 transmitting ............................................... 125 multiframe duration getting ......................................................... 56 Multiframe duration querying ........................................................ 9 multiframe size getting ......................................................... 56 Multiframe size querying ........................................................ 9
221
multiframe start with FAS disable..........................................................16 N national bits setting in framer.........................................116 network loop ..............................................................14 network loop per status set check............................................................87 network loop transition set check............................................................87 network loopback detect disabling ......................................................91 enabling .......................................................90 network loopback in driver is set check if ........................................................87 Number of cards installed querying .........................................................9 number of devices get ................................................................51 number of devices found get ................................................................52 number of devices installed get number ...................................................51 Number of frames querying .........................................................9 number of frames in software buffer getting ..........................................................58 number of frames per multiframe getting ..........................................................55 Number of frames per multiframe querying .........................................................9 Number of frames per software buffer querying .........................................................9 number of multiframes in software buffer getting ..........................................................57 Number of multiframes per software buffer querying .........................................................9 O off-hook setting ........................................................122 on-hook setting ........................................................122 OOF criteria check if 2of4 ................................................16 set 2of4 or 2of5............................................16 OOF criteria 2 of 4 (T1) setting ........................................................108 OOF criteria 2 of 5 (T1) setting ........................................................108 OOF Criteria is 2 of 4 check if for T1 .............................................94 OUT data NRZ check if selected...........................................16
select ........................................................... 16 OUT data unipolar select ........................................................... 16 out of frame get error counter.......................................... 16 out of frame counter (T1) resetting to a start value ............................ 104 out of frame error counter T1 103 OutBitStream Class ....................................... 158 output data NRS is selected check if for T1 ............................................ 94 output data NRZ (T1) selecting .................................................... 109 output data unipolar (T1) selecting .................................................... 109 P Pattern file name get current ................................................... 20 get default ................................................... 20 set current.................................................... 20 set default.................................................... 20 Periodic File Saving allocating memory .................................... 207 class members ........................................... 204 clear messages .......................................... 210 closing....................................................... 208 closing all.................................................. 208 control loop........................................209, 210 creating ..................................................... 204 disk limit ................................................... 212 errors......................................................... 211 initiailizing................................................ 206 initialization .............................................. 210 initializing ................................................. 204 opening files.............................................. 206 releasing memory...................................... 207 synchronize ............................................... 211 using............................................................ 29 port reading from................................................ 64 reading from a XE "port A,B,C:input/output" hardware port ......................................... 12 writing to..................................................... 65 writing to a hardware port........................... 12 port A,B,C input/output................................................. 12 PP pattern file name get default ................................................... 20 set default.................................................... 20 R Read............................................................... 136 ReadBerErrXlinx ............................................. 82 ReadHardwareConfig ...................................... 63
222
reading subchannels................................................154 ReadPort ...........................................................64 ReadRxLineFrequency ...................................123 receive buffer disabling ....................................................124 enabling .....................................................123 receive DMA check if for E1 .............................................96 receive in CAS mode check if for E1 .............................................96 receive in CCS mode check if for E1 .............................................96 receive line frequency getting ........................................................123 receive loss of sync check if for E1 .............................................96 receive remote alarm check............................................................16 check if for E1 .............................................96 receive signaling all ones check............................................................16 check if for E1 .............................................96 receive unframed check............................................................16 receive unframed all ones check............................................................16 received unframed all ones check if for E1 .............................................96 remote alarm check if set ...................................................16 remote loopback disabling ......................................................91 enabling .......................................................90 remote loopback in driver is set check if ........................................................87 Reopen............................................................139 ReopenRead....................................................138 ReopenWrite...................................................138 ResetBerTxRx ..................................................84 ResetCodec.......................................................74 ResetDrRegisters ..............................................92 restore time slot status .............................................81 RestoreMultiTsStatus .......................................81 resync algo10 ..........................................................16 algo24 bits....................................................16 check in progress .........................................16 check OOF on..............................................16 check using FT bits......................................16 on OOF or OOF RCL ..................................16 using FT bits ................................................16 using FT FA bits ..........................................16 resync algo 10 bits check............................................................16
check if for T1 ............................................ 94 resync criteria check........................................................... 16 fixed or not fixed......................................... 16 resync framer (E1) CAS multiframe criteria fixed ................. 115 CAS multiframe criteria not fixed ........... 115 frame criteria fixed .................................. 115 frame criteria not fixed ............................ 115 resync framer (T1 and E1) forced........................................................ 115 resync framer (T1) on OOF..................................................... 115 on OOF RCL............................................ 115 using algo 10 bits ..................................... 115 using algo 24 bits ..................................... 115 using FT FS bits...................................... 115 using FT bits ............................................ 115 resync is using FT bits check if for T1 ............................................ 94 resync on OOF check if for T1 ............................................ 94 ResyncFr ....................................................... 115 RMSYNC wait for start................................................ 68 robbed bit sig (T1) disabling.................................................... 106 enabling.................................................... 105 robbed bit signal check if enabled .......................................... 16 disable ......................................................... 16 enable.......................................................... 16 robbed bit signal is enabled check if for T1 ............................................ 94 Running application................................................... 32 Rx line attenuation............................................ 14 Rx Buffer Enable application instance count receiving ......... 197 Rx buffer running count querying ........................................................ 9 Rx channel check if selected.......................................... 16 check if selected for code insert.................. 16 Rx channel is selected for code insert check if for T1 ............................................ 97 Rx COFA check detect is selected ............................... 16 Rx COFA detect is selected check if for T1 ............................................ 94 Rx CRC4 is enabled check if for E1 ............................................ 96 Rx equalizer gain is 12 dB check if........................................................ 87 Rx equalizer gain is 26 dB
223
check if ........................................................87 Rx equalizer gain is 36 dB check if ........................................................87 Rx HDB3 is enabled check if for E1 .............................................96 Rx loss of sync check............................................................16 Rx monitor mode selected check if ........................................................87 Rx Signaling Bits retrieving for HD cards..............................203 Rx/Tx set CCS or CAS ...........................................16 Rx/Tx CRC4 check............................................................16 Rx/Tx HDB3 check............................................................16 S save time slot status .............................................81 SaveMultiTsStatus............................................81 select channel for transparent or code insert..........16 channel for Tx idle code ..............................16 driver's current device number.....................54 SLC96..........................................................16 T1DM ..........................................................16 select BER receive..........................................................83 transmit ........................................................83 SelectCurrentDeviceNo....................................54 SelectFr...........................................................109 SelectFrTimeslot ............................................112 selecting framer attributes ....................................................109 SetBerTxRx ......................................................83 SetCodec.....................................................73, 74 SetCrossPort .....................................................84 SetCurrentPatternFileName..............................44 SetDefaultPatternFileName ..............................43 SetDr...........................................................88, 89 SetDrJitter.........................................................93 SetFr ...............................................................108 SetFrBits.........................................................116 SetFrErrorCounter ..........................................104 SetMode ...........................................................70 SetOnHook .....................................................122 SetReadChannelMask.....................................132 SetReadSafeMarginBytes...............................134 SetReadSafeMarginMultiFrames ...................133 setting framer features...........................................108 line length ....................................................14 network loop ................................................14 SetTxBuffers ....................................................68
SetWriteChannelMask................................... 132 SetWriteSafeMarginBytes ............................. 135 SetWriteSafeMarginMultiFrames.................. 133 SigBitsAsyncIo class Signaling Bits Xmission in multiple timeslots ............................................................. 149 signaling bits receiving ................................................... 145 Signaling Information retrieving for HD cards ............................. 201 singaling bit transitions receiving ................................................... 145 SLC96 check........................................................... 16 SLC96 (T1) selecting .................................................... 109 SLC96 is selected check if for T1 ............................................ 94 slect yellow alarm D4 B2 or S bit................................................... 16 slect yellow alarm ESF FDL or S bit ................................................ 16 Software buffer size querying ........................................................ 9 Sound Driver ................................................. 196 checking.................................................... 196 disabling.................................................... 196 enabling..................................................... 196 speaker check on/off ................................................ 78 turn off ........................................................ 77 turn on......................................................... 76 Speaker Disable ........................................................ 11 Enable ......................................................... 11 start with FAS enable.......................................................... 16 static BER INT FPGA loading ........................................................ 67 Stream Input/Output open ............................................................ 21 subchannel 56 kbps........................................................ 23 input/output................................................. 23 subchannels writing....................................................... 158 superframe error counter T1 103 superframe error counter (T1) resetting to a start value ............................ 104 symbols used in the document .................................... 4 SyncDevices .................................................... 54 synchronize devices......................................... 54
224
T T1DM check selected ..............................................16 T1DM (T1) selecting .....................................................109 T1DM is selected check if for T1 .............................................94 terminate mode checking.......................................................69 setting ..........................................................70 throwDebug ......................................................38 time slot check if available .........................................79 make available .............................................79 make unavailable .........................................79 time slot data retrieving....................................................118 time slot status restore ..........................................................81 save ..............................................................81 time slots check whether all are available....................80 deselecting all for code insert (T1) ............110 deselecting all for transparent (T1) ............110 deselecting for code insert (T1) .................113 deselecting for transparent (T1).................113 deselecting for Tx idle code...............110, 113 make all available ........................................80 make all unavailable ....................................80 selecting for code insert (T1) .....................112 selecting for transparent (T1).....................112 selecting for Tx idle code ..........................112 timeslot check if available .........................................20 enable...........................................................20 enable all......................................................20 functions ......................................................20 restore status ................................................20 save available...............................................20 save status ....................................................20 set codec ......................................................73 write assigner range .....................................20 write start/end assigner ................................20 Timeslot maximum number..........................................9 timeslot assigner range ............................................................70 specify range................................................71 write to start .................................................70 write to stop .................................................70 timeslot selected for Tx idle check............................................................16 Toolkit Contents .........................................................2 transmit all ones
disabling...................................................... 91 enabling....................................................... 90 transmit all ones is set check if........................................................ 87 transmit buffer disabling.................................................... 124 enabling..................................................... 123 transmit buffers fill 68 transmitting all ones qurying........................................................ 14 setting.......................................................... 14 trasmit buffer setting off-hook bit.................................... 122 setting on-hook bit .................................... 122 Tx 100 duty cycle check if for E1 ............................................ 96 Tx 100 or 50 check duty cycle.......................................... 16 Tx 50 duty cycle check if for E1 ............................................ 96 Tx B8SZ disable ......................................................... 16 Tx B8ZS check active ................................................ 16 enable.......................................................... 16 Tx B8ZS (T1) disabling.................................................... 106 enabling.................................................... 105 Tx B9ZS is active check if for T1 ............................................ 94 Tx blue alarm (T1) disabling.................................................... 106 enabling.................................................... 105 Tx blue alarm is enabled check if for T1 ............................................ 94 Tx Buffer Enable application instance count transmitting..... 197 Tx buffer running count querying ........................................................ 9 Tx channel is selected for transparent check if for T1 ............................................ 97 Tx channel is selected for Tx idle code check if for T1 ............................................ 97 Tx CRC4 is enabled check if for E1 ............................................ 96 Tx DMA check if for E1 ............................................ 96 disable ......................................................... 16 enable.......................................................... 16 Tx DMA (E1) disabling.................................................... 106 enabling.................................................... 105 Tx duty cycle select 100 or 50 ........................................... 16 Tx extra
225
check bits set................................................16 Tx extra bits (E1) disabling ....................................................106 enabling.....................................................105 Tx extra bits selected check if for E1 .............................................96 Tx extra, national and international bits disable..........................................................16 Tx HDB3 is enabled check if for E1 .............................................96 Tx idle code select 7F or FF .............................................16 Tx idle code 0x7F (T1) selecting .....................................................109 Tx idle code 0xFF (T1) selecting .....................................................109 Tx idle code is 0x7F check if for T1 .............................................94 Tx idle code is 0xFF check if for T1 .............................................94 Tx in CAS mode check if for E1 .............................................96 Tx in CCS mode check if for E1 .............................................96 Tx international check bits set................................................16 Tx international bits (E1) disabling ....................................................106 enabling.....................................................105 Tx international bits selected check if for E1 .............................................96 Tx multiframe disable..........................................................16 Tx multiframe start with FAS (E1) disabling ....................................................106 enabling.....................................................105 Tx multiframe starts with FAS check if for E1 .............................................96 Tx national check bits set................................................16 Tx national bits (E1) disabling ....................................................106 enabling.....................................................105 Tx national bits selected check if for E1 .............................................96 Tx remote alarm check if for E1 .............................................96 disable..........................................................16 enable...........................................................16 Tx remote alarm (E1) disabling ....................................................106 enabling.....................................................105 Tx signaling all ones check if for E1 .............................................96 disable..........................................................16 enable...........................................................16
Tx signaling all ones (E1) disabling.................................................... 106 enabling.................................................... 105 Tx Signaling Bits checking if enabled for HD cards ......203, 204 retrieving for HD cards ............................. 202 setting for HD cards.................................. 202 Tx signaling on ones check........................................................... 16 Tx yellow alarm (T1) disabling.................................................... 106 enabling.................................................... 105 Tx yellow alarm is enabled check if for T1 ............................................ 94 Tx yellow and blue alarms check if enabled .......................................... 16 Tx/Rx CRC4 disable ......................................................... 16 enable.......................................................... 16 Tx/Rx DMA check........................................................... 16 Tx/Rx HDB3 disable ......................................................... 16 enable.......................................................... 16 U unframed all ones check set...................................................... 16 disable ......................................................... 16 enable.......................................................... 16 unframed all ones (E1) disabling.................................................... 106 enabling.................................................... 105 unframed all ones is selected check if for E1 ............................................ 96 unframed input disabling.................................................... 126 enabling..................................................... 127 unmask interrupts ..................................................... 16 usable software buffer size getting ......................................................... 57 using algo 10 bits (T1) forced........................................................ 115 V Variable Records Saving, Accessing and Loading .................. 26 VarRecBuf class using............................................................ 26 VarRecBuf Class ........................................... 177 VF Output Disable ........................................................ 11 Enable ......................................................... 11 VF transmission check on/off ................................................ 78
226
turn off .........................................................77 turn on..........................................................76 W Wait ..................................................................68 wait for start of RMSYNC ...............................68 write to audio, driver or framer register ................72 Write...............................................................137 WritePort ..........................................................65 WriteRegister....................................................72 WriteTsAssigner...............................................70 WriteTsAssignerRange.....................................71 X Xilinx loading ...................................................66, 67
Y yellow alarm check........................................................... 16 disable ......................................................... 16 enable.......................................................... 16 yellow alarm detected check if for T1 ............................................ 94 Z zero suppression B7 check........................................................... 16 set 16 setting (T1)................................................ 108 zero suppression B7 is set check if for T1 ............................................ 94 zero suppression transparent set 16 setting (T1)................................................ 108
227