hComm

Declared In:

Introduction

class that defines the interface to a Hyperion instrument



Member Functions

close
connect
execute_command
read_data
read_response
set_timeout
write_command
write_data
~hComm

close


public

virtual int close() = 0;
Discussion

close the communication channel to the instrument (virtual)


connect


public

virtual int connect() = 0;
Discussion

open a communication channel and establish a connection (virtual)


execute_command


public

const hResponse execute_command( std::string command, std::string argument, uint8_t requestOptions);
Parameters
command

The hyperion command to be sent.

argument

The command argument.

requestOptions

options that determine the output returned by the hyperion Instrument

Return Value

0 if successful, 1 if there is an error returned by the instrument, or -1 if there is a system error. If there is an error returned by the instrument, then the error message will be contained in response.message. If there is a system error, use get_last_error() to get the error message.

Discussion

Execute a hyperion command by sending a command and reading a response.


read_data


protected

virtual int read_data( uint32_t numBytes, uint8_t data[]) = 0;
Parameters
numBytes

the number of Bytes to be returned.

data

the data returned as an array of bytes.

Return Value

returns the number of bytes read, or -1 if there is an error

Discussion

Read raw data back from a communication channel (virtual).


read_response


public

const hResponse read_response();
Return Value

0 if successful, 1 if there is an error returned by the instrument, or -1 if there is a system error. If there is an error returned by the instrument, then the error message will be contained in response.message. If there is a system error, use get_last_error() to get the error message.

Discussion

Read a structured response from a Hyperion instrument. Throws HyperionException on error.


set_timeout


public

virtual int set_timeout( int timeout) = 0;
Discussion

set the timeout value in milliseconds for the specified channel. (virtual)


write_command


public

int write_command( std::string command, std::string argument, uint8_t requestOptions);
Parameters
command

The hyperion command to be sent.

argument

The command argument.

requestOptions

options the determine the output returned by the hyperion Instrument

Discussion

Write a hyperion command to the instrument. Throws HyperionException on error.


write_data


protected

virtual ssize_t write_data( const char *data, size_t dataCount) = 0;
Parameters
data

Data buffer to write.

dataCount

number of dataBytes to write out

Return Value

Returns number of bytes written if successful, -1 otherwise

Discussion

Write raw data to a communication channel (virtual)


~hComm


public

virtual ~hComm()
Discussion

Destructor for hComm class (virtual)