Вы находитесь на странице: 1из 58

Drive Animator

API Reference Guide

Version 1.1

Viavi Solutions
1-844-GO-VIAVI
www.viavisolutions.com
About This Guide

Notice
Every effort was made to ensure that the information in this manual was accurate at the time of
printing. However, information is subject to change without notice, and Viavi reserves the right to
provide an addendum to this manual with information not available at the time that this manual
was created.

Copyright
© Copyright 2015 Viavi Solutions Inc. All rights reserved. No part of this guide may be reproduced
or transmitted, electronically or otherwise, without written permission of the publisher. Viavi Solu-
tions and the Viavi logo are trademarks of Viavi Solutions Inc. (“Viavi”).

All other trademarks and registered trademarks are the property of their respective owners.

Copyright release
Reproduction and distribution of this guide is authorized for US Government purposes only.

Terms and conditions


Specifications, terms, and conditions are subject to change without notice. The provision of
hardware, services, and software are subject to Viavi standard terms and conditions, available at
www.viavisolutions.com/en-usa/services-and-support/support/warranty-terms-and-conditions

2 Drive Animator API Reference Guide


Contents
Purpose and scope .........................................................................................................................................................10
Assumptions ...................................................................................................................................................................10
Related information .......................................................................................................................................................10
Terminology....................................................................................................................................................................10
Technical assistance .......................................................................................................................................................10
About the Drive Animator API ........................................................................................................................................12
Features and capabilities ................................................................................................................................................12
System Architecture .......................................................................................................................................................12
Using the API ..................................................................................................................................................................13
Prior to Using the API .................................................................................................................................................13
Accessing Remoteservice.exe.....................................................................................................................................13
Setting up the Client Program ....................................................................................................................................14
OpenRemoteSession ......................................................................................................................................................32
Input ...........................................................................................................................................................................32
Output ........................................................................................................................................................................32
Prerequisite ................................................................................................................................................................32
Remarks ......................................................................................................................................................................32
CloseRemoteSession ......................................................................................................................................................32
Input ...........................................................................................................................................................................32
Output ........................................................................................................................................................................32
Prerequisite ................................................................................................................................................................33
Remarks ......................................................................................................................................................................33
QueryVersion..................................................................................................................................................................33

3 Drive Animator API Reference Guide


About This Guide

Input ...........................................................................................................................................................................33
Output ........................................................................................................................................................................33
Example ......................................................................................................................................................................33
Prerequisites ...............................................................................................................................................................33
Remarks ......................................................................................................................................................................33
QueryLicense ..................................................................................................................................................................33
Input ...........................................................................................................................................................................34
Output ........................................................................................................................................................................34
Example ......................................................................................................................................................................34
Prerequisite ................................................................................................................................................................34
Remarks ......................................................................................................................................................................34
OpenProject....................................................................................................................................................................34
Input ...........................................................................................................................................................................34
Output ........................................................................................................................................................................34
Prerequisite ................................................................................................................................................................34
Remarks ......................................................................................................................................................................35
GetHardwareSetup .........................................................................................................................................................35
Input ...........................................................................................................................................................................35
Output ........................................................................................................................................................................35
Example ......................................................................................................................................................................35
Prerequisites ...............................................................................................................................................................35
Remarks ......................................................................................................................................................................35
ProbeDevice....................................................................................................................................................................36
Input ...........................................................................................................................................................................36
Example ......................................................................................................................................................................36
Output ........................................................................................................................................................................36
Example ......................................................................................................................................................................36
Prerequisite ................................................................................................................................................................36
Remarks ......................................................................................................................................................................37
GetDeviceProperties ......................................................................................................................................................37

4 Drive Animator API Reference Guide


About This Guide

Input ...........................................................................................................................................................................37
Output ........................................................................................................................................................................37
Example ......................................................................................................................................................................38
Prerequisite ................................................................................................................................................................38
Remarks ......................................................................................................................................................................38
SetDevicePropertyValue.................................................................................................................................................38
Input ...........................................................................................................................................................................38
Output ........................................................................................................................................................................38
Prerequisite ................................................................................................................................................................39
Remarks ......................................................................................................................................................................39
GetSequencerSetup........................................................................................................................................................39
Input ...........................................................................................................................................................................39
Output ........................................................................................................................................................................39
Example ......................................................................................................................................................................39
Prerequisite ................................................................................................................................................................39
Remarks ......................................................................................................................................................................39
GetTestProperties ..........................................................................................................................................................40
Input ...........................................................................................................................................................................40
Output ........................................................................................................................................................................40
Example ......................................................................................................................................................................40
Prerequisite ................................................................................................................................................................40
Remarks ......................................................................................................................................................................40
SetTestPropertyValue.....................................................................................................................................................41
Input ...........................................................................................................................................................................41
Output ........................................................................................................................................................................41
Prerequisite ................................................................................................................................................................41
Remarks ......................................................................................................................................................................41
GetTestStatus .................................................................................................................................................................41
Input ...........................................................................................................................................................................41
Output ........................................................................................................................................................................41

Drive Animator API Reference Guide 5


About This Guide

