Configure Visual Studio

Perform the following setup to use the library and create your own client applications.

Note: In order for your application to connect to analyzers over Ethernet, the application must run a Windows message loop. For instructions, see the following MSDN article:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms644928(v=vs.85).aspx

Install Net Protocol Suite

Download and install the Teledyne LeCroy Net Protocol Suite from https://teledynelecroy.com/sw/netprotocolsuite


Open Visual Studio

  1. Open Microsoft Visual Studio.

  2. Create or open a project.

  3. Right-click Project. The Project menu opens.

  4. Select Properties. Project Property Pages opens.

att_0_for_502857797.jpeg
Project Property Pages

Select the Output Directory

  1. In the drop-down menu to the right, select Browse.

  2. Find the directory C:\Users\Public\Documents\LeCroy\Net Protocol Suite\API\SDK\bin, or select Edit from the drop-down menu to the right. The Output Directory window opens.

att_1_for_502857797.jpeg
Defining the Output Directory
  1. Set the path to the output directory. Highlight this text and replace with
    C:\Users\Public\Documents\LeCroy\Net Protocol Suite\API\SDK\bin
    For Windows XP, the directory is: C:\Program Files\LeCroy\Net Protocol Suite\API\SDK\bin

Select Input File

  1. Under Configuration Properties, select Linker > Input

  2. Select Additional Dependencies.

att_2_for_502857797.jpeg
Defining Dependencies
  1. Copy this into the field to the right: C:\Users\Public\Documents\LeCroy\Net Protocol Suite\API\SDK\Lib\TLNetAPI.lib

For Windows XP, use this instead: C:\Program Files\LeCroy\Net Protocol Suite\API\SDK\Lib\TLNetAPI.lib

Select directory for include files

  1. Go to Configuration Properties > C/C++ > General.

  2. Go to Additional Include Directories.

att_3_for_502857797.jpeg
Defining Include Directories
  1. Enter the following directory: C:\Users\Public\Documents\LeCroy\Net Protocol Suite\API\SDK\Include

  2. On the Property Pages window, select OK to accept these changes. The contents of the include folder are listed below:

TLNetAPI.h: Initializes and releases the API, gets the final internal error code and gets a description of any internal error code functions.

APIProject.h: Declares the project functions.

APIAnalyzerSettings.h: Declares the project’s analyzer setting functions.

APIEventHandlers.h: Declares any callback functions that report the status of recording and jammer processes, and reports any process errors or progress.

APITrace.h: Declares all functions. APITraceIterator.h: Defines trace iterating.

APITracePacket.h: Defines packet navigating.

Creating and Using Objects

  1. Create a Trace object and open the trace as follows:

C
EAPIErrorCode error_code= API_OK;
APITrace *trace= NULL;
error_code= APITrace_create(trace );
error_code= APITrace_ Open( trace , trace_file_name.GetBuffer(0) );
  1. Create a Trace Iterator and pass the already created Trace Object during its construction.

C
APITraceIterator *trace_itr = NULL;
error_code= APITraceIterator_create( trace , trace_itr );
  1. That’s it! You are now ready to use the different methods of trace and iterator.

C
error_code= APITraceIterator_ToFront( trace_itr );
bool has_next= false;
error_code= APITraceIterator_HasNext( trace_itr , has_next );
if(has_next)
{
APITracePacket *packet= NULL;
error_code= APITracePacket_create( packet );
error_code= APITraceIterator_GetNext( trace_itr , packet );
EDataType data_type;
error_code= APITracePacket_getType( packet , data_type );
.
.
.
  1. Don’t forget to destroy all created objects.

C
.
.
.
error_code= APITracePacket_destroy( packet );
}
error_code= APITraceIterator_destroy( trace_itr );
error_code= APITrace_destroy( api_trace );