class MessInst : public RegInst {

 

public:

 

MessInst(WORD lAddr) : RegInst(lAddr) { }

 

void Clear(void) { iclear(Inst); }

 

void SendMessage(const char *message);

 

char *ReceiveMessage(char *message, int

maxLen = 80);

char *GetErrorMessage(char *message, int

maxLen = 80);

};

 

#endif

 

INST.CPP

#include <stdlib.h>

#include <stdio.h> #include <string.h> #include "inst.h"

#define BUFLEN 200

/* ************************** RegInst ************************** */

RegInst *RegInst::MappedInst = NULL;

RegInst::RegInst(UWORD lAddr) { char Buf[32];

BaseAddr = NULL; MapSpace = 0; PageStart = 0; PageCount = 0; sprintf(Buf,"vxi,%u",lAddr);

Valid = ((Inst = iopen(Buf)) != NULL) ? 1 : 0; Mapped = 0;

}

RegInst::~ = RegInst(void) { if (Inst != NULL) {

Unmap();

iclose(Inst);

}

}

Continued on Next Page

Chapter 2

Using the Digitizer 79

Page 79
Image 79
HP E1429A manual Inst.Cpp