mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 23:30:03 +02:00
Merge branch 'eiger_receiver' into devel_leo
Conflicts: Makefile include/UDPInterface.h slsReceiver/Makefile slsReceiver/eigerReceiver/eigerReceiver.cpp slsReceiver/eigerReceiver/eigerReceiverDummy.cpp slsReceiver/eigerReceiver/eigerReceiverTest.cpp
This commit is contained in:
commit
ce0b32b558
@ -17,8 +17,6 @@ DFLAGS= -g -DDACS_INT -DSLS_RECEIVER_UDP_FUNCTIONS
|
||||
|
||||
INCLUDES?= -Iinclude -I../slsDetectorCalibration -I$(ASM)
|
||||
|
||||
#-I$(SRCDIR)Interface
|
||||
|
||||
SRC_CLNT = MySocketTCP.cpp UDPInterface.cpp UDPBaseImplementation.cpp UDPStandardImplementation.cpp slsReceiverTCPIPInterface.cpp slsReceiver.cpp slsReceiverUsers.cpp utilities.cpp
|
||||
MAIN_SRC = main.cpp
|
||||
|
||||
@ -67,17 +65,18 @@ mysocket_test:
|
||||
|
||||
|
||||
clean: buildclean
|
||||
make testclean
|
||||
rm $(DESTDIR)/libSlsReceiver.a $(DESTDIR)/libSlsReceiver.so
|
||||
rm $(PROGS)
|
||||
ifeq (,$(wildcard $(TESTDIR/rec)))
|
||||
make testclean
|
||||
endif
|
||||
|
||||
|
||||
buildclean:
|
||||
rm -rf $(OBJS)
|
||||
|
||||
testclean:
|
||||
cd $(TESTDIR) && rm *.o rec send
|
||||
if [ -f $(TESTDIR)/rec ]; then \
|
||||
cd $(TESTDIR) && rm *.o rec send; \
|
||||
fi
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -1,5 +1,6 @@
|
||||
#ifndef UDPINTERFACE_H
|
||||
#define UDPINTERFACE_H
|
||||
|
||||
/***********************************************
|
||||
* @file UDPInterface.h
|
||||
* @short base class with all the functions for a receiver, set/get parameters, start/stop etc.
|
||||
@ -12,6 +13,7 @@
|
||||
* @short base class with all the functions for a receiver, set/get parameters, start/stop etc.
|
||||
*/
|
||||
|
||||
|
||||
#include "sls_receiver_defs.h"
|
||||
#include "receiver_defs.h"
|
||||
#include "MySocketTCP.h"
|
||||
@ -27,6 +29,39 @@ void print_not_implemented(string method_name){
|
||||
|
||||
class UDPInterface {
|
||||
|
||||
/* abstract class that defines the public interface of an sls detector data receiver.
|
||||
*
|
||||
* Use the factory method slsReceiverBase::create() to get an instance:
|
||||
*
|
||||
* slsReceiverBase *receiver = slsReceiverBase::create()
|
||||
*
|
||||
* supported sequence of method-calls:
|
||||
*
|
||||
* initialize() : once and only once after create()
|
||||
*
|
||||
* get*() : anytime after initialize(), multiples times
|
||||
* set*() : anytime after initialize(), multiple times
|
||||
*
|
||||
* startReceiver(): anytime after initialize(). Will fail if state already is 'running'
|
||||
*
|
||||
* abort(),
|
||||
* stopReceiver() : anytime after initialize(). Will do nothing if state already is idle.
|
||||
*
|
||||
* getStatus() returns the actual state of the data receiver - running or idle. All other
|
||||
* get*() and set*() methods access the local cache of configuration values only and *do not* modify the data receiver settings.
|
||||
*
|
||||
* Only startReceiver() does change the data receiver configuration, it does pass the whole configuration cache to the data receiver.
|
||||
*
|
||||
* get- and set-methods that return a char array (char *) allocate a new array at each call. The caller is responsible to free the allocated space:
|
||||
*
|
||||
* char *c = receiver->getFileName();
|
||||
* ....
|
||||
* delete[] c;
|
||||
*
|
||||
* always: 1:YES 0:NO for int as bool-like arguments
|
||||
*
|
||||
*/
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -45,6 +80,10 @@ class UDPInterface {
|
||||
static UDPInterface *create(string receiver_type = "standard");
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the Receiver
|
||||
@param detectorHostName detector hostname
|
||||
|
68
slsReceiverSoftware/slsReceiver/Makefile
Normal file
68
slsReceiverSoftware/slsReceiver/Makefile
Normal file
@ -0,0 +1,68 @@
|
||||
include ../../Makefile.include
|
||||
|
||||
DESTDIR ?= ../../bin
|
||||
LIBDIR ?= $(DESTDIR)
|
||||
PROGS = $(DESTDIR)/slsReceiver
|
||||
|
||||
|
||||
CFLAGS += -DSLS_RECEIVER_UDP_FUNCTIONS -O3
|
||||
CPPFLAGS = ${CFLAGS} # for MAC
|
||||
|
||||
|
||||
LDFLAGRXR ?= -L$(LIBDIR) -lSlsReceiver -L/usr/lib64/ -lpthread
|
||||
LDFLAGRXR += -lm -lstdc++
|
||||
|
||||
|
||||
INCLUDES ?= -I ../MySocketTCP -I ../slsDetectorCalibration -I ../includes -I eigerReceiver -I . -I ../slsDetectorSoftware/commonFiles
|
||||
SRC_CLNT = main.cpp
|
||||
|
||||
|
||||
INSTMODE = 0777
|
||||
OBJS = $(SRC_CLNT:.cpp=.o)
|
||||
|
||||
|
||||
.PHONY: all receiver clean static_receiver boot eigerReceiver lib
|
||||
|
||||
all: receiver
|
||||
|
||||
receiver: $(DESTDIR)/slsReceiver
|
||||
|
||||
static_receiver: $(DESTDIR)/sslsReceiver
|
||||
|
||||
boot: $(OBJS)
|
||||
|
||||
$(DESTDIR)/sslsReceiver: lib
|
||||
echo $(OBJS)
|
||||
echo $(LDFLAGRXR)
|
||||
echo $(LIBS)
|
||||
mkdir -p $(DESTDIR)
|
||||
$(CXX) -static -o $@ $(SRC_CLNT) $(FLAGS) $(INCLUDES) $(CLAGS) $(LIBS) $(LDFLAGRXR)
|
||||
|
||||
|
||||
$(DESTDIR)/slsReceiver: eigerReceiver lib
|
||||
$(CXX) -o $@ $(SRC_CLNT) $(FLAGS) $(INCLUDES) $(CLAGS) $(LIBS) $(LDFLAGRXR) -fPIC
|
||||
#$(EIGERFLAGS)
|
||||
|
||||
|
||||
ifeq ($(EIGERSLS), yes)
|
||||
eigerReceiver:
|
||||
$(CXX) $(FLAGS) $(CFLAGS) $(INCLUDES) -fPIC -c -o eigerReceiverTest.o eigerReceiver/eigerReceiverTest.cpp $(EIGERFLAGS)
|
||||
$(CXX) $(FLAGS) $(CFLAGS) $(INCLUDES) -fPIC -c -o eigerReceiver.o eigerReceiver/eigerReceiver.cpp $(EIGERFLAGS)
|
||||
$(CXX) eigerReceiverTest.o eigerReceiver.o -o eigerReceiver/eigerReceiverTest $(EIGERFLAGS)
|
||||
else ifeq ($(ROOTSLS), yes)
|
||||
eigerReceiver: eigerReceiver/eigerReceiverDummy.cpp
|
||||
echo "Compiling with root"
|
||||
$(CXX) $(FLAGS) $(CFLAGS) $(INCLUDES) -fPIC -c -o eigerReceiver.o eigerReceiver/eigerReceiverDummy.cpp $(ROOTFLAGS)
|
||||
else
|
||||
eigerReceiver: eigerReceiver/eigerReceiverDummy.cpp
|
||||
$(CXX) $(FLAGS) $(CFLAGS) $(INCLUDES) -fPIC -c -o eigerReceiver.o eigerReceiver/eigerReceiverDummy.cpp
|
||||
endif
|
||||
|
||||
lib:
|
||||
cd ../ && $(MAKE) DESTDIR=../bin LIBDIR=../bin
|
||||
|
||||
clean:
|
||||
rm -rf $(PROGS) *.o eigerReceiverTest $(DESTDIR)/libSlsReceiver.a $(DESTDIR)/libSlsReceiver.so core
|
||||
|
||||
|
||||
|
259
slsReceiverSoftware/slsReceiver/eigerReceiver/eigerReceiver.cpp
Normal file
259
slsReceiverSoftware/slsReceiver/eigerReceiver/eigerReceiver.cpp
Normal file
@ -0,0 +1,259 @@
|
||||
/*
|
||||
* eigerReceiver.cpp
|
||||
*
|
||||
* Created on: Mar 11, 2014
|
||||
* Author: billich
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "eigerReceiver.h"
|
||||
|
||||
|
||||
/* uncomment next line to enable debug output */
|
||||
#define EIGER_DEBUG
|
||||
|
||||
/* macro for debug output http://stackoverflow.com/a/14256296 */
|
||||
#ifdef EIGER_DEBUG
|
||||
#define DEBUG(x) do { std::cerr << x << std::endl; } while (0)
|
||||
#else
|
||||
#define DEBUG(x)
|
||||
#endif
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct EigerReceiverInitializationConfiguration {
|
||||
|
||||
string detectorHostname;
|
||||
};
|
||||
|
||||
struct EigerReceiverScanConfiguration {
|
||||
|
||||
string fileName;
|
||||
string filePath;
|
||||
int dynamicRange;
|
||||
int scanTag;
|
||||
int numberOfFrames;
|
||||
bool doFileWrite;
|
||||
bool doFileOverWrite;
|
||||
|
||||
EigerReceiverScanConfiguration():
|
||||
dynamicRange(-1),
|
||||
scanTag(-1),
|
||||
numberOfFrames(-1),
|
||||
doFileWrite(false),
|
||||
doFileOverWrite(false){};
|
||||
};
|
||||
|
||||
class EigerReceiverImplementation: public EigerReceiver {
|
||||
|
||||
public:
|
||||
|
||||
EigerReceiverImplementation() : isInitialized(false), status(slsReceiverDefs::ERROR) {};
|
||||
|
||||
void initialize(const char *detectorHostname) {
|
||||
|
||||
string name;
|
||||
if (detectorHostname != NULL) {
|
||||
name = detectorHostname;
|
||||
}
|
||||
|
||||
if (name.empty()) {
|
||||
DEBUG("initialize(): can't initialize with empty string or NULL for detectorHostname");
|
||||
} else if (isInitialized == true) {
|
||||
DEBUG("initialize(): already initialized, can't initialize several times");
|
||||
} else {
|
||||
DEBUG("initialize(): initialize() with: detectorHostName=" << name << ".");
|
||||
init_config.detectorHostname = name;
|
||||
isInitialized = true;
|
||||
status = slsReceiverDefs::IDLE;
|
||||
}
|
||||
|
||||
#ifdef SALA
|
||||
//REST call - hardcoded
|
||||
RestHelper rest ;
|
||||
rest.init("localhost",8080);
|
||||
std::string answer;
|
||||
std::cout << "---- REST test 1: true, string "<< std::endl;
|
||||
int code = rest.get_json("status", &answer);
|
||||
std::cout << "Answer: " << answer << std::d::endl;
|
||||
|
||||
std::cout << "---- REST test 2: 404, string "<< std::endl;
|
||||
code = rest.get_json("statuss", &answer);
|
||||
if (code != 0){
|
||||
//throw -1;
|
||||
std::cout << "I SHOULD THROW AN EXCEPTION!!!" << std::endl;
|
||||
}
|
||||
|
||||
std::cout << "---- REST test 3: true, json object "<< std::endl;
|
||||
JsonBox::Value json_value;
|
||||
code = rest.get_json("status", &json_value);
|
||||
std::cout << "JSON " << json_value["status"] << std::endl;
|
||||
|
||||
answer = "";
|
||||
std::cout << "---- REST test 4: POST, string "<< std::endl;
|
||||
code = rest.post_json("recipes/cassoela", &answer);
|
||||
std::cout << "POST answer: " << answer << std::endl;
|
||||
if (code != 0){
|
||||
//throw -1;
|
||||
std::cout << "I SHOULD THROW AN EXCEPTION!!!" << std::endl;
|
||||
}
|
||||
|
||||
RestHelper rest2 ;
|
||||
rest2.init("reallyfake",8080);
|
||||
std::cout << "---- REST test 4: host not found, json object "<< std::endl;
|
||||
JsonBox::Value json_value2;
|
||||
code = rest2.get_json("status", &json_value2);
|
||||
if (code != 0){
|
||||
//throw -1;
|
||||
std::cout << "I SHOULD THROW AN EXCEPTION!!!" << std::endl;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
char *getDetectorHostname() const {
|
||||
string name = init_config.detectorHostname;
|
||||
if (name.empty()) {
|
||||
DEBUG("getDetectorHostname(): Return NULL");
|
||||
return(NULL);
|
||||
}
|
||||
char *c = new char[name.length()+1];
|
||||
name.copy(c, name.length());
|
||||
c[name.length()] = '\0';
|
||||
DEBUG("getDetectorHostname(): Return " << c << ".");
|
||||
return(c);
|
||||
}
|
||||
|
||||
char *getFileName() const {
|
||||
string name = scan_config.fileName;
|
||||
|
||||
char *c = new char[name.length()+1];
|
||||
name.copy(c, name.length());
|
||||
c[name.length()] = '\0';
|
||||
DEBUG("getFileName(): Return " << c);
|
||||
return(c);
|
||||
}
|
||||
|
||||
char *getFilePath() const {
|
||||
string name = scan_config.filePath;
|
||||
|
||||
char *c = new char[name.length()+1];
|
||||
name.copy(c, name.length());
|
||||
c[name.length()] = '\0';
|
||||
DEBUG("getFilePath(): Return " << c);
|
||||
return(c);
|
||||
}
|
||||
|
||||
int getDynamicRange() const {
|
||||
DEBUG("getDynamicRange(): Return " << scan_config.dynamicRange);
|
||||
return(scan_config.dynamicRange);
|
||||
}
|
||||
|
||||
int getScanTag() const {
|
||||
DEBUG("getScanTag(): returns " << scan_config.scanTag);
|
||||
return(scan_config.scanTag);
|
||||
}
|
||||
|
||||
int getNumberOfFrames() const {
|
||||
DEBUG("getNumberOfFrames(): return " << scan_config.numberOfFrames);
|
||||
return(scan_config.numberOfFrames);
|
||||
}
|
||||
|
||||
int getEnableFileWrite() const {
|
||||
DEBUG("getEnableFileWrite() returns " << scan_config.doFileWrite);
|
||||
return(scan_config.doFileWrite);
|
||||
}
|
||||
|
||||
int getEnableOverwrite() const {
|
||||
DEBUG("getEnableOverwrite() returns " << scan_config.doFileOverWrite);
|
||||
return(scan_config.doFileOverWrite);
|
||||
}
|
||||
|
||||
slsReceiverDefs::runStatus getStatus() const {
|
||||
DEBUG("getStatus(): return " <<status);
|
||||
return(status);
|
||||
}
|
||||
|
||||
char *setFileName(const char c[]) {
|
||||
DEBUG("setFileName() called with " << c <<".");
|
||||
scan_config.fileName = c;
|
||||
return(this->getFileName());
|
||||
}
|
||||
|
||||
char *setFilePath(const char c[]) {
|
||||
DEBUG("setFilePath() called with " << c << ".");
|
||||
scan_config.filePath = c;
|
||||
return(this->getFilePath());
|
||||
}
|
||||
|
||||
int setDynamicRange (const int dr) {
|
||||
DEBUG("setDynamicRange() called with " << dr << '.');
|
||||
scan_config.dynamicRange = dr;
|
||||
return(getDynamicRange());
|
||||
}
|
||||
|
||||
int setScanTag (const int tag) {
|
||||
DEBUG("setScanTag() called with " << tag);
|
||||
scan_config.scanTag = tag;
|
||||
return(getScanTag());
|
||||
}
|
||||
|
||||
int setNumberOfFrames (const int fnum) {
|
||||
DEBUG("setNumberOfFrames() called with " << fnum);
|
||||
scan_config.numberOfFrames = fnum;
|
||||
return(getNumberOfFrames());
|
||||
}
|
||||
|
||||
int setEnableFileWrite(const int i) {
|
||||
DEBUG("enableFileWrite() called with " << i);
|
||||
scan_config.doFileWrite = i;
|
||||
return(getEnableFileWrite());
|
||||
}
|
||||
|
||||
int setEnableOverwrite(const int i) {
|
||||
DEBUG("setEnableOverwrite() called with " << i);
|
||||
scan_config.doFileOverWrite = i;
|
||||
return(getEnableOverwrite());
|
||||
}
|
||||
|
||||
int startReceiver(char message[]) {
|
||||
DEBUG("startReceiver(): return 0.");
|
||||
status = slsReceiverDefs::RUNNING;
|
||||
message = NULL;
|
||||
return(0);
|
||||
}
|
||||
|
||||
int stopReceiver() {
|
||||
DEBUG("stopReceiver(): return 0.");
|
||||
status = slsReceiverDefs::IDLE;
|
||||
return(0);
|
||||
}
|
||||
|
||||
void abort() {
|
||||
DEBUG("abort(): return 0.");
|
||||
status = slsReceiverDefs::IDLE;
|
||||
}
|
||||
|
||||
// Temporary workaround
|
||||
int setDetectorType(slsReceiverDefs::detectorType det){
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
EigerReceiverScanConfiguration scan_config;
|
||||
EigerReceiverInitializationConfiguration init_config;
|
||||
bool isInitialized;
|
||||
slsReceiverDefs::runStatus status;
|
||||
};
|
||||
|
||||
EigerReceiver *EigerReceiver::create(void) {
|
||||
DEBUG("create(): Return new EigerReceiverImplementation instance.");
|
||||
return new EigerReceiverImplementation();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* eigerReceiver.cpp
|
||||
*
|
||||
* Created on: Mar 11, 2014
|
||||
* Author: billich
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "eigerReceiver.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct EigerReceiverInitializationConfiguration {
|
||||
string detectorHostname;
|
||||
};
|
||||
|
||||
struct EigerReceiverScanConfiguration {
|
||||
|
||||
string fileName;
|
||||
string filePath;
|
||||
int dynamicRange;
|
||||
int scanTag;
|
||||
int numberOfFrames;
|
||||
bool doFileWrite;
|
||||
bool doFileOverWrite;
|
||||
|
||||
EigerReceiverScanConfiguration():
|
||||
dynamicRange(-1),
|
||||
scanTag(-1),
|
||||
numberOfFrames(-1),
|
||||
doFileWrite(false),
|
||||
doFileOverWrite(false){};
|
||||
};
|
||||
|
||||
class EigerReceiverImplementation: public EigerReceiver {
|
||||
|
||||
public:
|
||||
|
||||
EigerReceiverImplementation(){};
|
||||
|
||||
~EigerReceiverImplementation(){};
|
||||
|
||||
void initialize(const char *detectorHostname) {}
|
||||
|
||||
char *getDetectorHostname() const { return (char*)"";}
|
||||
|
||||
char *getFileName() const {return (char*)"";}
|
||||
|
||||
char *getFilePath() const {return (char*)"";}
|
||||
|
||||
int getFileIndex() const {return 0;}
|
||||
|
||||
int getDynamicRange() const { return 0;}
|
||||
|
||||
int getScanTag() const {return 0;}
|
||||
|
||||
int getNumberOfFrames() const {return 0;}
|
||||
|
||||
int getEnableFileWrite() const {return 0;}
|
||||
|
||||
int getEnableOverwrite() const {return 0;}
|
||||
|
||||
slsReceiverDefs::runStatus getStatus() const { return slsReceiverDefs::IDLE;}
|
||||
|
||||
char *setFileName(const char c[]) {return (char*)"";}
|
||||
|
||||
char *setFilePath(const char c[]) {return (char*)"";}
|
||||
|
||||
int setDynamicRange (const int dr) {return 0;}
|
||||
|
||||
int setScanTag (const int tag) {return 0;}
|
||||
|
||||
int setNumberOfFrames (const int fnum) {return 0;}
|
||||
|
||||
int setEnableFileWrite(const int i) {return 0;}
|
||||
|
||||
int setEnableOverwrite(const int i) {return 0;}
|
||||
|
||||
int startReceiver(char message[]) {return 0;}
|
||||
|
||||
int stopReceiver() {return 0;}
|
||||
|
||||
void abort() {}
|
||||
|
||||
private:
|
||||
EigerReceiverScanConfiguration scan_config;
|
||||
EigerReceiverInitializationConfiguration init_config;
|
||||
bool isInitialized;
|
||||
slsReceiverDefs::runStatus status;
|
||||
|
||||
};
|
||||
|
||||
EigerReceiver *EigerReceiver::create(void) {
|
||||
return new EigerReceiverImplementation();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* eigerReceiverTest.cpp
|
||||
|
||||
*
|
||||
* Created on: Mar 11, 2014
|
||||
* Author: billich
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "eigerReceiver.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
|
||||
const char *name = "detectors_host_name";
|
||||
const char *empty = "";
|
||||
std::string prefix = "main: ";
|
||||
cout <<prefix<< "start EigerReceiver tests" << endl;
|
||||
|
||||
|
||||
EigerReceiver *receiver = EigerReceiver::create();
|
||||
|
||||
int status = receiver->getStatus();
|
||||
char *c0 = receiver->getDetectorHostname();
|
||||
if (c0 == NULL) {
|
||||
cout <<prefix<< "getDetectorHostname() returned NULL, as expected before initialization." << endl;
|
||||
}
|
||||
delete[] c0;
|
||||
|
||||
cout <<prefix<< "initialize 4 times - only the second should work" << endl;
|
||||
receiver->initialize(empty);
|
||||
status = receiver->getStatus();
|
||||
receiver->initialize(name);
|
||||
status = receiver->getStatus();
|
||||
receiver->initialize(name);
|
||||
status = receiver->getStatus();
|
||||
receiver->initialize((char *)NULL);
|
||||
|
||||
cout << endl;
|
||||
|
||||
status = receiver->getStatus();
|
||||
char *c6 = receiver->getDetectorHostname();
|
||||
cout <<prefix<< "got detector hostname " << c6 << " after initialization;" <<endl<<endl;
|
||||
delete[] c6;
|
||||
|
||||
cout <<prefix<< "try get*() methods before set*() - expect default values" <<endl;
|
||||
char *c1 = receiver->getFileName();
|
||||
cout <<prefix<< "got file name <" << c1 <<">." << endl;
|
||||
delete[] c1;
|
||||
|
||||
char *c2 = receiver->getFilePath();
|
||||
cout <<prefix<< "got path name <" << c2 <<">." << endl;
|
||||
delete[]c2;
|
||||
|
||||
int range = receiver->getDynamicRange();
|
||||
cout <<prefix<< "got dynamic range " << range << endl;
|
||||
|
||||
int tag = receiver->getScanTag();
|
||||
cout <<prefix<< "got scan tag " << tag << endl;
|
||||
cout << endl;
|
||||
|
||||
char *c3 = receiver->setFileName( "some_other_name");
|
||||
cout <<prefix<< "got file name <" << c3 << "> after setting to <some_other_name>" << endl << endl;
|
||||
delete[] c3;
|
||||
|
||||
char *c4 = receiver->setFilePath( "some_other_path");
|
||||
cout <<prefix<< "got file path <" << c4 << "> after setting to <some_other_path>" << endl << endl;
|
||||
delete[] c4;
|
||||
|
||||
range = receiver->setDynamicRange(8);
|
||||
cout <<prefix<< "got dynamic range " << range << " after setting it to 8." << endl << endl;
|
||||
|
||||
tag = receiver->setScanTag(99);
|
||||
cout << "got scan tag " << tag << " after setting to 99." << endl << endl;
|
||||
|
||||
int n = receiver->setNumberOfFrames(11);
|
||||
cout << "got number of frames " << n << " after setting to 11." << endl << endl;
|
||||
|
||||
int w = receiver->setEnableFileWrite(1);
|
||||
cout << "got enable file write " << w << " after setting to 1." << endl << endl;
|
||||
|
||||
char *c5;
|
||||
status = receiver->getStatus();
|
||||
receiver->startReceiver(c5);
|
||||
status = receiver->getStatus();
|
||||
receiver->stopReceiver();
|
||||
status = receiver->getStatus();
|
||||
receiver->abort();
|
||||
status = receiver->getStatus();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user