14.06.2014 Views

R&S WinIQSIM2 Software Manual - Rohde & Schwarz

R&S WinIQSIM2 Software Manual - Rohde & Schwarz

R&S WinIQSIM2 Software Manual - Rohde & Schwarz

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

R&S ® <strong>WinIQSIM2</strong><br />

Automation of R&S <strong>WinIQSIM2</strong><br />

Remote Control Basics<br />

After the first remote-control command had been send, the R&S <strong>WinIQSIM2</strong> is in a<br />

remote-controlled state.<br />

TcpClient program examples<br />

The following program example shows a simple TcpClient class that is intended to explain<br />

on how to get started with programming of sockets.<br />

The example sets up a socket communication to R&S <strong>WinIQSIM2</strong> and opens a simple<br />

user interface, very similar to the telnet, which allows input of commands. To enable real<br />

automation, further development of the program is required.<br />

TcpClient.h<br />

#include <br />

using namespace std;<br />

//defines structs for socket handling<br />

#ifndef LINUX<br />

#include "Winsock2.h"<br />

#else<br />

#include <br />

#endif<br />

typedef struct sockaddr_in SockAddrStruct;<br />

typedef struct hostent HostInfoStruct;<br />

class TcpClient<br />

{<br />

public:<br />

TcpClient();<br />

~TcpClient();<br />

void connectToServer( string &hostname, int port );<br />

void disconnect( );<br />

void transmit( string &txString );<br />

void receive( string &rxString );<br />

string getCurrentHostName( ) const;<br />

int getCurrentPort( ) const;<br />

private:<br />

string currentHostName;<br />

int currentPort;<br />

<strong>Software</strong> <strong>Manual</strong> 1008.0858.42 ─ 10<br />

138

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!