/* drvXXXGpib.c */
/***********************************************************************
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory, and the Regents of the University of
* California, as Operator of Los Alamos National Laboratory, and
* Berliner Elektronenspeicherring-Gesellschaft m.b.H. (BESSY).
* gpibCore is distributed subject to a Software License Agreement
* found in file LICENSE that is included with this distribution.
***********************************************************************/
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
/* epics includes */
#include <dbDefs.h>
#include <taskwd.h>
#include <errlog.h>
#include <epicsMutex.h>
#include <epicsEvent.h>
#include <osiSock.h>
#include <epicsThread.h>
#include <epicsTime.h>
#include <cantProceed.h>
#include "drvHwGpibInterface.h"
typedef struct xxxLink {
    ibLink head;	/* device independent part of link structure */
    /* start of device dependent part of link structure */
}   xxxLink;

static long xxxReport(int level)
{
    return (0);
}
static long xxxInit()
{
    return (0);
}
static long xxxGenLink(ibLink * pibLink, int pass)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxDestroyLink(ibLink * pibLink)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxReportLink(ibLink * pibLink, int level)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxProbe(ibLink * pibLink)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}

static long xxxRead(ibLink * pibLink, int gpibAddr, int secondary,
    char *data, int length, int timeout, int eos)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxWrite(ibLink * pibLink, int gpibAddr, int secondary,
   char *data, int length, int timeout)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxAddressedCmd(ibLink * pibLink, int gpibAddr, int secondary,
  char *data, int length, int timeout)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxUniversalCmd(ibLink * pibLink, int cmd)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}

static long xxxIfc(ibLink * pibLink)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxRen(ibLink * pibLink, int onOff)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}

static long xxxSrqStatus(ibLink * pibLink)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxSrqEnable(ibLink * pibLink)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxSrqDisable(ibLink * pibLink)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static long xxxSerialPollBegin(ibLink * pibLink)
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}
static unsigned char xxxSerialPoll(ibLink * pibLink,int gpibAddr, int secondary,
    int timeout)
{
    hpLink *phpLink = (hpLink *) pibLink;
    unsigned char pollResult;
    return (pollResult);
}
static long xxxSerialPollEnd(ibLink * pibLink);
{
    hpLink *phpLink = (hpLink *) pibLink;
    long status;
    return (status);
}

/* The entry table to this driver. */
drvHwGpibEt drvXXXGpib =
{
    xxxReport,
    xxxInit,
    xxxGenLink,
    xxxDestroyLink,
    xxxReportLink,
    xxxProbe,
    xxxRead,
    xxxWrite,
    xxxAddressedCmd,
    xxxUniversialCmd,
    xxxIfc,
    xxxRen,
    xxxSrqStatus,
    xxxSrqEnableDummy,
    xxxSrqDisableDummy,
    xxxSerialPollBegin,
    xxxSerialPoll,
    xxxSerialPollEnd
};
/******************************************************************************
 * Initialization function to be called (only) from the shell task
 * (ie from the startup file) prior to iocInit.
 ******************************************************************************/
int drvXXXGpibConfig(short link, /* start of device dependent args */ )
{
    xxxLink *pxxxLink;
    /* perform any private initialization */
    /* allocate xxxLink structure */
    pxxxLink = (xxxLink *) calloc(1, sizeof(xxxLink));
    if (!pxxxLink) {
	errlogPrintf("Can't allocate xxxLink structure\n");
	return (-1);
    }
    pxxxLink->head.link = link;
    pxxxLink->head.drvHwGpib = &drvXXXGpib;
    if (drvGpibLinkInit(&pxxxLink->head) != 0)
	free(pxxxLink);
    return 0;
}
