cliechti | 86e8787 | 2009-07-21 13:32:45 +0000 | [diff] [blame^] | 1 | ========== |
| 2 | Examples |
| 3 | ========== |
| 4 | |
| 5 | Miniterm |
| 6 | ======== |
| 7 | This is a console application that provides a small terminal application. |
| 8 | miniterm itself does not implement any terminal features such as VT102 |
| 9 | compatibility. However it inherits these features from the terminal it is run. |
| 10 | For example on GNU/Linux running from an xterm it will support the escape |
| 11 | sequences of the xterm. On Windows the typical console window is dumb and does |
| 12 | not support any escapes. When ANSI.sys is loaded it supports some escapes. |
| 13 | |
| 14 | Command line options can be given so that binary data including escapes for |
| 15 | terminals are escaped or output as hex. |
| 16 | |
| 17 | miniterm supports some control functions. Typing ``CTRL+T CTRL+H`` when it is |
| 18 | running shows the help text. |
| 19 | |
| 20 | miniterm.py_ |
| 21 | The miniterm program. |
| 22 | |
| 23 | setup-miniterm-py2exe.py_ |
| 24 | This is a py2exe setup script for Windows. It can be used to create a |
| 25 | standalone ``miniterm.exe``. |
| 26 | |
| 27 | .. _miniterm.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/miniterm.py |
| 28 | .. _setup-miniterm-py2exe.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/setup-miniterm-py2exe.py |
| 29 | |
| 30 | |
| 31 | TCP/IP - serial bridge |
| 32 | ====================== |
| 33 | This program opens a TCP/IP port. When a connection is made to that port (e.g. |
| 34 | with telnet) it forwards all data to the serial port and vice versa. |
| 35 | |
| 36 | The serial port settings are set on the command line when starting the program. |
| 37 | There is no possibility to change settings from remote. |
| 38 | |
| 39 | tcp_serial_redirect.py_ |
| 40 | Main program. |
| 41 | |
| 42 | .. _tcp_serial_redirect.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/tcp_serial_redirect.py |
| 43 | |
| 44 | |
| 45 | wxPython examples |
| 46 | ================= |
| 47 | A simple terminal application for wxPython and a flexible serial port |
| 48 | configuration dialog are shown here. |
| 49 | |
| 50 | wxTerminal.py_ |
| 51 | A simple terminal application. Note that the length of the buffer is |
| 52 | limited by wx and it may suddenly stop displaying new input. |
| 53 | |
| 54 | wxTerminal.wxg_ |
| 55 | A wxGlade design file for the terminal application. |
| 56 | |
| 57 | wxSerialConfigDialog.py_ |
| 58 | A flexible serial port configuration dialog. |
| 59 | |
| 60 | wxSerialConfigDialog.wxg_ |
| 61 | The wxGlade design file for the configuration dialog. |
| 62 | |
| 63 | setup_demo.py_ |
| 64 | A py2exe setup script to package the terminal application. |
| 65 | |
| 66 | .. _wxTerminal.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/wxTerminal.py |
| 67 | .. _wxTerminal.wxg: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/wxTerminal.wxg |
| 68 | .. _wxSerialConfigDialog.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/wxSerialConfigDialog.py |
| 69 | .. _wxSerialConfigDialog.wxg: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/wxSerialConfigDialog.wxg |
| 70 | .. _setup_demo.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/setup_demo.py |
| 71 | |
| 72 | |
| 73 | Wrapper class |
| 74 | ============= |
| 75 | This example provides a subclass based on ``Serial`` that has an alternative |
| 76 | implementation of ``readline()`` |
| 77 | |
| 78 | enhancedserial.py_ |
| 79 | A class with alternative ``readline()`` implementation. |
| 80 | |
| 81 | .. _enhancedserial.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/enhancedserial.py |
| 82 | |
| 83 | |
| 84 | Finding serial ports |
| 85 | ==================== |
| 86 | scan.py_ |
| 87 | A simple loop that probes serial ports by number. |
| 88 | |
| 89 | scanwin32.py_ |
| 90 | A Windows only version that returns a list of serial ports with information |
| 91 | from the registry. |
| 92 | |
| 93 | .. _scan.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/scan.py |
| 94 | .. _scanwin32.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/scanwin32.py |
| 95 | |
| 96 | |
| 97 | Unit tests |
| 98 | ========== |
| 99 | The project uses a number of unit test to verify the functionality. They all |
| 100 | need a loop back connector. The scripts itself contain more information. |
| 101 | |
| 102 | test.py_ |
| 103 | Basic tests. |
| 104 | |
| 105 | test_high_load.py_ |
| 106 | Tests involving sending a lot of data. |
| 107 | |
| 108 | test_advanced.py_ |
| 109 | Test more advanced features. |
| 110 | |
| 111 | .. _test.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/test.py |
| 112 | .. _test_high_load.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/test_high_load.py |
| 113 | .. _test_advanced.py: http://pyserial.svn.sourceforge.net/viewvc/*checkout*/pyserial/trunk/pyserial/examples/test_advanced.py |