import _gpib82357A
    	

RQS = (1<<11)
SRQ = (1<<12)
TIMEOUT = (1<<14)


class gpib82357A:
    def __init__(self,name="GPIB0::3::INSTR"):
        self.id = _gpib82357A.find(name)

    def write(self,str):
        _gpib82357A.write(self.id, str)

    def cmd(self,str):
        _gpib82357A.cmd(self.id, str)

    def find(self,str):
        self.id = _gpib82357A.find(str)

    def read(self,len=1024):
        self.res = _gpib82357A.read(self.id,len)
        pos=self.res.find('\r')
        self.res=self.res[:pos]
        return self.res

    def readbyte(self,len=1024):
        self.res = _gpib82357A.readbyte(self.id,len)
        return self.res

    def clear(self):
        _gpib82357A.clear(self.id)

    def wait(self,mask):
        _gpib82357A.wait(self.id,mask)

    def rsp(self):
        self.spb = _gpib82357A.rsp(self.id)
        return self.spb

    def trigger(self):
        _gpib82357A.trg(self.id)

    def ren(self,val):
        _gpib82357A.ren(self.id,val)

    def close(self):
        _gpib82357A.close(self.id)