Example 1 ...................................................................................................................................................................42
Example 2 ...................................................................................................................................................................42
Prerequisite ................................................................................................................................................................42
Remarks ......................................................................................................................................................................42
GetEventSetup................................................................................................................................................................42
Input ...........................................................................................................................................................................42
Output ........................................................................................................................................................................42
Example ......................................................................................................................................................................42
Prerequisite ................................................................................................................................................................43
Remarks ......................................................................................................................................................................43
GetEventStatus ...............................................................................................................................................................43
Input ...........................................................................................................................................................................43
Output ........................................................................................................................................................................43
Example ......................................................................................................................................................................43
Prerequisite ................................................................................................................................................................43
TriggerUserEvent ............................................................................................................................................................43
Input ...........................................................................................................................................................................43
Output ........................................................................................................................................................................44
Prerequisite ................................................................................................................................................................44
Remarks ......................................................................................................................................................................44
SetMonitorDataItems .....................................................................................................................................................44
Input ...........................................................................................................................................................................44
Example ......................................................................................................................................................................44
Output ........................................................................................................................................................................44
Example ......................................................................................................................................................................45
Prerequisite ................................................................................................................................................................45
Remarks ......................................................................................................................................................................45
GetMonitorDataItemValue.............................................................................................................................................47
Input ...........................................................................................................................................................................47
Output ........................................................................................................................................................................47

6 Drive Animator API Reference Guide


About This Guide

Prerequisite ................................................................................................................................................................47
Remarks ......................................................................................................................................................................47
Example ......................................................................................................................................................................47
GetSystemEventStatus ...................................................................................................................................................47
Input ...........................................................................................................................................................................47
Output ........................................................................................................................................................................48
Prerequisite ................................................................................................................................................................48
Example ......................................................................................................................................................................48
ShowWorkspace .............................................................................................................................................................48
Input ...........................................................................................................................................................................48
Output ........................................................................................................................................................................48
Prerequisite ................................................................................................................................................................48
StartLog...........................................................................................................................................................................48
Input ...........................................................................................................................................................................48
Output ........................................................................................................................................................................49
Prerequisite ................................................................................................................................................................49
Remarks ......................................................................................................................................................................49
StopLog ...........................................................................................................................................................................49
Input ...........................................................................................................................................................................49
Output ........................................................................................................................................................................49
Prerequisite ................................................................................................................................................................49
GetLogStatus ..................................................................................................................................................................49
Input ...........................................................................................................................................................................49
Output ........................................................................................................................................................................50
Prerequisite ................................................................................................................................................................50
Remarks ......................................................................................................................................................................50
ExportDrive .....................................................................................................................................................................50
Input ...........................................................................................................................................................................50
Output ........................................................................................................................................................................50
Prerequisite ................................................................................................................................................................50

Drive Animator API Reference Guide 7


About This Guide

Remarks ......................................................................................................................................................................50
GetExportStatus .............................................................................................................................................................51
Input ...........................................................................................................................................................................51
Output ........................................................................................................................................................................51
Prerequisite ................................................................................................................................................................51
Remarks ......................................................................................................................................................................51
Error Codes .....................................................................................................................................................................53
Log Status Codes.............................................................................................................................................................55
Export Status Codes........................................................................................................................................................56
Property Data Types .......................................................................................................................................................57

8 Drive Animator API Reference Guide


1
About This Guide
This chapter provides general information about this guide and how to contact Viavi. Topics discussed in this
chapter include the following:

– Purpose and scope


– Assumptions
– Related information
– Technical assistance

Drive Animator API Reference Guide 9


Chapter 1 Drive Animator Overview

Purpose and scope


The purpose of this guide is help you understand how to make use of your own client program to access and con-
trol the E6474A via Drive Test Animator API.

Assumptions
This guide is intended for the Developer with a programming background in the scripting language and who are
familiar with the basic XML / HTML concepts.

Related information
E6474A Drive Test User’s Guide

Terminology
– API—Application Programming Interface
– SOAP—Simple Object Access Protocol

Technical assistance
If you require technical assistance, call 1-844-GO-VIAVI (1.844.468.4284). For the latest TAC information, go to
http://www.viavisolutions.com/en/services-and-support/support/technical-assistance.

Region Phone Number

Americas 1-844-GO-VIAVI)
1.844.468.4284

Europe, Africa, and Mid-East +49 7121 862273


(Viavi Germany)

Asia and the Pacific +1 512 201 6534

During off-hours, you can request assistance by doing one of the following: leave a voice mail message at the
Technical Assistance number, e-mail the North American Technical Assistance Center,
Diagnostics.tac@viavisolutions.com, or submit your question using our online Technical Assistance Request form
at http://www.viavisolutions.com/en/services-and-support/support/technical-assistance.

10 Drive Animator API Reference Guide


1
Drive Animator Overview
This chapter provides a general description of the Drive Animator API. Topics discussed in this chapter include the
following:

– About the Drive Animator API


– Features and Capabilities
– System Architecture
– Using the API

Drive Animator API Reference Guide 11


Chapter 1 Drive Animator Overview

About the Drive Animator API


Welcome to the E6474A Drive Animator API Developer Guide. The Drive Animator APIs can be used to connect to
the E6474A and control them programmatically from a remote system. By writing your own program to use the
Drive Animator APIs, you can create your own interface to obtain the radio frequency (RF) coverage measure-
ments and service performance measurements for wireless communications networks.

The Drive Animator API explains the concepts about the web service API for controlling E6474A. The web service
API serves as a programmatic interface and provides the capability to connect to an installed E6474A that could be
either co-resident on the same computer or in another location. The programmatic interface uses Simple Object
Access Protocol (SOAP) which is a XML over HTTP protocol.

The Drive Animator API also provides a description of how the web service can be called, what parameters it ex-
pects, and what data it returns.

Features and capabilities


Features of the Drive Animator API include:

• Web Service running on the PC where E6474A is installed - To facilitate the communication between your
client program and E674A.

• Provides a means of authenticating the client program with the E6474A using username/password validation.

• Client program can be run on PERL, Python, C#,

System Architecture

12 Drive Animator API Reference Guide


Chapter 1 Drive Animator Overview

The communication between the Web Service and the client program is based on the SOAP protocol – a simple
XML-based protocol to let applications exchange information over HTTP. The communication between the Web
Service and E6474A is based on Windows Messaging using a shared memory.

