ó {­QNc@s´ddlZddlZddlZddlZdadad„Zd„Zejddfkrod„Z n d „Z ej d krµddl Z d e fd „ƒYZ e ƒan„ej d kr&ddlZddlZddlZd e fd„ƒYZ e ƒad„Ztjƒee_nedejƒ‚dZdZdZdddfZdddfZddddfZde fd„ƒYZd„Zed kr°eƒndS(!iÿÿÿÿNsscCs8t|ƒ}|dkr*dtdƒ|St|ƒSdS(s)generate a readable description for a keyi sCtrl+%ct@N(tordtrepr(t charactert ascii_code((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pytkey_descriptions  cCs·di ttddƒd6ttƒd6ttƒd6tdƒd6td ƒd 6td ƒd 6td ƒd6tdƒd6tdƒd6tdƒd6tdƒd6ttƒd6ttƒd6S(Nsw --- pySerial (%(version)s) - miniterm - help --- --- %(exit)-8s Exit program --- %(menu)-8s Menu escape key, followed by: --- Menu keys: --- %(itself)-7s Send the menu character itself to remote --- %(exchar)-7s Send the exit character itself to remote --- %(info)-7s Show info --- %(upload)-7s Upload file (prompt will be shown) --- Toggles: --- %(rts)-7s RTS %(echo)-7s local echo --- %(dtr)-7s DTR %(break)-7s BREAK --- %(lfm)-7s line feed %(repr)-7s Cycle repr mode --- --- Port settings (%(menu)s followed by the following): --- p change port --- 7 8 set data bits --- n e o s m change parity (None, Even, Odd, Space, Mark) --- 1 2 3 set stop bits (1, 2, 1.5) --- b change baud rate --- x X disable/enable software flow control --- r R disable/enable hardware flow control tVERSIONsunknown versiontversiontexittmenustrtssRstdtrs tlfmstbreakstechos tinfostuploadtitselftexchar(tgetattrtserialRt EXITCHARCTERt MENUCHARACTER(((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyt get_help_texts           iicCs |jdƒS(Ntlatin1(tdecode(tb((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyREscCs|S(N((R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyRHstnttConsolecBs,eZd„Zd„Zd„Zd„ZRS(cCsdS(N((tself((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyt__init__QscCsdS(N((R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pytsetupTscCsdS(N((R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pytcleanupWscCsVxOtrQtjƒ}|dks-|dkr:tjƒq|dkrJdS|SqWdS(Ntsàs s (tTruetmsvcrttgetch(Rtz((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pytgetkeyZs    (t__name__t __module__RRR R&(((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyRPs   tposixcBs,eZd„Zd„Zd„Zd„ZRS(cCstjjƒ|_dS(N(tsyststdintfilenotfd(R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyRiscCsŒtj|jƒ|_tj|jƒ}|dtj@tj@tj@|dtk rqtj||d|d|d|ddƒ|_nX||_||_||_t|j|_t |_ t |_ t |_ dS(Ntparitytrtsctstxonxoffttimeouti(Rtserial_for_urltAttributeErrortSerialRt repr_modetconvert_outgoingtNEWLINE_CONVERISON_MAPtnewlineR"t dtr_statet rts_statetFalset break_state( RtporttbaudrateRDRERFRRLRK((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyRs1 1     cCsBt|_tjd|jƒ|_|jjtƒ|jjƒdS(sStart reader threadttargetN(R"t _reader_alivet threadingtThreadtreadertreceiver_threadt setDaemontstart(R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyt _start_readerŸs cCst|_|jjƒdS(s6Stop reader thread only, wait for clean exit of threadN(RQRVRZtjoin(R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyt _stop_reader§s cCsLt|_|jƒtjd|jƒ|_|jjtƒ|jjƒdS(NRU( R"taliveR]RWRXtwriterttransmitter_threadR[R\(R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyR\­s   cCs t|_dS(N(RQR`(R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pytstopµscCs'|jjƒ|s#|jjƒndS(N(RbR^RZ(Rt transmit_only((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyR^¸s cCs’tjjd|jj|jj|jj|jj|jjfƒtjjd|j r\dp_d|j rndpqd|j r€dpƒdfƒyxtjjd|jj ƒr¯dp²d|jj ƒrÇdpÊd|jjƒrßdpâd|jjƒr÷dpúdfƒWntjk rnXtjjd|jjr8dp;dƒtjjd|jjr^dpadƒtjjdt|jt|jfƒdS( Ns --- Settings: %s %s,%s,%s,%s s&--- RTS: %-8s DTR: %-8s BREAK: %-8s tactivetinactives---- CTS: %-8s DSR: %-8s RI: %-8s CD: %-8s s--- software flow control: %s s--- hardware flow control: %s s$--- data escaping: %s linefeed: %s (R*tstderrtwriteRtportstrRTtbytesizeRDtstopbitsRPRORRtgetCTStgetDSRtgetRItgetCDtSerialExceptionRFREt REPR_MODESRKtLF_MODESRL(R((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pytdump_port_settings½s.       $&&  cCsyØxÑ|jrÖ|jrÖt|jjdƒƒ}|jdkr€|dkrm|jtkrmtj j dƒqÆtj j |ƒnF|jdkrW|jt krÛ|dkrÛ|dkrÉtj j dƒqT|dkrTqTqÆ|dkr |jt kr tj j dƒqÆ|dkr7|jtkr7tj j dƒqÆtj j t |ƒdd!ƒno|jdkr†tj j t |ƒdd!ƒn@|jdkrÆx.|D]#}tj j d |jd ƒƒqœWntj jƒqWWn"tjk rü}t|_‚nXd S( sloop and copy serial->consoleiis s s iÿÿÿÿiis%s RBN(R`RVRRR:RKRLt CONVERT_CRR*tstdoutRht CONVERT_CRLFt CONVERT_LFRtencodetflushRpRQ(RtdataR;te((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyRYØs6     $ c Cs> t}y x |jr" ytjƒ}Wn#tk rJtjdgƒ}nXt|ƒ}|rl|tksu|t kr¤|jj |ƒ|j rct j j |ƒqcn¿|dkrÙt jj dƒt jjƒtjƒt jjƒjdƒ}|rÌy¤t|dƒ}t jj d|ƒxftrƒ|jƒjdƒ}|sCPn|jj |ƒ|jj dƒ|jjƒt jj dƒqWt jj d|ƒWqÌtk rÈ}t jj d ||fƒqÌXntjƒnŠ|d krût jj tƒƒnh|d krM|j |_|jj|jƒt jj d |jrBd pEdƒn|dkrŸ|j |_|jj|jƒt jj d|jr”d p—dƒnÄ|dkrñ|j |_|jj|jƒt jj d|jræd pédƒnr|dkr0|j |_ t jj d|j r%d p(dƒn3|dkrI|jƒn|dkr |j d7_ |j dkrd|_ nt jj dt!|j fƒnÃ|dkr|j"d7_"|j"dkrÖd|_"nt#|j"|_$t jj dt%|j"fƒn\|dkr¯t jj dƒt jjƒtjƒyt jjƒj&ƒ}Wntk rld5}nXtjƒ|rc||jj(krc|j)ƒ|jj*ƒ} yytj+|dtƒ} Wn&t,k rìtj-ƒ} || _(nX| j.| ƒ| jƒ| j|jƒ| j|jƒ| j|jƒWn4t/k rk}t jj d |fƒ| j0ƒn4X|jj0ƒ| |_t jj d!|jj(fƒ|j1ƒqcn´|d"krct jj d#ƒt jjƒtjƒ|jj2} y%t3t jjƒj&ƒƒ|j_2Wn6t4k rK}t jj d$|fƒ| |j_2n X|jƒtjƒn|d%kr‹tj5|j_6|jƒnØ|d&kr³tj7|j_6|jƒn°|d'krÛtj8|j_9|jƒnˆ|d(krtj:|j_9|jƒn`|d)kr+tj;|j_9|jƒn8|d*krStj<|j_9|jƒn|d+kr{tj=|j_9|jƒnè|d,kr£tj>|j_?|jƒnÀ|d-krËtj@|j_?|jƒn˜|d.krótjA|j_?|jƒnp|d/kr|d0k|j_B|jƒnE|d1krI|d2k|j_C|jƒnt jj d3tD|ƒƒt}q |tkrt}q |t kr›|jEƒPq |d4kræ|jj |j$ƒ|j r t j j |ƒt j jƒq q |jj |ƒ|j r t j j |ƒt j jƒq q WWnt|_‚nXd5S(6s¢ Loop and copy console->serial until EXITCHARCTER character is found. When MENUCHARACTER is found, interpret the next key locally. iss --- File to upload: s trs--- Sending file %s --- t.s --- File %s sent --- s"--- ERROR opening file %s: %s --- shH?ss--- RTS %s --- ReRfss--- DTR %s --- ss--- BREAK %s --- ss--- local echo %s --- s siis--- escape data: %s --- s is--- line feed %s --- tpPs --- Enter port name: t do_not_opens#--- ERROR opening new port: %s --- s--- Port changed to: %s --- tbBs --- Baudrate: s#--- ERROR setting baudrate: %s --- t8t7teEtoOtmMtsStnNt1t2t3txXtXtrRtRs!--- unknown menu character %s -- s N(FRQR`R=R&tKeyboardInterruptRtto_bytesRRRRhRR*RuRgRyR R+treadlinetrstriptopenR"tIOErrorRRRPtsetRTSROtsetDTRRRtsetBreakRsRKRqRLRMRNRrtstriptNoneRSR_tgetSettingsDictRHRIRJtapplySettingsDictt ExceptiontcloseR]RTtintt ValueErrort EIGHTBITSRjt SEVENBITSt PARITY_EVENRDt PARITY_ODDt PARITY_MARKt PARITY_SPACEt PARITY_NONEt STOPBITS_ONERkt STOPBITS_TWOtSTOPBITS_ONE_POINT_FIVERFRERRc( Rt menu_activeRR;tfilenametfiletlineR{RStsettingst new_serialtbackup((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyRasF         !    &  &  &  &                          %                                   ( R'R(RQRvRR]R_R\RcR^RsRYRa(((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyRCs       (c Csddl}|jddddƒ}|jdddd d d d dƒ|jd dddddddd dd dƒ|jdddddd dd dƒ|jddddddd dd tƒ|jddd ddd d!d tƒ|jd"dd#ddd d$d tƒ|jd%dd&ddd d'd tƒ|jd(dd)ddd d*d tƒ|jd+d,dd-dd.d d/d d0ƒ|jd1dd2ddddd d3d dƒ|jd4dd5ddddd d6d dƒ|jd7d8dd9ddd d:d tƒ|jd;dd<ddddd d=d d>ƒ|jd?dd@ddddd dAd dBƒ|jƒ\}}|jjƒ|_|jdCkr”|jdDƒn|j r¶|j r¶|jdEƒn|j |j krØ|jdFƒnt |j ƒat |j ƒa|j}|j}|r¨|jdk r-|jdGƒn|jd0ƒ}|ryt|d0ƒ}Wn&tk r~|jdH|d0ƒnX|jd0ƒn|r½|jdIƒq½n|dkr½d0}nt}|j rÕt}n|j rçt}nyCt|||jd |jd#|jd|jdJ|d-|jƒ}Wn=tjk ri}tj j!dK||fƒtj"dLƒnX|j#sïtj j!dM|jj$|jj|jj%|jj|jj&fƒtj j!dNt'tƒt'tƒt'tƒt'dOƒfƒn|j(dk rO|j#s-tj j!dP|j(r"dQp%dRƒn|jj)|j(ƒ|j(|_(n|j*dk r¯|j#stj j!dS|j*r‚dQp…dRƒn|jj+|j*ƒ|j*|_*n|j,ƒy|j-t.ƒWnt/k rÝnX|j#sútj j!dTƒn|j-ƒdS(UNiÿÿÿÿtusages!%prog [options] [port [baudrate]]t descriptions9Miniterm - A simple terminal program for the serial port.s-ps--porttdestRSthelpsKport, a number or a device name. (deprecated option, use parameter instead)tdefaults-bs--baudRTtactiontstorettypeRžsset baud rate, default %defaulti€%s--parityRDs-set parity, one of [N, E, O, S, M], default=NtNs-es--echoRt store_truesenable local echo (default off)s--rtsctsREs)enable RTS/CTS flow control (default off)s --xonxoffRFs*enable software flow control (default off)s--crtcrsdo not send CR+LF, send CR onlys--lftlfsdo not send CR+LF, send LF onlys-Ds--debugRKtcounts÷debug received data (escape non-printable chars) --debug can be given multiple times: 0: just print what is received 1: escape non-printable characters, do newlines as unusual 2: escape non-printable characters, newlines too 3: hex dump everythingis--rtsRPs2set initial RTS line state (possible values: 0, 1)s--dtrROs2set initial DTR line state (possible values: 0, 1)s-qs--quiettquietssuppress non error messagess --exit-chart exit_charsDASCII code of special character that is used to exit the applicationis --menu-chart menu_charsGASCII code of special character that is used to control miniterm (menu)itNEOSMsinvalid paritys)only one of --cr or --lf can be specifieds.--exit-char can not be the same as --menu-chars;no arguments are allowed, options only when --port is givens"baud rate must be a number, not %rstoo many argumentsRLscould not open port %r: %s is$--- Miniterm on %s: %d,%s,%s,%s --- s8--- Quit: %s | Menu: %s | Help: %s followed by %s --- ss--- forcing DTR %s ReRfs--- forcing RTS %s s --- exit --- (0toptparset OptionParsert add_optionR™RQt parse_argsRDtupperterrorR»R¼RÀR¿tchrRRRSRTtpopRžRŸRvRtRwRCRERFRRKRRpR*RgRhRR¾RiRjRkRROR–RPR•R\R^R"R( RÂtparsertoptionstargsRSRTRLtminitermR{((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pytmain·s0                                   & &   t__main__(R*R9RRWRRRRt version_infoRtnameR#tobjectRR=R.R>RtexitfunctNotImplementedErrortplatformRvRtRwRMRrRqRCRÎR'(((s9/usr/lib/python2.7/site-packages/serial/tools/miniterm.pyt s<0 (    $    ÿ) Í