Paul Sokolovsky
480c212009
extmod/modwebsocket: Handle CLOSE control frame.
...
This fixes situation when clients hangs waiting for disconnect and does
so only on timeout.
2016-04-27 12:49:30 +03:00
Paul Sokolovsky
1c6d91d968
extmod/modlwip: Add print_pcbs() debug function.
...
This requires lwIP built with LWIP_DEBUG (or it will be no-op).
2016-04-26 16:30:13 +03:00
Damien George
45ac5a85d5
extmod/modlwip: Workaround esp8266 sendto issue where 1 is returned.
2016-04-26 13:19:08 +01:00
Damien George
a63542387d
extmod, stmhal: Fix typo of macro that detects if float is enabled.
2016-04-26 12:47:24 +01:00
Paul Sokolovsky
7a012f4793
extmod/modlwip: Protect recv/accept Python callback against exceptions.
...
Using usual call_function_*_protected() helper, to avoid NLR jump crashes.
2016-04-25 21:27:55 +03:00
Damien George
624738ca64
extmod/machine_i2c: Allow mp_hal_pin_obj_t to be any type, not a ptr.
2016-04-22 09:56:02 +01:00
Paul Sokolovsky
7d57037906
extmod/modlwip: Add ability to run callback on "recv" and "accept" events.
...
To use: .setsockopt(SOL_SOCKET, 20, lambda sock: print(sock)). There's a
single underlying callback slot. For normal sockets, it serves as data
received callback, for listening sockets - connection arrived callback.
2016-04-17 18:06:45 +03:00
Paul Sokolovsky
8007f84cca
extmod/modlwip: lwip_tcp_receive(): Full error handling.
2016-04-17 02:22:26 +03:00
Paul Sokolovsky
b830f4c610
extmod/modlwip: lwip_tcp_send(): Full error handling.
2016-04-17 02:20:05 +03:00
Damien George
bcd719ea3a
extmod/fsusermount: In mount/mkfs, deregister VFS object on error.
...
Should fix issue #1947 .
2016-04-14 23:36:25 +01:00
Paul Sokolovsky
5c1af60e19
extmod/modlwip: More debug messages for various edge conditions.
2016-04-15 00:37:12 +03:00
Paul Sokolovsky
44ab5c3ef1
extmod/modlwip: Start adding debug output.
2016-04-14 01:15:52 +03:00
Paul Sokolovsky
fef0d9818a
extmod/modlwip: lwip_tcp_receive(): Properly handle EOF for non-blocking sock.
2016-04-14 00:59:09 +03:00
Paul Sokolovsky
59a4fee516
extmod/modwebsocket: Another case to propagate EOF.
2016-04-13 22:17:09 +03:00
Paul Sokolovsky
54ea253f56
extmod/moduos_dupterm: Don't swallow exceptions in dupterm's read()/write().
...
The idea is that if dupterm object can handle exceptions, it will handle
them itself. Otherwise, object state can be compromised and it's better
to terminate dupterm session. For example, disconnected socket will keep
throwing exceptions and dump messages about that.
2016-04-13 16:34:11 +03:00
Damien George
eec8a94f04
extmod/machine_i2c: Implement I2C memory reading/writing.
2016-04-12 15:52:17 +01:00
Damien George
9314b2df4f
extmod/machine_i2c: Fix I2C reading by sending ack/nack at end of byte.
2016-04-12 15:46:13 +01:00
Damien George
d083712224
extmod: Add generic machine.I2C class, with bit-bang I2C.
...
Should work on any machine that provides the correct pin functions.
2016-04-12 14:06:54 +01:00
Damien George
53ad681ed1
extmod: Add initial framebuf module.
2016-04-12 14:06:53 +01:00
Paul Sokolovsky
f8fb4470a0
extmod/modwebsocket: write(): Support write size beyond 125 bytes.
2016-04-11 14:07:57 +03:00
Paul Sokolovsky
7063210014
extmod/modlwip: Fix for loss of data in unaccepted incoming sockets.
...
When lwIP creates a incoming connection socket of a listen socket, it
sets its recv callback to one which discards incoming data. We set
proper callback only in accept() call, when we allocate Python-level
socket where we can queue incoming data. So, in lwIP accept callback
be sure to set recv callback to one which tells lwIP to not discard
incoming data.
2016-04-11 01:21:34 +03:00
Paul Sokolovsky
b69f798c92
extmod/modwebsocket.h: Split websocket-related defines for reuse.
2016-04-10 13:42:51 +03:00
Paul Sokolovsky
d6236e85c2
extmod/modwebsocket: Implement MP_STREAM_SET_DATA_OPTS ioctl.
...
Allows to set fragment type (txt/bin/etc.) for output records.
2016-04-10 13:19:26 +03:00
Paul Sokolovsky
6837dba6b8
extmod/modwebsocket: Allow to get type of last read data using ioctl().
2016-04-10 12:50:46 +03:00
Paul Sokolovsky
f38e8f5217
extmod/modwebsocket: Record current fragment type (binary/text/etc.)
...
Also, handle continuation frames (untested).
2016-04-09 16:14:47 +03:00