Using the API


The following sections describe how to use the Drive Test Animator API. See chapter 2 for a complete API com-
mand reference.

Prior to Using the API


Before you can access the Drive Test Animator API, you must setup the E6474A system and add the device to
E6474A hardware tree. You must also enable the SUS license. See the E6474-90090 Drive Test User's Guide for
instructions to install and setup E6474A.

When you install E6474A, remoteservice.exe is enabled to serve the client’s SOAP requests. You can see an
icon in the system notification area when remoteservice.exe is running.

If you hover the mouse over the icon, you will see Drive Animator and whether client authentication is required.

Authentication ON: Client needs a user account to use drive animator features.

Authentication OFF: Client does NOT require a user account to use drive animator features.

You can enable or disable the authentication in remoteservice.exe. When you right click on the icon, you will
see 2 options: Disable/Enable Authentication. If you do not want clients to have a valid user/password to access
the drive animator feature, select Disable Authentication else select Enable Authentication. If it is enabled, the
client program must have a valid Windows login user id and password to access the drive animator feature.

If the drive animator authentication is disabled a warning message will appear every time RemoteService.exe
starts running.

To use the Drive Animator API, the client program must support the SOAP interfaces as defined by the WSDL. The
client program can be in scripting language such as PERL, Python, C#, etc. It can run on the same PC as the
E6474A or from another location.

Accessing Remoteservice.exe
To access the remote service, select the following link:

Drive Animator API Reference Guide 13


Chapter 1 Drive Animator Overview

http://localhost:8010/RemoteService

To obtain the WSDL, use the following address:

http://localhost:8010/RemoteService?wsdl

Replace local host with the IP address of the server for the client to access the service

Note: Make sure that the port 8010 is not blocked by any firewall on the machine running RemoteService.exe.

To manually configure RemoteService.exe, edit the following file:

Note: By default, the remoteService.exe is serving with SOAP 1.2 specification. If your client tools can only
support SOAP 1.1 specification, append “/soap11” at the end of the service URL:

http://localhost:8010/RemoteService/soap11

Setting up the Client Program


After installing the E6474A, you can find the sample files for C#, Perl, Python at the following location:

 Program Files > Agilent Technologies > E6474A-X > Sample directory

Setting up the Client Program Using Microsoft C#


1. Create a console application project using the Visual Studio.

14 Drive Animator API Reference Guide


Chapter 1 Drive Animator Overview

Note: Make sure the .NET Framework used is 3.5 or above.

2. Add service reference to access Drive Animator.

Note: Make sure that the Drive Animator – RemoteService.exe is running

3. Obtain the Service HTTP URL e.g. http://192.168.56.1:8010/RemoteService?WSDL

4. Copy the service URL in the Address field and click Go. It takes a while for the visual studio to resolve the
service reference.

Drive Animator API Reference Guide 15


Chapter 1 Drive Animator Overview

5. Click OK.

C# Sample Code

The following sample code demonstrates the following scenario

• Open a remote session.

• Open a project that consists of a device setup to make a call control test, followed by a FTP test (each test
is configured to run a single iteration).

• Probe the device.

• Start log.

• Poll log status.

• When the sequencer is completed, stop log.

• Export the log.

• Close the remote section.


16 Drive Animator API Reference Guide
Chapter 1 Drive Animator Overview

• using System;
• using System.Collections.Generic;
• using System.Linq;
• using System.Text;
• using ConsoleApplication1.ServiceReference1;

• namespace ConsoleApplication1
• {
• class Program
• {
• static void Main(string[] args)
• {
• string currentStatus="";
• RemoteServiceClient client = new RemoteServiceClient();

• currentStatus = "OpenRemoteSession";
• WhisperResponse r = client.OpenRemoteSession("username", "password");
• if (r.ErrorCode != 0) goto BAIL;

• currentStatus = "OpenProject";
• client.OpenProject("DriveAnimator Sample");
• if (r.ErrorCode != 0) goto BAIL;

• currentStatus = "ProbeDevice";
• r = client.ProbeDevice(null);
• if (r.ErrorCode != 0) goto BAIL;

• currentStatus = "StartLog";
• r = client.StartLog("MyLog");
• if (r.ErrorCode != 0) goto BAIL;

• bool isSequencerCompleted=false;
• while (!isSequencerCompleted)
• {
• currentStatus = "GetLogStatus";
• r = client.GetLogStatus();
• if (r.ErrorCode != 0) goto BAIL;

• int logStatus = 0;//
• try
• {
• logStatus=int.Parse(r.Results[WhisperResponseValueName.Result] as string);
• }
• catch
• {
• Console.WriteLine("Error Pasring the log status");
• goto BAIL;
• }

• if (logStatus == 118 || logStatus==0) //sequencer completed or logging has stopped
• {
• isSequencerCompleted = true;
• }
• else if (logStatus != 117)

Drive Animator API Reference Guide 17


Chapter 1 Drive Animator Overview

• {
• Console.WriteLine("Logging is encountering some issue: "+logStatus);
• }

• System.Threading.Thread.Sleep(1000);
• }


• currentStatus = "StopLog";
• r=client.StopLog();
• if (r.ErrorCode != 0) goto BAIL;

• //export the drive recorded just now
• currentStatus = "ExportDrive";
• r=client.ExportDrive("DemoPlan");
• if (r.ErrorCode != 0) goto BAIL;

• bool isExportCompleted = false;
• while (!isExportCompleted)
• {
• currentStatus = "GetExportStatus";
• r = client.GetExportStatus();
• if (r.ErrorCode != 0) goto BAIL;

• int exportStatus = 0;//
• try
• {
• exportStatus = int.Parse(r.Results[WhisperResponseValueName.Result] as string);
• }
• catch
• {
• Console.WriteLine("Error Pasring the export status");
• goto BAIL;
• }

• if (exportStatus != 101) //no more in progress
• {
• isExportCompleted = true;
• if (exportStatus != 0)
• {
• Console.WriteLine("ExportDrive failed, code: " + exportStatus);
• }
• }

• System.Threading.Thread.Sleep(1000);
• }


• BAIL:
• //report error if there is any
• if (r.ErrorCode != 0)
• {
• Console.WriteLine("Error ocurred in \"" + currentStatus + "\", ErrorCode: " +
r.ErrorCode.ToString());
• }

• //close remote session so other may have a chance to access DriveAnimator
• try

18 Drive Animator API Reference Guide


Chapter 1 Drive Animator Overview

• {
• client.CloseRemoteSession();
• }
• catch{}
• client = null;

• //wait for any key to terminate the console
• Console.WriteLine("Press ANY key to continue...");
• while (true)
• {
• if (Console.KeyAvailable) break;
• System.Threading.Thread.Sleep(100);
• }

• }
• }
• }

