Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!amsnews11.chello.com!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.05; '===': 0.09; 'available)': 0.09; 'linux.': 0.09; 'to:addr:comp.lang.python': 0.09; 'topic:': 0.09; 'bit)': 0.16; 'bit.': 0.16; 'bits,': 0.16; 'modes': 0.16; 'posix': 0.16; 'side.': 0.16; 'cc:addr:python-list': 0.16; 'cc:no real name:2**0': 0.20; 'trying': 0.21; 'discussion': 0.22; 'header:In- Reply-To:1': 0.22; 'figure': 0.23; 'defined': 0.24; 'cc:2**0': 0.24; 'mode': 0.25; 'module': 0.26; '"the': 0.26; "i'm": 0.26; 'testing': 0.26; 'described': 0.28; 'bit': 0.28; 'message- id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.29; 'definition': 0.30; '(since': 0.30; "i've": 0.31; 'words,': 0.32; 'received:209.85.216.46': 0.32; 'received:mail- qw0-f46.google.com': 0.32; 'implement': 0.32; 'setting': 0.34; 'set.': 0.34; 'subject:/': 0.35; 'project': 0.35; 'regular': 0.35; 'device': 0.36; 'uses': 0.36; 'subject:with': 0.36; 'two': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'using': 0.38; 'some': 0.38; 'received:209.85': 0.38; 'relatively': 0.39; 'mark': 0.39; 'subject: (': 0.40; 'received:209': 0.40; 'communicate': 0.40; 'dedicated': 0.61; 'matter': 0.61; 'your': 0.61; 'stop': 0.63; 'devices': 0.63; 'view': 0.65; 'view.': 0.67; 'url:php': 0.82; '8th': 0.91; 'subject:Serial': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=lxk03reZK7pbyNLKHUyhk0bqCeGm0Z8WjS+jU7fhztU=; b=DYBfBJDbgNV70qAqtnxQBFZzyouEAFMTUTZ1YSHsaXwFG51WGtnkib6ffY1ciGACLJ 8ktk5tuwlFaWeTsU+VpBnIRv4KM1PJzQJs7P2Gk/Ya29wXgO0Bj+TzWoVdGGb2R5jAJO Gbb04CPUOnKW9CO7jkgGIKWuJQ3zta9rlAAV8= MIME-Version: 1.0 In-Reply-To: <27511132.925.1321884055247.JavaMail.geo-discussion-forums@yqnf38> References: <27511132.925.1321884055247.JavaMail.geo-discussion-forums@yqnf38> Date: Mon, 21 Nov 2011 15:26:48 +0100 Subject: Re: Non-POSIX parity (mark/space) with Python-Serial on Linux. From: Nizamov Shawkat To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1321885611 news.xs4all.nl 6880 [2001:888:2000:d::a6]:44414 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16009 2011/11/21 : > I'm working on a project where I need to communicate with some devices vi= a modem which have the possibility of using MARK and SPACE parity. =A0These= are not defined by POSIX and therefore are not directly supported under Li= nux. > > I've found the following discussion on the topic: > > http://www.lothosoft.ch/thomas/libmip/markspaceparity.php > > and I have been trying to use this information (since the TERMIOS module = is available) to proceed with the communication. > > I was able to use minicom to determine that the first device I started te= sting with uses 7M1 but cannot figure out how to implement the solution des= cribed by the author above. > "The modes 7M1 (7 data bits, MARK parity, 1 stop bit) and 7S1 (7 data bits, SPACE parity, 1 stop bit) can easily be emulated using 8N1 (0 data bits, NO parity, 1 stop bit) and setting the 8th data bit to 1 resp. 0. This is relatively simple to implement and cannot be distinguished by the receiver." It means that 7M1 =3D=3D=3D 8N1. Set 8N1 mode on your side and 7M1 on the other side. I really do not understand what is the reason to have dedicated 7M1 or 7S1 mode - it is no different from regular 8 bit mode from the hardware point of view. From the software point of view it is just the matter of the definition of the highest bit. In other words, 7M1/7S1 are two complementary subsets of a single 8N1 set. HTH