<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/stream.h, branch cross</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=cross</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=cross'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-07-30T17:05:56+00:00</updated>
<entry>
<title>py/mpconfig.h: Add MICROPY_STREAMS_POSIX_API setting.</title>
<updated>2016-07-30T17:05:56+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-07-30T17:05:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=61e77a4e88c4b6971fd997191de01e5ab08e46c5'/>
<id>urn:sha1:61e77a4e88c4b6971fd997191de01e5ab08e46c5</id>
<content type='text'>
To filter out even prototypes of mp_stream_posix_*() functions, which
require POSIX types like ssize_t &amp; off_t, which may be not available in
some ports.
</content>
</entry>
<entry>
<title>py/stream: Add adapter methods with POSIX-compatible signatures.</title>
<updated>2016-07-29T21:25:06+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-07-29T21:25:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4f1b0292dbc5920457673a31cadfd894239cc1b9'/>
<id>urn:sha1:4f1b0292dbc5920457673a31cadfd894239cc1b9</id>
<content type='text'>
Previoussly such read() and write() methods were used by modussl_axtls,
move to py/stream for reuse.
</content>
</entry>
<entry>
<title>py/stream: Implement generic flush() method, in terms of C-level ioctl.</title>
<updated>2016-07-26T21:39:10+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-07-26T21:39:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a60b0263ba97f655c01f0982df74299c14457b1c'/>
<id>urn:sha1:a60b0263ba97f655c01f0982df74299c14457b1c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/stream: Stream module works with errno's, so should include mperrno.h.</title>
<updated>2016-07-26T12:05:15+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-07-26T11:48:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f2f761c0c336d4001f6b1040c02ac9973149f911'/>
<id>urn:sha1:f2f761c0c336d4001f6b1040c02ac9973149f911</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/stream.h: Remove dated comment of POSIX-specificity of EAGAIN.</title>
<updated>2016-07-24T21:47:00+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-07-24T21:47:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=16f324641f33201061fb4e79677bc760e45fb3ac'/>
<id>urn:sha1:16f324641f33201061fb4e79677bc760e45fb3ac</id>
<content type='text'>
We have adopted POSIX-compatible error numbers as MicroPython's native.
</content>
</entry>
<entry>
<title>py/stream.h: Move mp_stream_write_adaptor() inside ifdef block.</title>
<updated>2016-07-24T21:16:51+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-07-24T21:16:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1a7e28d8b7e98dc940e16fc16aad1c79c385977d'/>
<id>urn:sha1:1a7e28d8b7e98dc940e16fc16aad1c79c385977d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/stream: Add mp_stream_close() helper function.</title>
<updated>2016-05-20T18:18:49+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-05-20T18:16:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=497660fcda77ae819f5ea1f6a92b8fb5006d8213'/>
<id>urn:sha1:497660fcda77ae819f5ea1f6a92b8fb5006d8213</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/stream: Support both "exact size" and "one underlying call" operations.</title>
<updated>2016-05-17T23:41:45+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-05-17T23:40:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7f7c84b10a5f3b2f783955b01f55e0f913ac459f'/>
<id>urn:sha1:7f7c84b10a5f3b2f783955b01f55e0f913ac459f</id>
<content type='text'>
Both read and write operations support variants where either a) a single
call is made to the undelying stream implementation and returned buffer
length may be less than requested, or b) calls are repeated until requested
amount of data is collected, shorter amount is returned only in case of
EOF or error.

These operations are available from the level of C support functions to be
used by other C modules to implementations of Python methods to be used in
user-facing objects.

The rationale of these changes is to allow to write concise and robust
code to work with *blocking* streams of types prone to short reads, like
serial interfaces and sockets. Particular object types may select "exact"
vs "once" types of methods depending on their needs. E.g., for sockets,
revc() and send() methods continue to be "once", while read() and write()
thus converted to "exactly" versions.

These changes don't affect non-blocking handling, e.g. trying "exact"
method on the non-blocking socket will return as much data as available
without blocking. No data available is continued to be signaled as None
return value to read() and write().

From the point of view of CPython compatibility, this model is a cross
between its io.RawIOBase and io.BufferedIOBase abstract classes. For
blocking streams, it works as io.BufferedIOBase model (guaranteeing
lack of short reads/writes), while for non-blocking - as io.RawIOBase,
returning None in case of lack of data (instead of raising expensive
exception, as required by io.BufferedIOBase). Such a cross-behavior
should be optimal for MicroPython needs.
</content>
</entry>
<entry>
<title>py/stream: Add Python-level ioctl() method.</title>
<updated>2016-04-10T09:45:46+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-04-10T09:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0c97e4c4144565ca3b18593d708f0d7a94905c71'/>
<id>urn:sha1:0c97e4c4144565ca3b18593d708f0d7a94905c71</id>
<content type='text'>
Will call underlying C virtual methods of stream interface. This isn't
intended to be added to every stream object (it's not in CPython), but
is convenient way to expose extra operation on Python side without
adding bunch of Python-level methods.
</content>
</entry>
<entry>
<title>py/stream.h: Add bigger inventory of stream ioctl's.</title>
<updated>2016-04-10T09:42:41+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-04-10T09:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a45e280c5814d093076048424160f03ebbec6ff4'/>
<id>urn:sha1:a45e280c5814d093076048424160f03ebbec6ff4</id>
<content type='text'>
</content>
</entry>
</feed>