Drive Animator API Reference Guide 19


Chapter 1 Drive Animator Overview

Setting up the Client Program Using Perl

Perl Sample Code

The following sample code demonstrates the following scenario

• Open a remote session.

• Open a project that consists of a device setup to make a call control test, followed by a FTP test (each test
is configured to run a single iteration).

• Probe the device.

• Start log.

• Poll log status.

• When the sequencer is complete, stop log.

• Export the log.

• Close the remote session

use strict;

use warnings;

use APIFrameWork;

#===========================================================================

# Global declarations

#===========================================================================

our $WebServer = 'http://10.66.32.52:8010/RemoteService';

our $UserID = "test1";

our $Password = "1tset";

our $LogMaxTime = 10;

#===========================================================================

# Local declarations

#===========================================================================

my $Return;

my $ReturnMessage;

20 Drive Animator API Reference Guide


Chapter 1 Drive Animator Overview

my $ProjectName = "DriveAnimator";

my $LogName = "Test1";

my $LogTime = 10;

my $ExportPlan = "TestExportPlan";

my $SequencerSetup;

my $Loop=1;

my $TimeProgress = 0;

#===========================================================================

# Main

#===========================================================================

#Opening a remote session

print ("Opening NiXT Session ... \n");

$Return = APIFrameWork::OpenRemoteSession($WebServer,$UserID,$Password);

if ($Return != 0)

