Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/serial/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/serial/socket_connection.pyc

ó
*­„Jc@sXddlTddlZddlZddlZiejd6ejd6ejd6ejd6Zde	fd„ƒYZ
yddlZWn*ek
r®d	e
e
fd
„ƒYZnXd	e
ejfd„ƒYZedkrTddlZed
ƒZejjdeƒejjdƒejdƒejƒejjdejdƒƒejƒndS(iÿÿÿÿ(t*NtdebugtinfotwarningterrortSocketSerialcBsÅeZdZd&Zd„Zd„Zd„Zd„Zd„Zd„Z	dd„Z
d„Zd„Zd„Z
dd„Zed„Zed „Zed!„Zd"„Zd#„Zd$„Zd%„ZRS('s-Serial port implementation for plain sockets.i2iKini†i–iÈi,iXi°ii`	iÀi€%iKi–iáiÂcCsûd|_|jdkr'tdƒ‚ny;tjtjtjƒ|_|jj|j	|j
ƒƒWn5tk
r™}d|_td|j
|fƒ‚nX|jjdƒ|j
ƒt|_|jsã|jtƒ|jtƒn|jƒ|jƒdS(sjOpen port with current settings. This may throw a SerialException
           if the port cannot be opened.s.Port must be configured before it can be used.sCould not open port %s: %siN(tNonetloggert_porttSerialExceptiontsockettAF_INETtSOCK_STREAMt_sockettconnecttfromURLtportstrt	Exceptiont
settimeoutt_reconfigurePorttTruet_isOpent_rtsctstsetRTStsetDTRt
flushInputtflushOutput(tselftmsg((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytopen(s"	 	
		

cCs>|jdkrtdƒ‚n|jr:|jjdƒndS(siSet communication parameters on opened port. for the socket://
        protocol all settings are ignored!sCan only operate on open portss!ignored port configuration changeN(R
RR	RR(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyRAs	cCsi|jre|jrLy$|jjtjƒ|jjƒWnnXd|_nt|_tj	dƒndS(s
Close portg333333Ó?N(
RR
tshutdownR
t	SHUT_RDWRtcloseRtFalsettimetsleep(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyR Is			cCstdƒ‚dS(Ns2there is no sensible way to turn numbers into URLs(R	(Rtport((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytmakeDeviceNameXscCsu|jƒjdƒr"|d}ny#d|krõ|jddƒ\}}x©|jdƒD]•}d|kr†|jddƒ\}}nd}|dkrÛtjƒtjdƒ|_|jjt	|ƒ|jj
dƒqYtd	|fƒ‚qYWn|jd
dƒ\}}t|ƒ}d|ko0dknsDtd
ƒ‚nWn#tk
rj}t
d|ƒ‚nX||fS(s(extract host and port from an URL strings	socket://i	t/it=tloggingspySerial.socketsenabled loggingsunknown option: %rt:iisport not in range 0...65535sRexpected a string in the form "[rfc2217://]<host>:<port>[/option[/option...]]": %sN(tlowert
startswithtsplitRR(tbasicConfigt	getLoggerRtsetLevelt
LOGGER_LEVELSRt
ValueErrortintR	(RturltoptionstoptiontvaluethostR$te((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyR[s,

cCs2|jst‚n|jr.|jjdƒndS(s>Return the number of characters currently in the input buffer.s&WARNING: inWaiting returns dummy valuei(RtportNotOpenErrorRR(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyt	inWaitingzs
			icCsÂ|jst‚ntƒ}tjƒ|j}x‡t|ƒ|kr·tjƒ|kr·y |jj|t|ƒƒ}Wq1tj	k
rŽq1q1tj
k
r³}td|ƒ‚q1Xq1Wt|ƒS(sÀRead size bytes from the serial port. If a timeout is set it may
        return less characters as requested. With no timeout it will block
        until the requested number of bytes is read.sconnection failed (%s)(
RR9t	bytearrayR"t_timeouttlenR
trecvR
ttimeoutRR	tbytes(RtsizetdataR?R8((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytread‚s			' cCsY|jst‚ny|jj|ƒWn&tjk
rN}td|ƒ‚nXt|ƒS(sœOutput the given string over the serial port. Can block if the
        connection is blocked. May raise SerialException if the connection is
        closed.ssocket connection failed: %s(RR9R
tsendallR
RR	R=(RRBR8((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytwrite—s		cCs2|jst‚n|jr.|jjdƒndS(s9Clear input buffer, discarding all that is in the buffer.signored flushInputN(RR9RR(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyR¢s			cCs2|jst‚n|jr.|jjdƒndS(sbClear output buffer, aborting the current output and
        discarding all that is in the buffer.signored flushOutputN(RR9RR(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyR¨s			gÐ?cCs9|jst‚n|jr5|jjd|fƒndS(sPSend break condition. Timed, returns to idle state after given
        duration.signored sendBreak(%r)N(RR9RR(Rtduration((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyt	sendBreak¯s			cCs9|jst‚n|jr5|jjd|fƒndS(sJSet break: Controls TXD. When active, to transmitting is
        possible.signored setBreak(%r)N(RR9RR(Rtlevel((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytsetBreak¶s			cCs9|jst‚n|jr5|jjd|fƒndS(s)Set terminal status line: Request To Sendsignored setRTS(%r)N(RR9RR(RRH((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyR½s			cCs9|jst‚n|jr5|jjd|fƒndS(s-Set terminal status line: Data Terminal Readysignored setDTR(%r)N(RR9RR(RRH((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyRÃs			cCs2|jst‚n|jr.|jjdƒntS(s(Read terminal status line: Clear To Sendsreturning dummy for getCTS()(RR9RRR(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytgetCTSÉs
			cCs2|jst‚n|jr.|jjdƒntS(s)Read terminal status line: Data Set Readysreturning dummy for getDSR()(RR9RRR(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytgetDSRÐs
			cCs2|jst‚n|jr.|jjdƒntS(s)Read terminal status line: Ring Indicatorsreturning dummy for getRI()(RR9RRR!(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytgetRI×s
			cCs2|jst‚n|jr.|jjdƒntS(s)Read terminal status line: Carrier Detectsreturning dummy for getCD()(RR9RRR(R((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pytgetCDÞs
			(i2iKini†i–iÈi,iXi°ii`	iÀi€%iKi–iáiÂ(t__name__t
__module__t__doc__t	BAUDRATESRRR R%RR:RCRERRRGRRIRRRJRKRLRM(((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyR"s*												tSerialcBseZRS((RNRO(((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyRRðscBseZRS((RNRO(((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyRRôst__main__ssocket://localhost:7000s%s
s	write...
shello
s	read: %s
i(t
serialutilR"R
R(tDEBUGtINFOtWARNINGtERRORR0t
SerialBaseRtiotImportErrortFileLikeRRt	RawIOBaseRNtsystststdoutREtflushRCR (((s</usr/lib/python2.7/dist-packages/serial/socket_connection.pyt<module>s.




Ê