{QNc@s'ddlZddlZddlZddlZi dd6dd6dd6dd 6d d 6d d 6dd6dd6dd6Zd)\ZZZZ Z d*\Z Z Z d+\ZZZZd,\ZZZZZed#Zd$Zd%ejfd&YZed'kr#edZejj d(eefndS(-iNt11int15it30i,t60iXt12it24i` t48it96i%t19iKiiiiig?iiiitEtBtPtRtNs port not opencCs d|dS(NsCOM%di((tportnum((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pytdevice?stSerialc BseZdZdeeedddedZdZ dZ dZ dZ dZ d d Zd Zd Zd ZdZd dZd dZdZdZdZdZdZRS(s port: number of device; numbering starts at zero. if everything fails, the user can specify a device string, note that this isn't portable any more baudrate: baud rate bytesize: number of databits parity: enable parity checking stopbits: number of stopbits timeout: set a timeout (None for waiting forever) xonxoff: enable software flow control rtscts: enable RTS/CTS flow control retry: DOS retry mode i%ic Cs$t|tdkr$||_nt|d|_t||_t||_|tkrkd|_n`|t krd|_nH|t krd|_n0|t krd|_n|t krd|_nt||_ | |_d|_|j|j|j|j|j|j |j|jdS( NtiR R tOtMtSs sermsdos.tmp(ttypetportstrRt BAUD_RATEStbaudtstrtbytesizet PARITY_NONEtparityt PARITY_EVENt PARITY_ODDt PARITY_MARKt PARITY_SPACEtstoptretrytfilenamet_config( tselftporttbaudrateRRtstopbitsttimeouttxonxofftrtsctsR"((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt__init__Qs(               cCs|jdS(N(tclose(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt__del__yscCsdS(N((R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyR-|sc CsPtjd|dd|d|d|d|d|d|fd }tj|dS( NsMODE t:s BAUD= s PARITY= s DATA= s STOP= s RETRY= s > R(tstringtjointostsystem( R%R&RRtdataR!R"R#t comString((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyR$s  cCs9|j|jt||j|j|j|j|jdS(N(R$RRRRR!R"R#(R%R'((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt setBaudratescCs tdS(s.returns the number of bytes waiting to be readN(tNotImplementedError(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt inWaitingsicCsBtj|jtjtjB}tj||}tj||S(sRead num bytes from serial port(R2topenRtO_RDONLYtO_BINARYtreadR-(R%tnumthandletrv((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyR<s   cCsBtj|jtjtjB}tj||}tj||S(sWrite string to serial port(R2R9RtO_WRONLYR;twriteR-(R%tsR>R?((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyRAs   cCs tdS(N(R7(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt flushInputscCs tdS(N(R7(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt flushOutputscCs tdS(N(R7(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt sendBreakscCs tdS(sSet terminal status lineN(R7(R%tlevel((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pytsetRTSscCs tdS(sSet terminal status lineN(R7(R%RF((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pytsetDTRscCs tdS(sEead terminal status lineN(R7(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pytgetCTSscCs tdS(sEead terminal status lineN(R7(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pytgetDSRscCs tdS(sEead terminal status lineN(R7(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pytgetRIscCs tdS(sEead terminal status lineN(R7(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pytgetCDsc Cs=tjd|j|j|j|j|j|j|jfdS(Ns : t ( R0R1RRRRR!R"R#(R%((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt__repr__sN(t__name__t __module__t__doc__t EIGHTBITSRt STOPBITS_ONEtNonet RETURN_RETRYR,R.R-R$R6R8R<RARCRDRERGRHRIRJRKRLRN(((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyRBs4                 t__main__s%s %s (iiiii(ig?i(iiii(R R R R R (!R2tsysR0tserial.serialutiltserialRRRRRR RStSTOPBITS_ONEANDAHALFt STOPBITS_TWOtFIVEBITStSIXBITSt SEVENBITSRRt RETURN_ERRORt RETURN_BUSYRUt RETURN_READYt RETURN_NONEt ValueErrortportNotOpenErrorRt serialutiltFileLikeRRORBtstdioRA(((s3/usr/lib/python2.7/site-packages/serial/sermsdos.pyt&s.