184
Chapter 15
Script SDK
testapi.cpp
This example demonstrates the following functions of the API:
•
Sending commands and getting responses back
•
Pause()
•
Multi-line response
•
Operators “=” and “+=”
•
QDLcd associated API commands: InputInteger(), InputFloat(), and
WaitForButtonPress()
•
GetUIntResponse()
•
GetIntResponse()
•
GetDoubleResponse()
•
GetBoolResponse()
•
Detecting an invalid command
#include <QDScriptContext.h>
#include <stdio.h>
bool Script_testapi( QDScriptContext& sc )
{
// =========================================================
// Demonstration of sending command and getting response back
// =========================================================
// one way to execute a command/query
sc.Exec("CIOY"); // enable printf to serial terminal
// another way to execute a command/query
sc.SetCmdName("VERF?"); // query generator firmware version
sc.Exec(); // execute the command
printf("The return value of command \"%s\" is %s\n", sc.GetCmdName(),
sc.GetResponse());
// =========================================================
// Demonstration of Pause()
// =========================================================
printf("Pause for 5 seconds\n");
sc.Pause( 5000 );
if (sc.Canceled()) {
return true;
}
printf("\nWake up from Pause(5000)\n");
sc.SetCmdName("VERG?"); // query generator gateware versions
sc.Exec(); // execute the command
if (sc.Succeed()) { // was previous command successful?
printf("\nThe return value of command \"%s\" is %s\n",
sc.GetCmdName(), sc.GetResponse());
}
Summary of Contents for 881
Page 1: ...881 882 Video Test Instrument User Guide 882E for HDMI ...
Page 12: ...10 Contents ...
Page 50: ...38 Chapter 1 Getting Started ...
Page 84: ...72 Chapter 2 Testing Video Displays ...
Page 99: ...882 Video Test Instrument User Guide Rev A 35 87 ...
Page 102: ...90 Chapter 3 Administrative Tasks ...
Page 107: ...882 Video Test Instrument User Guide Rev A 35 95 ...
Page 216: ...204 Chapter 5 Working with Formats ...
Page 248: ...236 Chapter 7 Working with Images ...
Page 264: ...252 Chapter 8 Working with Test Sequences ...
Page 382: ...40 Chapter 11 Testing EDID for HDMI 2 Expand the EDID Block in the navigation view ...
Page 446: ...104 Chapter 12 CEC Interactive Troubleshooting Environment ITE ...
Page 493: ...882 Video Test Instrument User Guide Rev A 35 151 ...
Page 591: ...882 Video Test Instrument User Guide Rev A 35 213 Commands by name ...
Page 687: ...882 Video Test Instrument User Guide Rev A 35 309 Example DVIC 23 FMTU ...
Page 1018: ...580 Appendix B Image Reference The EMITest5 image is shown below ...
Page 1094: ...656 Appendix B Image Reference ...
Page 1124: ...686 Appendix C Error Messages ...
Page 1140: ...702 Appendix D Format Reference ...