Humax T9 사용자 설명서

다운로드
페이지 53
Confidential
DUT Graphical User Interface
DUT Tool Package
Appendix B - Example Code for mt_dut.dll Usage
 User’s Guide
34
Revision 1.1, 2013-05-06
      
8
Appendix B - Example Code for mt_dut.dll Usage
Use the mt_dut.dll to develop automatic applications to control the DUT. The following files are available to you 
(in C:\Program Files\Lantiq\DUT\Developers):
dut_api.h
mt_types.h
MT_DUT.lib
Example code:
This C source code defines the functions used by the supplied command line demo 
application.
The Dut_XXX functions are declared in the supplied dut_api.h according to the 
specifications, and you can also use the supplied MT_DUT.LIB for easier access to 
the MT_DUT.DLL.
#include "../dut_api.h" // Set to your path of the dut_api.h file
#include <stdio.h>
#include <stdlib.h>
/// Prints the API error in case ret is MT_RET_FAIL
int TryRunning(int ret)
{
if (ret == MT_RET_FAIL) printf("%s\n", Dut_GetLastError());
return ret;
}
/// Prints the driver or API version
int DriverVersion()
{
double version;
Dut_DriverVersion(&version);
printf("Driver version: %.2f\n", version);
return MT_RET_OK;
}
// Initialize the driver (in our command line application, it is called 
automatically)
int DriverInit()
{
return TryRunning(Dut_DriverInit());
}
// Releases the driver, and exits the application
int DriverRelease()
{
if (!TryRunning(Dut_DriverRelease())) return MT_RET_FAIL;
exit(MT_RET_OK);
return MT_RET_OK;
}