{ print ("Error in opening NiXT Session\n");

APIFrameWork::CloseRemoteSession($WebServer);

exit();

else {

print ("NiXT Session opened successfully\n");

#Opening Project

print ("Opening Project $ProjectName ... \n");

$Return = APIFrameWork::OpenProject($WebServer, $ProjectName);

if ($Return != 0)

{ print ("Error in opening Project $ProjectName\n");

APIFrameWork::CloseRemoteSession($WebServer);

exit();

Drive Animator API Reference Guide 21


Chapter 1 Drive Animator Overview

else {

print ("Project $ProjectName opened successfully\n");

#Probe Device

print ("Probing Device ... \n");

my @Return = APIFrameWork::ProbeDevice($WebServer);

if ($Return[0] != 0)

{ print ("Error in probing device\n");

APIFrameWork::CloseRemoteSession($WebServer);

exit();

else {

$SequencerSetup = $Return[1];

#Start Logging

print ("Starting the Test Sequence... \n");

$Return = APIFrameWork::StartLog($WebServer, $LogName);

if ($Return != 0)

{ print ("Error in starting log $LogName\n");

APIFrameWork::CloseRemoteSession($WebServer);

exit();

else {

print ("Log $LogName started successfully\n");

print ("Sleeping for $LogTime seconds\n");

sleep($LogTime);

#Get Logging Status

22 Drive Animator API Reference Guide


Chapter 1 Drive Animator Overview

$Loop=1;

$TimeProgress=0;

do {

print ("Getting Logging Status... \n");

my @ReturnValues = APIFrameWork::GetLoggingStatus($WebServer, $SequencerSetup);

$Return = $ReturnValues[0];

$ReturnMessage = $ReturnValues[1];

if ($Return != 0)

{ print ("Error in Log Status... $Return\n");

APIFrameWork::CloseRemoteSession($WebServer);

exit();

else {

if ($ReturnMessage == 117)

{ $TimeProgress += 5;

sleep(5);

if ($TimeProgress > $LogMaxTime)

{ print ("Max Timer for logging exceeded\n");

$Loop = 0;

else {

$Loop = 0;

}while ( $Loop == 1);

#Stop Logging

print ("Stopping the Test Sequence... \n");

$Return = APIFrameWork::StopLog($WebServer);

if ($Return != 0)

Drive Animator API Reference Guide 23


Chapter 1 Drive Animator Overview

{ print ("Error in stopping logging\n");

APIFrameWork::CloseRemoteSession($WebServer);

exit();

else {

print ("Log $LogName stopped successfully\n");

#Export Drive

print ("Exporting Drive... \n");

$Return = APIFrameWork::ExportDrive($WebServer,$ExportPlan);

if ($Return != 0)

{ print ("Error in starting export of plan $ExportPlan\n");

APIFrameWork::CloseRemoteSession($WebServer);

exit();

else {

print ("$ExportPlan export started successfully\n");

#Get Export Status

$Loop=1;

do {

print ("Getting Export Status... \n");

my @ReturnValues = APIFrameWork::GetExportStatus($WebServer, $SequencerSetup);

$Return = $ReturnValues[0];

$ReturnMessage = $ReturnValues[1];

if ($Return != 0)

{ print ("Error in Export Status... $Return\n");

APIFrameWork::CloseRemoteSession($WebServer);

exit();

24 Drive Animator API Reference Guide


Chapter 1 Drive Animator Overview

else {

if ($ReturnMessage == 0)

{ print ("Exporting completed successfully\n");

$Loop = 0;

else {

if ($ReturnMessage == 101)

{ print ("Exporting in progress, sleep for 5 secs\n");

sleep(5);

else

{ print ("Error in exporting\n");

$Loop = 0;

}while ( $Loop == 1);

#Closing a remote session

print ("Closing NiXT Session ... \n");

$Return = APIFrameWork::CloseRemoteSession($WebServer);

if ($Return != 0)

{ print ("Error in closing NiXT Session\n");

exit();

else {

print ("NiXT Session closed successfully\n");

Drive Animator API Reference Guide 25


Chapter 1 Drive Animator Overview

Setting up the Client Program Using Python

Python Sample Code

The following sample code demonstrates the following scenario

• Open a remote session.

• Open a project that consists of a device setup to make a call control test, followed by a FTP test (each test
is configured to run a single iteration).

• Probe the device.

• Start log.

• Poll log status.

• When the sequencer is completed, stop log.

• Export the log.

• Close the remote session

Note: When you execute the program, make sure that OpenRemoteSession has a valid user name and password.

# Requires Python 2.7.x

import sys

import time

import AnimatorAPI

# Update these values before running this script

ip = "10.10.10.10"

user = "username"

pw = "password"

proj = "DriveAnimator Sample"

fn = "MyLog"

expplan = "DemoPlan"

print "connecting to " + ip + " ..."

26 Drive Animator API Reference Guide


Chapter 1 Drive Animator Overview

AnimatorAPI.OpenRemoteSession(ip, user, pw)

if AnimatorAPI.errno != 0:

print "failed to open remote session! rc = ", AnimatorAPI.errno

sys.exit()

print "opening project " + proj + " ..."

AnimatorAPI.OpenProject(ip, proj)

if AnimatorAPI.errno != 0:

print "failed to open project! rc = ", AnimatorAPI.errno

sys.exit()

print "probing devices..."

rc = AnimatorAPI.ProbeDevice(ip, [])

if AnimatorAPI.errno != 0:

print "failed to probe devices! rc = ", rc

sys.exit()

time.sleep(5)

print "starting data collection..."

rc = AnimatorAPI.StartLog(ip, fn)

if AnimatorAPI.errno != 0:

print "failed to start recording! rc = ", AnimatorAPI.errno

sys.exit()

print "waiting for test to finish",

while rc != 118:

Drive Animator API Reference Guide 27


Chapter 1 Drive Animator Overview

print ".",

time.sleep(5)

rc = AnimatorAPI.GetLogStatus(ip)

print "test completed!"

print "stopping data collection..."

AnimatorAPI.StopLog(ip)

if AnimatorAPI.errno != 0:

print "failed to stop recording! rc = ", AnimatorAPI.errno

sys.exit()

time.sleep(10)

print "exporting data",

AnimatorAPI.ExportDrive(ip, expplan)

if AnimatorAPI.errno != 0:

print "failed to export data! rc = ", AnimatorAPI.errno

sys.exit()

rc = 101

while rc == 101:

print ".",

time.sleep(5)

rc = AnimatorAPI.GetExportStatus(ip)

if rc == 0:

print "data export completed!"

else:

print "error in exporting data! rc = ", rc

print "closing remote session..."

28 Drive Animator API Reference Guide


Chapter 1 Drive Animator Overview

AnimatorAPI.CloseRemoteSession(ip)

if AnimatorAPI.errno != 0:

print "failed to close remote session! rc = ", AnimatorAPI.errno

sys.exit()

print "bye!"

Drive Animator API Reference Guide 29


2
Working with Drive Animator APIs

This section describes the API commands that are generic to E6474A. For APIs that require frame and item iden-
tifiers, please refer to the SetMonitorDataItems for the frame and item identifiers that are used in the E6474A.

Drive Animator API Reference Guide 31


Chapter 2 Working with Drive Animator APIs

OpenRemoteSession
Use this command to open a remote session with PC that runs E6474A. If the authentication is disabled, you can
input dummy user name and password or empty string instead.

Input
Parameter Data Type Description
username String The username used to log into PC
password String The password used to log into PC

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Prerequisite
• SUS license

• E6474A must not be in one of the following states:

 Dialog editing mode

 Playback mode

 Recording mode

Remarks
• This command checks for the SUS license before the OpenRemoteSession can be considered success. If
the command is successful, E6474A enters a “lock” mode. In the “lock” mode, the E6474A GUI is locked and
all the hot keys (accelerators) are disabled.

• If the Authentication in the Remote Service is disabled, the command does not perform authentication.

• During the “lock” mode, pop-up windows/dialogs are avoided e.g. If a command failed, it will return error code
instead of prompting user for input with a pop-up window/dialog.

CloseRemoteSession
Use this command to close the remote session from the PC that runs E6474A.

Input
None

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

32 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

Prerequisite
Requires a remote session to be established.

Remarks
• This command “unlocks” E6474A. If the command is successful, the GUI works again and all the hot keys
(accelerators) are enabled.

• It does not stop the recording that is in progress.

• You can also click on the Lock image in the E6474A window to close the remote session.

QueryVersion
Use this command to query the version of E6474A and Drive Animator API.

Input
None

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix
VersionList String List of versions

Example
<versions>

<version type=”E6474A” version=”17.0.401.xxx” />

<version type=”API” version=”1.0” />

</versions>

Prerequisites
Requires a remote session to be established

Remarks
• The E6474A version is in <major>.<minor>.<build>.<revision> format.

• The API’s version is in <major>.<minor> format.

QueryLicense
Use this command to query the licenses available in E6474A.

Drive Animator API Reference Guide 33


Chapter 2 Working with Drive Animator APIs

Input
None

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix
Result String List of versions

Example
<licenses>

<license type=”Data Measurement” licensed=”Y” />

</licenses>

Field Description
type The type of license
licensed The status of the license. Y = yes, N = No. For SUS license, it contains the license serial number
and the expiry date.

Prerequisite
• Requires a remote session to be established

Remarks
• This command retrieves the license information that is displayed in the License Information dialog from the
E6474A About dialog.

OpenProject
Use this command to open an existing project in E6474A.

Input
Parameter Data Type Description
projectName String The name of the project to be opened

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Prerequisite
• Requires a remote session to be established.
• E6474A must not be in recording state.

34 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

Remarks
If the project does not exist, this command returns an error code without closing the current project. If the project is
unable to open due to error such as corrupted project, E6474A will switch to the start-up state where no project is
opened.

GetHardwareSetup
Use this command to get the hardware setup in the active project. This retrieves the list of hardware devices in the
project.

Input
None

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The hardware setup in the active project

Example
<devicegroups>

<devicegroup instance=”xxxxx” caption=”iPERF DL” enabled=”True”>

<device instance=”xxxxx” caption=”Trace” enabled=”True” />

<device instance=”xxxxx” caption=”Dialup” enabled=”True” />

</devicegroup>

</devicegroups>

Field Description
instance The unique identifier (GUID) of the devicegroup or device
caption The friendly name of the devicegroup or device
enabled The status of the device

Prerequisites
 Requires a remote session to be established
 Requires a project to be opened

Remarks
This command retrieves both the checked and unchecked devices in the Hardware tree of the active project.

Drive Animator API Reference Guide 35


Chapter 2 Working with Drive Animator APIs

ProbeDevice
Use this command to probe the device(s) in the active project.

Input
Parameter Data Type Description
deviceList String The list of devices to be probed. You need to
pass the GUID of the hardware. You can get
the GUID using the command GetHardware-
Setup.

The input is in the XML format. If the string is


empty, the program will probe all the devices
connected in the project and you do not need
to pass the string in the XML format.

Example
<devicegroups>

<devicegroup instance=”xxxxx”>

</devicegroups>

Field Description
instance The unique identifier (GUID) of the devicegroup or device

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The list of probe result. If the input DeviceList


is an empty string, this field is not used.

Example
<proberesults>

<proberesult errorcode=”0” />

</proberesults>

Field Description
errorcode Refer to the error codes in the Appendix

Prerequisite
• Requires a remote session to be established.

36 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

• Requires a project to be opened.


• E6474A must not be in recording state.

Remarks
The results in the ProbeResultList are arranged in the same order as the devices in the DeviceList.

GetDeviceProperties
Use this command to get the properties of a device in the active project.

Input
Parameter Data Type Description
deviceKey String The unique identifier (GUID) of the device. It
refers to the instance field retrieved using the
GetHardwareSetup command.

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The list of probe result. If the input DeviceList


is an empty string, this field is not used.

Drive Animator API Reference Guide 37


Chapter 2 Working with Drive Animator APIs

Example
<properties>

<property key=”Port” caption=”Port” type=”Integer” value=”3” />

</properties>

Parameter Description
key The identifier of the property

caption The friendly name of the property


type The data type of the property
value The value of the property

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

Remarks
This command retrieves all the visible properties of the device.

Listed below are properties whose value is always set to empty string because they are not readable by the user:

• User

SetDevicePropertyValue
Use this command to set the value of a device property in the active project.

Input
Parameter Data Type Description
deviceKey String The unique identifier (GUID) of the device. It
refers to the instance field retrieved using the
GetHardwareSetup command.
propertyKey String The identifier of the property
propertyValue String The value of the property

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

38 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

Remarks
This command sets the property value of certain data type. Refer to the section Property Data Types for the sup-
ported list of data type. Although the command performs some data validation for the new property value, user
should make sure that the given value is valid.

GetSequencerSetup
Use this command to set the sequencer setup in the active project

Input
None

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The sequencer setup in the active project

Example
<sequencer instance=”xxxxx” caption=”SERVICE_MODEL” enabled=”True”>

<sequencer instance=”xxxxx” caption=”Samsung WCDMA” enabled=”True”>

<sequencer instance=”xxxxx” caption=”iPERF_DL” enabled=”True” />

</sequencer>

Parameter Description
instance The unique identifier (GUID) of the sequencer node.
caption The friendly name of the sequencer node
enabled The status of the sequencer node

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

Remarks
This command sets the property value of certain data type. Refer to Section Property Data TypesError! Reference
source not found. for the list of supported data types. Although the command performs some data validation for
the new property value, you should make sure that the given value is valid.

Drive Animator API Reference Guide 39


Chapter 2 Working with Drive Animator APIs

GetTestProperties
Use this command to get the properties of a test in the active project

Input
Parameter Data Type Description
testKey String The unique identifier (GUID) of the device. It
refers to the instance field retrieved using the
GetSequencerSetup command.

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The list of test properties

Example
<properties>

<property key=”TestName” caption=”Name” type=”String” value=”iPERF DL” />

</properties>

Parameter Description
key The identifier of the property

caption The friendly name of the property


type The data type of the property
value The value of the property

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

Remarks
This command retrieves all the visible properties of the device.

Listed below are the properties whose value is always set to empty string because they are not readable by the
user:

• User

40 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

SetTestPropertyValue
Use this command to set the value of a test property in the active project

Input
Parameter Data Type Description
testKey String The unique identifier (GUID) of the device. It
refers to the instance field retrieved using the
GetSequencerSetup command.
propertyKey String The identifier of the property
propertyValue String The value of the property

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

Remarks
This command sets the property value of certain data type. Refer to the section Property Data Types for the sup-
ported list of data type.

Although the command performs some data validation for the new property value, user should make sure that the
given value is valid.

GetTestStatus
Use this command to get the status of a test in the active project

Input
Parameter Data Type Description
testKey String The unique identifier (GUID) of the device. It
refers to the instance field retrieved using the
GetSequencerSetup command.

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The status of the test

Drive Animator API Reference Guide 41


Chapter 2 Working with Drive Animator APIs

Example 1
<teststatus action=”Started” pass=”9” fail=”0” iteration=”10” />

Example 2
<teststatus action=”Not Started” />

Parameter Description
action The status of the test

pass The number of passes


fail The number of failures
iteration The number of iterations

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

Remarks
If the test is not started, the command returns the TestStatus as shown in the Example 2.

GetEventSetup
Use this command to get the event setup in the project

Input
None

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The status of the test

Example
<events>

<event caption=”Samsung LTE Device – GSM To UMTS Handover Complete” />

</events>

Parameter Description
caption The name of the event

42 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

Remarks
This command retrieves the event setup under the Project node in the Active Events List of the active project. The
event setup under the Project node is used for the next recording.

GetEventStatus
Use this command to get the status of an event in the active project

Input
Parameter Data Type Description
eventKey String The caption of the event. It refers to the cap-
tion field retrieved using the GetEventSetup
command.

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The status of the event.

Example
<eventstatus occurrence=”10” />

Field Description
occurrence The number of occurrences

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

TriggerUserEvent
Use this command to trigger a user event during recording

Input
Parameter Data Type Description
eventMessage String The text to be associated with the user event

Drive Animator API Reference Guide 43


Chapter 2 Working with Drive Animator APIs

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Prerequisite
• Requires a remote session to be established.

• E6474A must be in the recording state.

Remarks
This command is similar to the F12 user event in E6474A during recording which allows you to tag a message to
the event.

SetMonitorDataItems
Use this command to set the list of device’s data items to be monitored.

Input
Parameter Data Type Description
dataItemList String The list of data items. This must be in XML
format.

Example
<dataitems>

<dataitem instance=”xxxxx” frame=”xxxxx” item=”xxxxx” />

</dataitems>

Field Description
instance The unique identifier (GUID) of the device. It refers to the instance field retrieved using the
GetHardwareSetup command.
frame The identifier of the frame. You must right click the frame in the E6474A and select copy key to
read the frame key
Item The identifier of the item. You must right click the item element in the E6474A and select copy
key to read the item key.

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The list of monitor result

44 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

Example
<monitorresults>

<monitorresult errorcode=”0” />

</monitorresults>

Field Description
errorcode Refer to the error codes in the Appendix

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

• E6474A must not be in the recording state.

Remarks
This command replaces all the existing monitored data items. If the DataItemList consists of both valid and invalid
data items, those valid data items with “0” errorcode will be monitored.

The results in the MonitorResultList are arranged in the same order as the data items in the DataItemList.

Listed below are data types which are not supported:

• Protocol

The identifier of the frame or item is displayed in the bottom of the data item view when a frame or item is selected.

Drive Animator API Reference Guide 45


Chapter 2 Working with Drive Animator APIs

Right-click on the frame/item will show a dropdown menu to copy and paste it while writing the script.

46 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

GetMonitorDataItemValue
Use this command to get the value of a monitored data item

Input
Parameter Data Type Description
deviceKey String The unique identifier (GUID) of the device. It
refers to the instance field retrieved using the
GetHardwareSetup command.
frameKey String The identifier of the frame that consists of the
item. Refer to the FrameDoc.xml.
itemKey String The identifier of the item. Refer to the
FrameDoc.xml.

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The value of the item

Prerequisite
• Requires a remote session to be established.

• Data items must be registered using the SetMonitorDataItem command

• E6474A must be in the recording state.

Remarks
This command formats the item’s value into a readable format.

Example
For Position data type, it is formatted into “55:59:04.29N 3:33:57.14W”.

GetSystemEventStatus
Use this command to get the status of a system event

Input
Parameter Data Type Description
systemEvent Integer The unique identifier of the system event.
0 – Cable alarm
1 – License missing
2 – GPS missing

Drive Animator API Reference Guide 47


Chapter 2 Working with Drive Animator APIs

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result String The status of the system event


Not triggered
Triggered

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened

Example
For Position data type, it is formatted into “55:59:04.29N 3:33:57.14W”.

ShowWorkspace
Use this command to show a workspace.

Input
Parameter Data Type Description
workspaceName String The name of the workspace

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened

StartLog
Use this command to start the recording.

Input
Parameter Data Type Description
logName String The name of the recording

48 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result Integer Refer to the log status code in Appendix

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened

• E6474A must not be in the recording state

Remarks
This command overrides the Auto-Naming setting. It will use the LogName even if the Auto-Naming is enabled. It
will also replace any invalid characters found in the LogName with underscore (‘_’).

If the LogName already exists, it will auto append a running number to the LogName for the new recording.

e.g. “Untitled” becomes “Untitled (2)”

StopLog
Use this command to stop the recording.

Input
None

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened

• E6474A must be in the recording state

GetLogStatus
Use this command to get the status of the latest recording.

Input
None

Drive Animator API Reference Guide 49


Chapter 2 Working with Drive Animator APIs

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result Integer Refer to the log status code in Appendix

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened

Remarks
If there is no active recording, this command returns the log status of the previous recording.

ExportDrive
Use this command to export an active drive in E6474A based on a predefined export plan. The exported drive can
be found in <My Documents>\Agilent Technologies\E6474A-X\<ActiveProjectName>\DriveAnimatorExport\ on
your PC.

Input
Parameter Data Type Description
exportPlan String The name of the predefined export plan

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Prerequisite
• Requires a remote session to be established.

• Requires a project to be opened.

• Requires an active drive to be opened.

• Requires a compatible version of export wizard.

• There must be no other export operation in progress.

Remarks
This command fails if an export operation is in progress.

50 Drive Animator API Reference Guide


Chapter 2 Working with Drive Animator APIs

GetExportStatus
Use this command to get the latest export status whether the drive has been successfully exported or not.

Input
None

Output
Parameter Data Type Description
ErrorCode Integer Refer to the error codes in Appendix

Result Integer Refer to the Export Status Code in Appendix

Prerequisite
• Requires a remote session to be established.

Remarks
If there is no export operation in progress, this command returns the log status of the previous export.

Drive Animator API Reference Guide 51


A
Appendix A Code and Data Types
Error Codes
Tables describes the error codes that you may encounter when you call the API commands

Error Code Description Remark


0 Success The execution of the command is successful.
1 Error General error. The command failed to execute.
100 Authentication failed Either the username or password is incorrect.
101 Session not established Unable to establish a remote session. This can be due to network error.
102 E6474A not launched E6474A application is not launched.
103 E6474A not responsive E6474A is either busy or hang.

200 SUS license not available SUS license is either not available or expired.
201 E6474A in used E6474A is not ready for remote session. It can be in one of the following
state:
 Dialog editing
 Playback
 Record
202 Syntax error General syntax error.

300 Field not specified A required field cannot be found in the input parameter.
301 Project not found The project cannot be found in the project manager.
302 Project corrupted The project cannot be opened due to a corrupted project file.
303 Project not opened There is no active project.
304 Device not found The device cannot be found in the hardware tree.
305 Device not connected Either device is not connected or device port is not assigned correctly.
306 Device not enabled The device is unchecked in the hardware tree.
307 Frame not found The frame cannot be found in the device.
308 Data item not found The data item cannot be found in the frame.
309 Test not found The test cannot be found in the sequencer tree.
310 Test not enabled The test is unchecked in the sequencer tree.
311 Property not found The property cannot be found in the device or sequencer test.
312 Property not supported The property value cannot be set because its data type is not supported.
Refer to the section Log Status Codes.

Document Title 53
Index

313 Property disabled The property value cannot be set because it is disabled.
314 Drive not opened There is no active drive.
315 Drive already existed The drive already existed. (not used)
316 Drive name not specified The drive name is not specified as an input parameter.
317 Event not found The event cannot be found in the active event list.
318 Text not specified A required text cannot be found in the input parameter.
319 Data item not monitored The data item cannot be found in the list of monitor data items.
320 Data item not supported The data item cannot be monitored.
321 Workspace not found The workspace cannot be found.
322 System event not found The system event is not a valid system event.

400 Record - InProgress There is a recording in progress.


401 Record - CannotStart The recording cannot be started due to one of the following reason:
 Indoor map is not setup properly:
 No predefined waypoints
 No anchor point
 GPS device is not switched off
402 Record - NotStarted There is no recording.
500 Export - Failed Unknown export failure.
Index

501 Export - ExecutableNotFound Unable to locate Export Wizard executable.


502 Export - IncompatibleWizard Incompatible version of Export Wizard.
503 Export - NoExportPlan Unable to locate the export plan.
504 Export - DataExist The export data already existed.
505 Export - NoDrive There is no drive to be exported.
506 Export - NotStarted There is no export.
507 Export - InProgress There is an export in progress.

Log Status Codes


The following tables are the Log Status Codes when you perform recording

Status Code Description Remark


0 NormalTermination The recording is stopped normally.
100 Unknown Unknown record failure.
101 Abort The recording is aborted.
102 NoDevices There is no device enabled.
103 NoMultiPhoneLicense There is no multi-phone license.
104 StartupFailure General record start-up failure.
105 FileOpenFailure General file I/O failure.
106 DeviceProbeFailure Unable to probe a device.
107 NoRecLogLicense There is no record/log license.
108 NoSUSTechLicense There is no SUS Tech license.
109 NoSUSBasicLicense There is no SUS Basic license.
110 InvalidSUSLicense The SUS Basic/Tech license is invalid.
111 AdvanceSUSLicense The SUS Basic/Tech license is advance.
112 ExpiredSUSLicense The SUS Basic/Tech license is expired.
113 LicensePollFailure The license polling is unsuccessfully.
114 RecordFailure General record failure
115 DeviceLoadFailure Unable to load a device
116 COMPortConflict There is a COM Port conflict.
117 InProgress The recording is in progress.
118 SequencerCompleted The sequencer is completed.

Document Title 55
Index

Export Status Codes


The following table displays the status code of the export operation

Status Code Description Remark


0 Completed The export is completed.
100 Failed Unknown export failure.
101 InProgress The export is in progress.
102 IncompatibleExportPlan The export plan is not suitable for the drive.
103 NoDataToExport The drive does not contain any data to be ex-
ported.
Index

Property Data Types


Each device/test property is assigned to a data type. You can use SetDevicePropertyValue and Set-
TestPropertyValue commands to set the property value of certain data types.

List of supported data types:

• Bool

• Chips

• Integer

• Long

• UInteger

• ULong

• Float

• String

• Password

• Enumeration

• Path

• File

List of unsupported data types:

• FreqRange

• Frequency

• PNList

• IntList

• FreqList

• DateTime

• Color

• Dialup

• Font

• Nic

Document Title 57
Index

• FTPMultiFile

Вам также может понравиться