ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbDrvCom.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <ngc/core/ngcbDrv.h>

Macros

#define _GNU_SOURCE
 
#define _REENTRANT
 

Functions

int ngcbComOpen (const char *devName, char *erms)
 
int ngcbComClose (int fd)
 
int ngcbComGetRev (int fd)
 
int ngcbComRstDev (int fd)
 
int ngcbComReset (int fd)
 
int ngcbComUpLink (int fd, int routeThrough, int rst)
 
int ngcbComTimeout (int fd, int seconds)
 
int ngcbComRead (int fd, char *buffer, int size, char *erms)
 
int ngcbComWrite (int fd, const char *buffer, int size, char *erms)
 
int ngcbComReadStatus (int fd)
 
int ngcbComErrStatus (void)
 
void ngcbComErrStr (int status, char *s)
 
void ngcbComStatStr (int status, char *s)
 

Detailed Description

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ _REENTRANT

#define _REENTRANT

Function Documentation

◆ ngcbComClose()

int ngcbComClose ( int fd)

Close the connection to the front-end.

◆ ngcbComErrStatus()

int ngcbComErrStatus ( void )

Return the saved status value of the last faulty I/O. The saved value is reset to zero on each device open/close.

◆ ngcbComErrStr()

void ngcbComErrStr ( int status,
char * s )

Convert status to an error string

◆ ngcbComGetRev()

int ngcbComGetRev ( int fd)

Return the device driver and hardware revsion. The value is a 32-bit integer scalar containing the driver revision in the lower 16 bits and the hardware revision in the upper 16 bits. Both numbers are virtual and reflect only major changes which are relevant for the application SW.

◆ ngcbComOpen()

int ngcbComOpen ( const char * name,
char * erms )

Open connection to the front-end.

◆ ngcbComRead()

int ngcbComRead ( int fd,
char * buffer,
int size,
char * erms )

Read a number of bytes from the device.

◆ ngcbComReadStatus()

int ngcbComReadStatus ( int fd)

Return the actual value of the communication status register

◆ ngcbComReset()

int ngcbComReset ( int fd)

Performs a reset of the subsystem.

◆ ngcbComRstDev()

int ngcbComRstDev ( int fd)

Performs an interface device reset.

◆ ngcbComStatStr()

void ngcbComStatStr ( int status,
char * s )

Convert status to a string

◆ ngcbComTimeout()

int ngcbComTimeout ( int fd,
int seconds )

Sets the timeout for read/write accesses in seconds.

◆ ngcbComUpLink()

int ngcbComUpLink ( int fd,
int routeThrough,
int rst )

Configure the number of nodes to route through and the route-length from the last skipped node to the front-end global reset function.

◆ ngcbComWrite()

int ngcbComWrite ( int fd,
const char * buffer,
int size,
char * erms )

Write a number of bytes to the device.