#include <ngc/core/ngcb.h>Go to the source code of this file.
Classes | |
| struct | ngcpp_cmd_t |
| struct | ngcpp_rep_t |
| struct | ngcpp_win_t |
| struct | ngcpp_hdr_simple |
| struct | ngcpp_data_service |
| struct | ngcpp_req_t |
| struct | ngcpp_reqack_t |
| struct | ngcpp_hdr_t |
| struct | ngcpp_frame_t |
| struct | ngcpp_ftype |
| struct | ngcpp_cfg_t |
| struct | ngcpp_error_t |
| struct | ngcpp_link_cfg_t |
| struct | ngcpp_cmd_client_api |
Typedefs | |
| typedef int | ngcpp_link_t |
| typedef unsigned short | ngcpp_t |
| typedef char | ngcppPARAM_NAMES[ngcppMAX_PARAMSIZE][256] |
| typedef int | ngcppPARAM_VALUES[ngcppMAX_PARAMSIZE] |
| typedef int(* | ngcppMSG_OPEN) (const char *name, ngcpp_link_cfg_t *cfg, char *erms) |
| typedef int(* | ngcppMSG_CLOSE) (int link, ngcpp_link_cfg_t *cfg) |
| typedef int(* | ngcppMSG_CMD) (int link, ngcpp_cmd_t command, char *erms) |
| typedef int(* | ngcppMSG_REPLY) (int link, ngcpp_rep_t *reply, char *erms) |
Functions | |
| int | ngcppExec (const char *host, const char *cmd, int xt, int debugPort, int *pid, char *erms) |
| int | ngcppKill (const char *host, int pid, char *erms) |
| int | ngcppComExec (ngcpp_link_t *link, const char *srvName, const char *cmd, int xt, int debugPort, int *pid, int *cmdPortReal, char *erms) |
| int | ngcppComKill (const char *host, int pid, char *erms) |
| int | ngcppSelectCom (const char *comType, char *erms) |
| int | ngcppAllocCom (char *erms) |
| int | ngcppOpenComLine (const char *srvName, ngcpp_link_t *link, char *erms) |
| int | ngcppCloseComLine (ngcpp_link_t link) |
| int | ngcppTimeout (ngcpp_link_t link, int seconds, char *erms) |
| int | ngcppSendCommand (ngcpp_link_t link, ngcpp_cmd_t command, char *erms) |
| int | ngcppGetReply (ngcpp_link_t link, ngcpp_rep_t *reply, char *erms) |
| void | ngcppErr (char *erms, int errorId) |
| int | ngcppGetParamSetup (ngcpp_link_t link, int *numParame, ngcppPARAM_NAMES paramName, ngcppPARAM_VALUES paramBuf, char *erms) |
| int | ngcppGetParamType (ngcpp_link_t link, const char *paramName, int *type, char *erms) |
| int | ngcppSetParam (ngcpp_link_t link, const char *paramName, int value, char *erms) |
| int | ngcppSetParamBuf (ngcpp_link_t link, int *paramBuf, char *erms) |
| int | ngcppGetParam (ngcpp_link_t link, const char *paramName, int *value, char *erms) |
| int | ngcppGetParamBuf (ngcpp_link_t link, int *paramBuf, char *erms) |
| int | ngcppParamSync (ngcpp_link_t link, int timeout, char *erms) |
| int | ngcppSetChipOffset (ngcpp_link_t link, int startX, int startY, char *erms) |
| int | ngcppChanSelect (ngcpp_link_t link, int chan, char *erms) |
| int | ngcppStart (ngcpp_link_t link, char *erms) |
| int | ngcppResetCnt (ngcpp_link_t link, char *erms) |
| int | ngcppEnd (ngcpp_link_t link, char *erms) |
| int | ngcppStop (ngcpp_link_t link, char *erms) |
| int | ngcppPause (ngcpp_link_t link, int pauseFlag, char *erms) |
| int | ngcppAbort (ngcpp_link_t link, char *erms) |
| int | ngcppExitComServer (ngcpp_link_t link, char *erms) |
| int | ngcppConnect (ngcpp_link_t *link, const char *srvName, char *erms) |
| int | ngcppPing (ngcpp_link_t link, char *erms) |
| int | ngcppGetStatus (ngcpp_link_t link, int *status, char *erms) |
| int | ngcppGetRev (ngcpp_link_t link, int *rev1, int *rev2, char *erms) |
| int | ngcppGetTime (ngcpp_link_t link, double *loopTime, double *calcTime, char *erms) |
| int | ngcppSetSimTime (ngcpp_link_t link, int simTime, char *erms) |
| int | ngcppSetSimStartDelay (ngcpp_link_t link, int simTime, char *erms) |
| int | ngcppVerbose (ngcpp_link_t link, int vflag, char *erms) |
| int | ngcppGetConfig (ngcpp_link_t link, ngcpp_cfg_t *config, char *erms) |
| int | ngcppGetRecvStat (ngcpp_link_t link, int *err, int *stat, char *erms) |
| int | ngcppGetErrPort (ngcpp_link_t link, int *errPort, char *erms) |
| int | ngcppGetDataPort (ngcpp_link_t link, int *dataPort, char *erms) |
| int | ngcppGetDataPath (ngcpp_link_t link, char *path, char *erms) |
| int | ngcppSetDataPath (ngcpp_link_t link, const char *path, char *erms) |
| int | ngcppSendDynCmd (ngcpp_link_t link, int cmdCode, int timeout, char *erms) |
| int | ngcppExecUsrCmd (ngcpp_link_t link, const char *usrCommand, char *usrReply, char *erms) |
| int | ngcppMemClose (ngcpp_link_t link, char *erms) |
| int | ngcppMemSync (ngcpp_link_t link, int id, char *erms) |
| int | ngcppUploadBuf (ngcpp_link_t link, char *buf, int id, int size, int blockSize, char *erms) |
| int | ngcppFlushOutputQueue (ngcpp_link_t link, char *erms) |
| int | ngcppSetFilePubBase (ngcpp_link_t link, char *baseName, char *erms) |
| int | ngcppSetFilePubPath (ngcpp_link_t link, int id, char *path, char *erms) |
| int | ngcppLcuRdAddr (ngcpp_link_t link, unsigned int addr, unsigned int *value, char *erms) |
| int | ngcppLcuWrAddr (ngcpp_link_t link, unsigned int addr, unsigned int value, char *erms) |
| int | ngcppLcuRdPci (ngcpp_link_t link, unsigned int addr, unsigned int *value, char *erms) |
| int | ngcppLcuWrPci (ngcpp_link_t link, unsigned int addr, unsigned int value, char *erms) |
| void | ngcppDataInit (void) |
| void | ngcppHdrInit (ngcpp_hdr_t *hdr) |
| int | ngcppDataConnect (const char *srvName, int *socket, int transferMode, int processId, char *erms) |
| int | ngcppDataDisconnect (int socket) |
| int | ngcppPingDataSrv (const char *srvName, char *procName, char *erms) |
| int | ngcppKillDataClient (const char *srvName, int id, char *erms) |
| int | ngcppDataProtocol (const char *srvName, int *version, char *erms) |
| int | ngcppAbortReq (const char *srvName, int processId, char *erms) |
| int | ngcppCancelReq (int socket, int processId, char *erms) |
| int | ngcppSendDataRequest (int socket, ngcpp_req_t request, char *erms) |
| int | ngcppWaitDataReply (int socket, ngcpp_hdr_t *header, char *erms) |
| int | ngcppWaitNextFrame (int socket, ngcpp_req_t request, ngcpp_hdr_t *header, char *erms) |
| int | ngcppPollNextFrame (int socket, ngcpp_req_t request, ngcpp_hdr_t *header, char *erms) |
| int | ngcppSkipFrame (int socket, char *erms) |
| int | ngcppAcceptFrame (int socket, ngcpp_req_t request, ngcpp_frame_t *frame, char *erms) |
| int | ngcppAcceptFrameN (int socket, ngcpp_req_t request, ngcpp_frame_t *frame, int partNo, int numDiv, char *erms) |
| int | ngcppAckFrame (int socket, ngcpp_req_t request, ngcpp_hdr_t *header, char *erms) |
| int | ngcppGetFrameBuf (int socket, ngcpp_frame_t *frame, size_t offset, size_t size, char *erms) |
| int | ngcppGetTypeDef (const char *srvName, int *nTypes, ngcpp_ftype *frameType, char *erms) |
| int | ngcppGetFrameTypes (const char *srvName, int *types, char *erms) |
| void | ngcppScale (ngcpp_frame_t *frame) |
| void | ngcppScale2Real (ngcpp_frame_t *frame) |
| void | ngcppScaleBuf (void *dest, ngcpp_frame_t *frame) |
| void | ngcppScaleBuf2Real (void *dest, ngcpp_frame_t *frame) |
| int | ngcppGetFrameTypeByName (int *type, const char *name, char *erms) |
| int | ngcppGetFrameNameByType (int type, char *name, char *erms) |
| int | ngcppAttachData (char *srvName, size_t bufferSize, char *erms) |
| int | ngcppDetachData (char *srvName) |
| ngcpp_hdr_simple * | ngcppImportData (void **buffer, char *erms) |
| int | ngcppReturnData (char *erms) |
Variables | |
| int | ngcppEndian |
| ngcpp_cmd_client_api * | ngcppSys |
| ngcpp_cmd_client_api | ngcppCmdTcpClient |
| ngcb_sig_t | ngcppSigMask |
| #define ngcppAPP_HDR_SIZE 128 |
Application header data buffer size
| #define ngcppBADPIXMASK 2 |
bad-pixel-mask data-set
| #define ngcppCI_MAX_CON 4 |
Maximum number of command connections
| #define ngcppCOM_ABORT 427 |
abort all
| #define ngcppCOM_CHAN 428 |
select DMA-channel
| #define ngcppCOM_CHIPOFFSET 425 |
set chip offset
| #define ngcppCOM_DATAPORT 424 |
set data server port
| #define ngcppCOM_DYNCMD 413 |
send dynamic command code
| #define ngcppCOM_END 419 |
end of measurement
| #define ngcppCOM_ERRPORT 422 |
set error stack port
| #define ngcppCOM_EXIT 410 |
exit command interpreter
| #define ngcppCOM_FILEBASE 420 |
set file publisher base name
| #define ngcppCOM_FILEPATH 421 |
set file publisher path name
| #define ngcppCOM_FLUSHOUT 417 |
flush all output data queues
| #define ngcppCOM_GETDPATH 430 |
get local data path
| #define ngcppCOM_H_SIZE 8 |
Command message header size
| #define ngcppCOM_ICONF 411 |
get configuration
| #define ngcppCOM_MCLOSE 416 |
remove shared memory data
| #define ngcppCOM_MSET 405 |
download data-set
| #define ngcppCOM_MSYNC 409 |
data-set synchronization
| #define ngcppCOM_NOP 400 |
no operation (ping)
| #define ngcppCOM_PAUSE 426 |
pause
| #define ngcppCOM_PCONF 412 |
get parameter configuration
| #define ngcppCOM_PROT_ENDIAN ngcbBIG_ENDIAN |
Communication protocol endianess
| #define ngcppCOM_PSET 406 |
set parameter
| #define ngcppCOM_PSTAT 407 |
get parameter status
| #define ngcppCOM_PSYNC 408 |
parameter synchronization
| #define ngcppCOM_RECVSTAT 433 |
get errno and status of receiver
| #define ngcppCOM_REV 431 |
get revision
| #define ngcppCOM_RSTCNT 418 |
reset counters
| #define ngcppCOM_SETDPATH 429 |
set local data path
| #define ngcppCOM_SIMDELAY 432 |
set simulation start delay
| #define ngcppCOM_SIMTIME 415 |
set simulation interval time
| #define ngcppCOM_START 401 |
start acquisition
| #define ngcppCOM_STAT 403 |
get processing status
| #define ngcppCOM_STOP 402 |
stop acquisition
| #define ngcppCOM_TIME 404 |
get on-line calcualtion time
| #define ngcppCOM_TIMEOUT -3 |
System timeout command
| #define ngcppCOM_USRCMD 423 |
execute ext. user command
| #define ngcppCOM_VERBOSE 414 |
switch verbose mode on/off
| #define ngcppCOMMAND_PORT 8001 |
Default command port
| #define ngcppDARK 4 |
dark frame (bias)
| #define ngcppDATA_PORT 0 |
Default data port
| #define ngcppDATA_PROT_ENDIAN ngcbBIG_ENDIAN |
Data protocol endianess
| #define ngcppDATA_PROTOCOL 0x1 |
Data protocol version
| #define ngcppDATA_SERVICE_ABORT 3 |
abort request
| #define ngcppDATA_SERVICE_CONNECT 2 |
connection request
| #define ngcppDATA_SERVICE_EXIT 0 |
exit data server
| #define ngcppDATA_SERVICE_EXPORT 7 |
export internals
| #define ngcppDATA_SERVICE_KILL 9 |
kill clienty
| #define ngcppDATA_SERVICE_PING 1 |
ping request
| #define ngcppDATA_SERVICE_PROCNAME 5 |
get process name
| #define ngcppDATA_SERVICE_PROTOCOL 8 |
get protocol version
| #define ngcppDATA_SERVICE_TYPEDEF 6 |
get defines types
| #define ngcppDATA_SERVICE_TYPES 4 |
get frame types
| #define ngcppDEFAULT_TIMEOUT ngcppNO_TIMEOUT |
Default timeout definition
| #define ngcppDTYPE_BYTE 0 |
signed 8-bit integer
| #define ngcppDTYPE_INT16 3 |
signed 16-bit integer
| #define ngcppDTYPE_INT32 4 |
signed 32-bit integer
| #define ngcppDTYPE_INT64 5 |
signed 64-bit integer
| #define ngcppDTYPE_REAL32 1 |
32-bit floating point
| #define ngcppDTYPE_REAL64 2 |
64-bit floating point
| #define ngcppDTYPE_STRING 6 |
string
| #define ngcppDTYPE_UINT16 7 |
unsigned 16-bit integer
| #define ngcppDYN_CMD_IVLD 0 |
invalid command
| #define ngcppDYN_CMD_RESERVED 100 |
reserved command codes
| #define ngcppDYN_CMD_RESET 1 |
reset counters
| #define ngcppENV_COMMAND_PORT "NGCPP_CMD" |
Command port environment variable
| #define ngcppENV_DATA_PATH "NGCPP_DPATH" |
Data path environment variable
| #define ngcppENV_DATA_PORT "NGCPP_DATA" |
Data port environment variable
| #define ngcppENV_DEVNAME "NGCPP_DEV" |
Acquisition device name environment variable
| #define ngcppENV_ERR_PORT "NGCPP_ERR" |
Error port environment variable
| #define ngcppENV_HOST "NGCPP_HOST" |
Acquisition process host environment variable
| #define ngcppERR_ALLOC 406 |
allocation error
| #define ngcppERR_CMD 414 |
command could not be handled
| #define ngcppERR_FILIO 415 |
file i/o error
| #define ngcppERR_GENERAL 400 |
general error
| #define ngcppERR_HANDSHAKE_FRAME 452 |
Frame handshake error
| #define ngcppERR_HANDSHAKE_REQ 451 |
Request handshake error
| #define ngcppERR_INIT 413 |
init failure
| #define ngcppERR_IO_ERROR -1 |
i/o error
| #define ngcppERR_IO_OVERFLOW -3 |
input FIFO overflow
| #define ngcppERR_IO_OVERRUN -2 |
ring buffer overrun
| #define ngcppERR_NO_ERR 0 |
successfull operation
| #define ngcppERR_NO_VALID_COMMAND 401 |
no valid command
| #define ngcppERR_NOT_STARTED 410 |
acquisition is not started
| #define ngcppERR_OPEN 405 |
open error
| #define ngcppERR_OUT_OF_RANGE 402 |
out of range
| #define ngcppERR_PORT 0 |
Default error-stack port
| #define ngcppERR_STARTED 409 |
acquisition is already started
| #define ngcppERR_SYSTEM 411 |
system call
| #define ngcppERR_TERM 407 |
error terminating dma transfers
| #define ngcppERR_TIMEOUT 412 |
timeout
| #define ngcppERR_UNKNOWN 408 |
unknown element
| #define ngcppFAILURE -1 |
General failure
| #define ngcppFLATFIELD 1 |
flatfield data-set
| #define ngcppFRAME_ANY 0xffffffff |
any frame
| #define ngcppFRAME_APP 0x00000800 |
appl. specific type
| #define ngcppFRAME_DIT 0x00000002 |
DIT frame
| #define ngcppFRAME_H_SIZE (int)(sizeof(ngcpp_hdr_t) - ngcppAPP_HDR_SIZE) |
Frame header size (without application data)
| #define ngcppFRAME_HCYCLE1 0x00000080 |
chop half-cycle 1 frame
| #define ngcppFRAME_HCYCLE2 0x00000100 |
chop half-cycle 2 frame
| #define ngcppFRAME_HX_SIZE 24 |
Frame header extension size (for backwards compatibility)
| #define ngcppFRAME_INT 0x00000004 |
INT frame
| #define ngcppFRAME_INTERMEDIATE_DIT 0x00000010 |
intermediata DIT frame
| #define ngcppFRAME_INTERMEDIATE_INT 0x00000008 |
intermediata INT frame
| #define ngcppFRAME_NAME_ANY "ANY_FRAME" |
| #define ngcppFRAME_NAME_APP "APP" |
| #define ngcppFRAME_NAME_DIT "DIT" |
| #define ngcppFRAME_NAME_HCYCLE1 "HCYCLE1" |
| #define ngcppFRAME_NAME_HCYCLE2 "HCYCLE2" |
| #define ngcppFRAME_NAME_INT "INT" |
| #define ngcppFRAME_NAME_INTERMEDIATE_DIT "INTERM-DIT" |
| #define ngcppFRAME_NAME_INTERMEDIATE_INT "INTERM-INT" |
| #define ngcppFRAME_NAME_NO_FRAME "NO_FRAME" |
| #define ngcppFRAME_NAME_NOTIFY "NOTIFY" |
| #define ngcppFRAME_NAME_SAMPLE "SAMPLE" |
| #define ngcppFRAME_NAME_SDV "STDEV" |
| #define ngcppFRAME_NAME_SNAPSHOT "SNAPSHOT" |
| #define ngcppFRAME_NAME_TRACK "TRACK" |
| #define ngcppFRAME_NO_FRAME 0x00000000 |
no frame
| #define ngcppFRAME_NOTIFY 0x00000400 |
notification frame
| #define ngcppFRAME_SAMPLE 0x00000040 |
sample frame
| #define ngcppFRAME_SDV 0x00000020 |
standard deviation frame
| #define ngcppFRAME_SNAPSHOT 0x00000001 |
snapshot frame
| #define ngcppFRAME_TRACK 0x00000200 |
tracking frame
| #define ngcppFSTAT_EXP_END 0x2 |
end exposurer
| #define ngcppFSTAT_ROT90 0x4 |
rotated by 90 deg
| #define ngcppFSTAT_TRANSFERRING 0x1 |
transferring state
| #define ngcppLog | ( | ... | ) |
| #define ngcppMAX_COMBUFSIZE (8 * 1024) |
Command buffer size in bytes
| #define ngcppMAX_DATA_CON 16 |
Maximum number of data connections
| #define ngcppMAX_DEV 12 |
Maximum number of DMA devices
| #define ngcppMAX_FRAME_TYPES 32 |
Maximum numbert of frame types
| #define ngcppMAX_PARAMSIZE 256 |
Maximum number of dynamic parameters
| #define ngcppMAX_USRCMD_LEN 1024 |
Maximum size of the user command/reply
| #define ngcppMES_BACKREPLY 0x0003 |
reply message
| #define ngcppMES_COMMAND 0xffff |
command message
| #define ngcppMES_DATA 0x0002 |
data message
| #define ngcppMES_MESSAGE 0x0004 |
unformatted message
| #define ngcppMODE_NORMAL 2 |
input via DMA
| #define ngcppMODE_PLAYBACK 4 |
play-back mode
| #define ngcppMODE_SIM 1 |
built in simulator
| #define ngcppMODE_STREAM 3 |
streaming mode
| #define ngcppNO_TIMEOUT 0 |
No timeout definition
| #define ngcppNUM_COM (434 - ngcppCOM_NOP) |
| #define ngcppNUM_ELE | ( | x | ) |
Macro computing the number of elements in vector
| #define ngcppPARAM_TYPE_FLOAT 1 |
32-bit floating point parameter
| #define ngcppPARAM_TYPE_INT 4 |
32-bit integer parameter
| #define ngcppPARAM_TYPE_LOGICAL 0 |
Logical parameter (32-bit)
| #define ngcppQUEUE_BLOCK 1 |
Block until queue is free
| #define ngcppQUEUE_SETERR 2 |
Raise error flag and skip frame if output queue is full
| #define ngcppQUEUE_SKIP 0 |
Skip frame if output queue is full
| #define ngcppRAW_RTD SHORT |
Raw data type (RTD)
| #define ngcppREP_H_SIZE 10 |
Reply message header size
| #define ngcppSTAT_FAILURE 4 |
failure state
| #define ngcppSTAT_IDLE 0 |
idle state
| #define ngcppSTAT_PROCESSING 2 |
processing state
| #define ngcppSTAT_READY 3 |
ready state
| #define ngcppSTAT_WAITING 1 |
waiting state
| #define ngcppTFLAG_HOLD 0x00000002 |
hold frame
| #define ngcppTFLAG_LOCAL 0x00000004 |
store to local media
| #define ngcppTFLAG_SKIP 0x00000000 |
skip frame
| #define ngcppTFLAG_TRANSFER 0x00000001 |
transfer frame
| #define ngcppTMODE_INTR 0x10 |
interruptible
| #define ngcppTMODE_NOTRANS 0x00 |
no transfer
| #define ngcppTMODE_SCIENCE 0x01 |
science transfer mode
| #define ngcppTMODE_VIDEO 0x02 |
video transfer mode
| typedef int ngcpp_link_t |
Command link type
| typedef unsigned short ngcpp_t |
Raw data type (signed or unsigened 16 bit integer)
| typedef int(* ngcppMSG_CLOSE) (int link, ngcpp_link_cfg_t *cfg) |
Close function type
| typedef int(* ngcppMSG_CMD) (int link, ngcpp_cmd_t command, char *erms) |
Command function type
| typedef int(* ngcppMSG_OPEN) (const char *name, ngcpp_link_cfg_t *cfg, char *erms) |
Open function type
| typedef int(* ngcppMSG_REPLY) (int link, ngcpp_rep_t *reply, char *erms) |
Reply function type
| typedef char ngcppPARAM_NAMES[ngcppMAX_PARAMSIZE][256] |
Parameter names array type
| typedef int ngcppPARAM_VALUES[ngcppMAX_PARAMSIZE] |
Parameter values array type
| int ngcppAbort | ( | ngcpp_link_t | link, |
| char * | erms ) |
Abort all.
| int ngcppAbortReq | ( | const char * | srvName, |
| int | processId, | ||
| char * | erms ) |
Abort the current frame request.modehronously. The process waiting for the data reply receives immediately a reply. If there was no valid frame when the other side received the abort request, the frame type is set to ngcppFRAME_NO_FRAME and one must neither skip nor accept the frame. If the frame was ready when the other side received the abort command, the valid frame header is sent and the receiving process has to either skip or accept the frame.
| int ngcppAcceptFrame | ( | int | socket, |
| ngcpp_req_t | request, | ||
| ngcpp_frame_t * | frame, | ||
| char * | erms ) |
Accept the frame returned by ngcppWaitNextFrame(). The frame is transferred and read into a buffer. The frame header might be different from the the one received with ngcppWaitDataReply() or ngcppWait/PollNextFrame() (because of windowing or if an error occured in the meantime).
| int ngcppAcceptFrameN | ( | int | socket, |
| ngcpp_req_t | request, | ||
| ngcpp_frame_t * | frame, | ||
| int | partNo, | ||
| int | numDiv, | ||
| char * | erms ) |
Accept the frame returned by ngcppWaitNextFrame(). The frame partition (partNo) out of numDiv partiions is transferred and read into a buffer supplied by the frame structure. The frame header might be different from the the one received with ngcppWaitDataReply() or ngcppWait/PollNextFrame() (because of windowing or if an error occured in the meantime).
| int ngcppAckFrame | ( | int | socket, |
| ngcpp_req_t | request, | ||
| ngcpp_hdr_t * | header, | ||
| char * | erms ) |
Acknowledge the frame for later transfer.
| int ngcppAllocCom | ( | char * | erms | ) |
Allocate the command/reply buffers.
| int ngcppAttachData | ( | char * | srvName, |
| size_t | bufferSize, | ||
| char * | erms ) |
Attach the calling process to acquisition process internal buffers for processing support.
| int ngcppCancelReq | ( | int | socket, |
| int | processId, | ||
| char * | erms ) |
Aborts the current frame request, wait for the data reply and skip an eventually incoming frame. This can only be called from within the same process that has sent the request before.
| int ngcppChanSelect | ( | ngcpp_link_t | link, |
| int | chan, | ||
| char * | erms ) |
Select the DMA interface channel in use.
| int ngcppCloseComLine | ( | ngcpp_link_t | link | ) |
Close link to the ngcpp command interpreter.
| int ngcppComExec | ( | ngcpp_link_t * | link, |
| const char * | srvName, | ||
| const char * | cmd, | ||
| int | xt, | ||
| int | debugPort, | ||
| int * | pid, | ||
| int * | cmdPortReal, | ||
| char * | erms ) |
Execute the command cmd on host. If the flag xt is one, verbose output is done on a new x-terminal. If the debugPort is greater than zero, the verbose output is sent to this port. The function returns a process id (pid) to be used for ngcppComKill() and the actual command server port.
| int ngcppComKill | ( | const char * | host, |
| int | pid, | ||
| char * | erms ) |
Terminates the acquisition process on host.
| int ngcppConnect | ( | ngcpp_link_t * | link, |
| const char * | srvName, | ||
| char * | erms ) |
Connect to the ngcpp command interpreter.
| int ngcppDataConnect | ( | const char * | srvName, |
| int * | socket, | ||
| int | transferMode, | ||
| int | processId, | ||
| char * | erms ) |
Opens a connection to the ngcpp data server. The transferMode can be one of:
ngcppTMODE_SCIENCE - science transfer (for storage) ngcppTMODE_VIDEO - video transfer (not queued)
The server name must be given as string: "host:port"
| int ngcppDataDisconnect | ( | int | socket | ) |
Diconnects from the ngcpp data server
| void ngcppDataInit | ( | void | ) |
Initialize the data interface
| int ngcppDataProtocol | ( | const char * | srvName, |
| int * | version, | ||
| char * | erms ) |
Return the actual data-protocol version used by the acquisition process.
| int ngcppDetachData | ( | char * | srvName | ) |
Detach the calling process from the acquisition process internal buffers.
| int ngcppEnd | ( | ngcpp_link_t | link, |
| char * | erms ) |
Set a flag for the acquisition process to transfer an intermediate result as measurement frame.
| void ngcppErr | ( | char * | erms, |
| int | errorId ) |
Write the error message assigned to errorId to the string in erms.
| int ngcppExec | ( | const char * | host, |
| const char * | cmd, | ||
| int | xt, | ||
| int | debugPort, | ||
| int * | pid, | ||
| char * | erms ) |
Execute an acquisition process on a remote host host. If xt-flag is one, verbose output is done on a new x-terminal. If the debugPort is greater than zero, the verbose output is sent to this port. The function returns a process id (pid) to be used for ngcppComKill().
| int ngcppExecUsrCmd | ( | ngcpp_link_t | link, |
| const char * | usrCommand, | ||
| char * | usrReply, | ||
| char * | erms ) |
Executes an external user command handler at the acquisition process. The command/reply string are passed unchecked.
| int ngcppExitComServer | ( | ngcpp_link_t | link, |
| char * | erms ) |
Terminates the ngcpp command interpreter.
| int ngcppFlushOutputQueue | ( | ngcpp_link_t | link, |
| char * | erms ) |
Flush all data in the output queue(s).
| int ngcppGetConfig | ( | ngcpp_link_t | link, |
| ngcpp_cfg_t * | config, | ||
| char * | erms ) |
Receive the current configuration from the ngcpp command interpreter.
| int ngcppGetDataPath | ( | ngcpp_link_t | link, |
| char * | path, | ||
| char * | erms ) |
Retrieve the path where data is stored to local media.
| int ngcppGetDataPort | ( | ngcpp_link_t | link, |
| int * | dataPort, | ||
| char * | erms ) |
Retrieve the port number of the data server.
| int ngcppGetErrPort | ( | ngcpp_link_t | link, |
| int * | errPort, | ||
| char * | erms ) |
Retrieve the port number of the error-stack server.
| int ngcppGetFrameBuf | ( | int | socket, |
| ngcpp_frame_t * | frame, | ||
| size_t | offset, | ||
| size_t | size, | ||
| char * | erms ) |
Store data (size bytes) in the frame buffer at the given offset.
| int ngcppGetFrameNameByType | ( | int | type, |
| char * | name, | ||
| char * | erms ) |
Set the frame name to the name associated with the type. If the type cannot be resolved ngcppFAILURE is returned.
| int ngcppGetFrameTypeByName | ( | int * | type, |
| const char * | name, | ||
| char * | erms ) |
Set the frame type to the type associated with the given name. If the name cannot be resolved ngcppFAILURE is returned.
| int ngcppGetFrameTypes | ( | const char * | srvName, |
| int * | types, | ||
| char * | erms ) |
Return the currently available frames. A frame-type is available, if types & frame-type != 0.
| int ngcppGetParam | ( | ngcpp_link_t | link, |
| const char * | paramName, | ||
| int * | value, | ||
| char * | erms ) |
Gets the value of paramater definde by paramName. The parameter names are retrieved with ngcppGetParamSetup().
| int ngcppGetParamBuf | ( | ngcpp_link_t | link, |
| int * | paramBuf, | ||
| char * | erms ) |
Receive a parameter buffer from the command interpreter.
| int ngcppGetParamSetup | ( | ngcpp_link_t | link, |
| int * | numParame, | ||
| ngcppPARAM_NAMES | paramName, | ||
| ngcppPARAM_VALUES | paramBuf, | ||
| char * | erms ) |
Receive the currently loaded parameter setup from the ngcpp command interpreter.
| int ngcppGetParamType | ( | ngcpp_link_t | link, |
| const char * | paramName, | ||
| int * | type, | ||
| char * | erms ) |
Return the type of the parameter.
| int ngcppGetRecvStat | ( | ngcpp_link_t | link, |
| int * | err, | ||
| int * | stat, | ||
| char * | erms ) |
Get errno and status of the receiver devices.
| int ngcppGetReply | ( | ngcpp_link_t | link, |
| ngcpp_rep_t * | reply, | ||
| char * | erms ) |
Get reply
| int ngcppGetRev | ( | ngcpp_link_t | link, |
| int * | rev1, | ||
| int * | rev2, | ||
| char * | erms ) |
Receive pre-processor revision
| int ngcppGetStatus | ( | ngcpp_link_t | link, |
| int * | status, | ||
| char * | erms ) |
Receive the current status from the ngcpp command interpreter.
| int ngcppGetTime | ( | ngcpp_link_t | link, |
| double * | loopTime, | ||
| double * | calcTime, | ||
| char * | erms ) |
Receive calculation- and input-loop time (in us/pixel) from the ngcpp command interpreter.
| int ngcppGetTypeDef | ( | const char * | srvName, |
| int * | nTypes, | ||
| ngcpp_ftype * | frameType, | ||
| char * | erms ) |
Receive the frame-type definitions from the data-server. The maximum number of defined frametypes is ngcppMAX_FRAME_TYPES. The function returns an array of frame-type structures. The sturcture array has to be allocated by the calling function. One has to distinguish between defined frametypes and available frametypes, which are a subset of the defined frametypes (the defined frametypes might be enabled/disabled via commands).
| void ngcppHdrInit | ( | ngcpp_hdr_t * | hdr | ) |
Initialize frame header structure
| ngcpp_hdr_simple * ngcppImportData | ( | void ** | buffer, |
| char * | erms ) |
Import a buffer. The buffer must have been allocated by the caller. The address is stored for the later ngcppReturnData call. The function returns a pointer to the header of a buffer to be processed.
| int ngcppKill | ( | const char * | host, |
| int | pid, | ||
| char * | erms ) |
Send a termination signal to the acquisition process on host.
| int ngcppKillDataClient | ( | const char * | srvName, |
| int | id, | ||
| char * | erms ) |
Terminate data client
| int ngcppLcuRdAddr | ( | ngcpp_link_t | link, |
| unsigned int | addr, | ||
| unsigned int * | value, | ||
| char * | erms ) |
Read value from register address.
| int ngcppLcuRdPci | ( | ngcpp_link_t | link, |
| unsigned int | addr, | ||
| unsigned int * | value, | ||
| char * | erms ) |
Read value from PCI configuration space address.
| int ngcppLcuWrAddr | ( | ngcpp_link_t | link, |
| unsigned int | addr, | ||
| unsigned int | value, | ||
| char * | erms ) |
Write value to register address.
| int ngcppLcuWrPci | ( | ngcpp_link_t | link, |
| unsigned int | addr, | ||
| unsigned int | value, | ||
| char * | erms ) |
Write value to PCI configuration space address.
| int ngcppMemClose | ( | ngcpp_link_t | link, |
| char * | erms ) |
Removes a shared memory data area.
| int ngcppMemSync | ( | ngcpp_link_t | link, |
| int | id, | ||
| char * | erms ) |
Swaps the datasets for id (id can be or'ed).
| int ngcppOpenComLine | ( | const char * | srvName, |
| ngcpp_link_t * | link, | ||
| char * | erms ) |
Open link to the ngcpp command interpreter. The link has to be used for all further command calls.
| int ngcppParamSync | ( | ngcpp_link_t | link, |
| int | timeout, | ||
| char * | erms ) |
If parameters are changed, their values are overtaken synchronously with ngcppParamSync(). If this function is called, before the previous synchronization is actually done, the function will block until the specified timeout. The timeout is given in seconds. A value of zero specifies "no timeout".
| int ngcppPause | ( | ngcpp_link_t | link, |
| int | pauseFlag, | ||
| char * | erms ) |
Suspend the data acquisition if pause is one. If pause is zero the acquistion continues.
| int ngcppPing | ( | ngcpp_link_t | link, |
| char * | erms ) |
Ping the ngcpp command interpreter (NOP command).
| int ngcppPingDataSrv | ( | const char * | srvName, |
| char * | procName, | ||
| char * | erms ) |
Checks if the data server is alive. The actual acquisition process name is returned in procName.
| int ngcppPollNextFrame | ( | int | socket, |
| ngcpp_req_t | request, | ||
| ngcpp_hdr_t * | header, | ||
| char * | erms ) |
Checks if a frame matching the request is available. If a frame is available it returns the frame header, and the output on the other end will block until the frame is either skipped or accepted. If no frame is available the frame type in the header is set to ngcppFRAME_NO_FRAME. request.blocking should be set to zero when using this function.
| int ngcppResetCnt | ( | ngcpp_link_t | link, |
| char * | erms ) |
Set a flag for the acquisition process to reset all processing counters.
| int ngcppReturnData | ( | char * | erms | ) |
Return the processed buffer to the acquisition process.
| void ngcppScale | ( | ngcpp_frame_t * | frame | ) |
Scale the frame if frame->h.scal != 1.
| void ngcppScale2Real | ( | ngcpp_frame_t * | frame | ) |
Scale the frame and convert to 32-bit floating point.
| void ngcppScaleBuf | ( | void * | dest, |
| ngcpp_frame_t * | frame ) |
Scale frame if frame->h.scal != 1 and store the result in a separate destination buffer.
| void ngcppScaleBuf2Real | ( | void * | dest, |
| ngcpp_frame_t * | frame ) |
Scale frame, convert to 32-bit floating point and store the result in a separate destination buffer.
| int ngcppSelectCom | ( | const char * | comType, |
| char * | erms ) |
Select the command link API.
| int ngcppSendCommand | ( | ngcpp_link_t | link, |
| ngcpp_cmd_t | command, | ||
| char * | erms ) |
Send command
| int ngcppSendDataRequest | ( | int | socket, |
| ngcpp_req_t | request, | ||
| char * | erms ) |
Send a request to the data output server.
| int ngcppSendDynCmd | ( | ngcpp_link_t | link, |
| int | cmdCode, | ||
| int | timeout, | ||
| char * | erms ) |
Send dynamic command.
| int ngcppSetChipOffset | ( | ngcpp_link_t | link, |
| int | startX, | ||
| int | startY, | ||
| char * | erms ) |
Set the offset of the readout window within the chip (startX, startY start with 1).
| int ngcppSetDataPath | ( | ngcpp_link_t | link, |
| const char * | path, | ||
| char * | erms ) |
Set the path where data is stored to local media.
| int ngcppSetFilePubBase | ( | ngcpp_link_t | link, |
| char * | baseName, | ||
| char * | erms ) |
Change the file publishing sequence base-name. Header information (frame-type, counter) is appended to the basename.
| int ngcppSetFilePubPath | ( | ngcpp_link_t | link, |
| int | id, | ||
| char * | path, | ||
| char * | erms ) |
Change the storage path of a file publisher.
| int ngcppSetParam | ( | ngcpp_link_t | link, |
| const char * | paramName, | ||
| int | value, | ||
| char * | erms ) |
Sets the paramater paramName to the given value. The parameter names are retrieved with ngcppGetParamSetup().
| int ngcppSetParamBuf | ( | ngcpp_link_t | link, |
| int * | paramBuf, | ||
| char * | erms ) |
Send a parameter buffer to the command interpreter.
| int ngcppSetSimStartDelay | ( | ngcpp_link_t | link, |
| int | simTime, | ||
| char * | erms ) |
Set the simulation start delay (in ms) of the built-in simulator.
| int ngcppSetSimTime | ( | ngcpp_link_t | link, |
| int | simTime, | ||
| char * | erms ) |
Set the simulation interval (in ms) of the built-in simulator.
| int ngcppSkipFrame | ( | int | socket, |
| char * | erms ) |
Skip the frame returned by ngcppWaitNextFrame().
| int ngcppStart | ( | ngcpp_link_t | link, |
| char * | erms ) |
Start the data acquisition.
| int ngcppStop | ( | ngcpp_link_t | link, |
| char * | erms ) |
Stop the data acquisition.
| int ngcppTimeout | ( | ngcpp_link_t | link, |
| int | seconds, | ||
| char * | erms ) |
Sets the timout for command replies.
| int ngcppUploadBuf | ( | ngcpp_link_t | link, |
| char * | buf, | ||
| int | id, | ||
| int | size, | ||
| int | blockSize, | ||
| char * | erms ) |
Sets buffer in user reserved memory at the offset position. If blockSize is greater than the maximum command buffer size, the buffer is transferred via a raw socket.
| int ngcppVerbose | ( | ngcpp_link_t | link, |
| int | vflag, | ||
| char * | erms ) |
Switches verbose mode off if vflag is zero, otherwise verbose mode is switched on.
| int ngcppWaitDataReply | ( | int | socket, |
| ngcpp_hdr_t * | header, | ||
| char * | erms ) |
Wait for a reply from the data output server.
| int ngcppWaitNextFrame | ( | int | socket, |
| ngcpp_req_t | request, | ||
| ngcpp_hdr_t * | header, | ||
| char * | erms ) |
Wait for the next (valid) frame matching the request. The frame header is filled with the frame meta data. The output on the other end will block until the frame is either skipped or accepted. If the frametype is ngcppFRAME_NO_FRAME skip/accept must not be done.
|
extern |
Command client i/o API for TCP/IP socket communication
|
extern |
Endianess
|
extern |
Signal mask function
|
extern |
Command client i/o interface API