# slsReceiverUsers Class Reference

Class for implementing the SLS data receiver in the users application. Callbacks can be defined for processing and/or saving data. More...

`#include <slsReceiverUsers.h>`

List of all members.

## Public Member Functions

| slsReceiverUsers (int argc, char *argv[], int &success)
| ~slsReceiverUsers ()
void | closeFile (int p)
int | start ()
void | stop ()
int64_t | getReceiverVersion ()
void | registerCallBackStartAcquisition (int(*func)(char *filepath, char *filename, int fileindex, int datasize, void *), void *arg)
void | registerCallBackAcquisitionFinished (void(*func)(int nf, void *), void *arg)
void | registerCallBackRawDataReady (void(*func)(int framenumber, char *datapointer, int datasize, FILE *filedescriptor, char *guidatapointer, void *), void *arg)

## Static Public Attributes

static slsReceiverTCPIPInterface * | receiver

## Detailed Description

Class for implementing the SLS data receiver in the users application. Callbacks can be defined for processing and/or saving data.

slsReceiverUsers is a class that can be instantiated in the users software to receive the data from the detectors. Callbacks can be defined for processing and/or saving data

Definition at line 21 of file slsReceiverUsers.h.

## Constructor & Destructor Documentation

slsReceiverUsers::slsReceiverUsers | ( | int | argc,
|  | char * | argv[],
|  | int & | success |
| ) |  |  |

Constructor reads config file, creates socket, assigns function table

Parameters:

  | argc | from command line
  | argv | from command line
  | succecc | socket creation was successfull

slsReceiverUsers::~slsReceiverUsers | ( |  | ) |

Destructor

## Member Function Documentation

void slsReceiverUsers::closeFile | ( | int | p | ) |

Close File and exits receiver server

int64_t slsReceiverUsers::getReceiverVersion | ( |  | ) |

get get Receiver Version

Returns:
  id

void slsReceiverUsers::registerCallBackAcquisitionFinished | ( | void(*)(int nf, void *) | func,
|  | void * | arg |
| ) |  |  |

register callback for end of acquisition

Parameters:

  | func | end of acquisition callback. Argument nf is total frames caught

Returns:
  nothing

void slsReceiverUsers::registerCallBackRawDataReady | ( | void(*)(int framenumber, char *datapointer, int datasize, FILE *filedescriptor, char *guidatapointer, void *) | func,
|  | void * | arg |
| ) |  |  |

register callback to be called when data are available (to process and/or save the data).

Parameters:

  | func | raw data ready callback. arguments are framenum datapointer datasize file descriptor guidatapointer (NULL, no data required)

Returns:
  nothing

void slsReceiverUsers::registerCallBackStartAcquisition | ( | int(*)(char *filepath, char *filename, int fileindex, int datasize, void *) | func,
|  | void * | arg |
| ) |  |  |

register calbback for starting the acquisition

Parameters:

  | func | callback to be called when starting the acquisition. Its arguments are filepath filename fileindex data size

Returns:
  0 callback takes care of open,close,write file; 1 callback writes file, we have to open, close it; 2 we open, close, write file, callback does not do anything

int slsReceiverUsers::start | ( |  | ) |

starts listening on the TCP port for client comminication

Returns:
  0 for success or 1 for FAIL in creating TCP server

Referenced by main().

void slsReceiverUsers::stop | ( |  | ) |

stops listening to the TCP & UDP port and exit receiver program

Referenced by main().

## Member Data Documentation

slsReceiverTCPIPInterface* slsReceiverUsers::receiver `[static]`

Definition at line 87 of file slsReceiverUsers.h.

The documentation for this class was generated from the following file:

- slsReceiverUsers.h