- May 20, 2019
-
-
Damien George authored
For example: i2c.writevto(addr, (buf1, buf2)). This allows to efficiently (wrt memory) write data composed of separate buffers, such as a command followed by a large amount of data.
-
Damien George authored
-
Damien George authored
API is: int transfer( mp_obj_base_t *obj, uint16_t addr, size_t n, mp_machine_i2c_buf_t *bufs, unsigned int flags )
-
- May 17, 2019
-
-
Paul Sokolovsky authored
For modules I initially created or made substantial contributions to.
-
- May 14, 2019
-
-
Damien George authored
Fixes issue #4780.
-
- May 06, 2019
-
-
Yonatan Goldschmidt authored
-
Yonatan Goldschmidt authored
Selectable at compile time via MICROPY_PY_UCRYPTOLIB_CTR. Disabled by default.
-
- Apr 30, 2019
-
-
Paul Sokolovsky authored
It consists of: 1. "do_handhake" param (default True) to wrap_socket(). If it's False, handshake won't be performed by wrap_socket(), as it would be done in blocking way normally. Instead, SSL socket can be set to non-blocking mode, and handshake would be performed before the first read/write request (by just returning EAGAIN to these requests, while instead reading/writing/ processing handshake over the connection). Unfortunately, axTLS doesn't really support non-blocking handshake correctly. So, while framework for this is implemented on MicroPython's module side, in case of axTLS, it won't work reliably. 2. Implementation of .setblocking() method. It must be called on SSL socket for blocking vs non-blocking operation to be handled correctly (for example, it's not enough to wrap non-blocking socket with wrap_socket() call - resulting SSL socket won't be itself non-blocking). Note that .setblocking() propagates call to the underlying socket object, as expected.
-
Paul Sokolovsky authored
For this, add wrap_socket(do_handshake=False) param. CPython doesn't have such a param at a module's global function, and at SSLContext.wrap_socket() it has do_handshake_on_connect param, but that uselessly long. Beyond that, make write() handle not just MBEDTLS_ERR_SSL_WANT_WRITE, but also MBEDTLS_ERR_SSL_WANT_READ, as during handshake, write call may be actually preempted by need to read next handshake message from peer. Likewise, for read(). And even after the initial negotiation, situations like that may happen e.g. with renegotiation. Both MBEDTLS_ERR_SSL_WANT_READ and MBEDTLS_ERR_SSL_WANT_WRITE are however mapped to the same None return code. The idea is that if the same read()/write() method is called repeatedly, the progress will be made step by step anyway. The caveat is if user wants to add the underlying socket to uselect.poll(). To be reliable, in this case, the socket should be polled for both POLL_IN and POLL_OUT, as we don't know the actual expected direction. But that's actually problematic. Consider for example that write() ends with MBEDTLS_ERR_SSL_WANT_READ, but gets converted to None. We put the underlying socket on pull using POLL_IN|POLL_OUT but that probably returns immediately with POLL_OUT, as underlyings socket is writable. We call the same ussl write() again, which again results in MBEDTLS_ERR_SSL_WANT_READ, etc. We thus go into busy-loop. So, the handling in this patch is temporary and needs fixing. But exact way to fix it is not clear. One way is to provide explicit function for handshake (CPython has do_handshake()), and let *that* return distinct codes like WANT_READ/WANT_WRITE. But as mentioned above, past the initial handshake, such situation may happen again with at least renegotiation. So apparently, the only robust solution is to return "out of bound" special sentinels like WANT_READ/WANT_WRITE from read()/write() directly. CPython throws exceptions for these, but those are expensive to adopt that way for efficiency-conscious implementation like MicroPython.
-
- Apr 26, 2019
-
-
Damien George authored
-
- Apr 16, 2019
-
-
Léa Saviot authored
In CPython the random module is seeded differently on each import, and so this new macro option MICROPY_PY_URANDOM_SEED_INIT_FUNC allows to implement such a behaviour.
-
- Apr 11, 2019
-
-
Damien George authored
-
- Apr 03, 2019
-
-
Damien George authored
Since commit da938a83 the tcp_arg() that is set for the new connection is the new connection itself, and the parent listening socket is found in the pcb->connected entry.
-
- Apr 01, 2019
-
-
Damien George authored
-
Damien George authored
This is needed now that the accept queue can have pending connections removed asynchronously.
-
Damien George authored
-
Damien George authored
In such a case the connection is aborted by lwIP and so must be removed from the pending accept queue.
-
Andrew Leech authored
Use uos.dupterm for REPL configuration of the main USB_VCP(0) stream on dupterm slot 1, if USB is enabled. This means dupterm can also be used to disable the boot REPL port if desired, via uos.dupterm(None, 1). For efficiency this adds a simple hook to the global uos.dupterm code to work with streams that are known to be native streams.
-
- Mar 26, 2019
-
-
Andrew Leech authored
This allows formatting SD cards, larger flash etc which do not support the default FAT16/SFD format mode.
-
- Mar 13, 2019
-
-
Wolf Vollprecht authored
-
- Mar 12, 2019
-
-
Damien George authored
-
- Mar 05, 2019
-
-
Damien George authored
-
- Feb 28, 2019
-
-
Damien George authored
Fixes issue #4499.
-
- Feb 26, 2019
-
-
Damien George authored
-
Damien George authored
Some users of this module may require the LwIP stack to run at an elevated priority, to protect against concurrency issues with processing done by the underlying network interface. Since LwIP doesn't provide such protection it must be done here (the other option is to run LwIP in a separate thread, and use thread protection mechanisms, but that is a more heavyweight solution).
-
- Feb 18, 2019
-
-
Damien George authored
The bug polling for readability was: if alloc==0 and tcp.item==NULL then the code would incorrectly check tcp.array[iget] which is an invalid dereference when alloc==0. This patch refactors the code to use a helper function lwip_socket_incoming_array() to return the correct pointer for the incomming connection array. Fixes issue #4511.
-
- Feb 15, 2019
-
-
Damien George authored
Otherwise this code will be included if MICROPY_PY_LWIP is defined to 0.
-
- Feb 13, 2019
-
-
Yonatan Goldschmidt authored
As mentioned in #4450, `websocket` was experimental with a single intended user, `webrepl`. Therefore, we'll make this change without a weak link `websocket` -> `uwebsocket`.
-
- Feb 12, 2019
-
-
Damien George authored
-
- Feb 07, 2019
-
-
Yonatan Goldschmidt authored
Previously crypto-algorithms impl was included even if MICROPY_SSL_MBEDTLS was in effect, thus we relied on the compiler/linker to cut out the unused functions.
-
- Jan 31, 2019
-
-
Paul Sokolovsky authored
Python defines warnings as belonging to categories, where category is a warning type (descending from exception type). This is useful, as e.g. allows to disable warnings selectively and provide user-defined warning types. So, implement this in MicroPython, except that categories are represented just with strings. However, enough hooks are left to implement categories differently per-port (e.g. as types), without need to patch each and every usage.
-
Damien George authored
-
- Jan 27, 2019
-
-
Paul Sokolovsky authored
This header is deprecated as of mbedtls 2.8.0, as shipped with Ubuntu 18.04. Leads to #warning which is promoted to error with uPy compile options. Note that the current version of mbedtls is 2.14 at the time of writing.
-
- Jan 26, 2019
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Major changes include robust parsing of erroneous compressed streams and updated API.
-
- Dec 21, 2018
-
-
Damien George authored
It's more robust to have the version defined statically in a header file, rather than dynamically generating it via git using a git tag. In case git doesn't exist, or a different source control tool is used, it's important to still have the uPy version number available.
-
- Dec 10, 2018
-
-
Paul Sokolovsky authored
SHORT, INT, LONG, LONGLONG, and unsigned (U*) variants are being defined. This is done at compile using GCC-style predefined macros like __SIZEOF_INT__. If the compiler doesn't have such defines, no such types will be defined.
-
Paul Sokolovsky authored
Allows to get address a pointer contains, as an integer.
-
- Dec 03, 2018
-
-
Damien George authored
The recent implementation of the listen backlog meant that the logic to test for readability of such a socket changed, and this commit updates the logic to work again.
-
- Dec 01, 2018
-
-
Damien George authored
Array to hold waiting connections is in-place if backlog=1, else is a dynamically allocated array. Incoming connections are processed FIFO style to maintain fairness.
-