1. 12 May, 2015 1 commit
  2. 04 May, 2015 1 commit
  3. 28 Jan, 2015 1 commit
    • Damien George's avatar
      py: Change vstr so that it doesn't null terminate buffer by default. · 0d3cb672
      Damien George authored
      This cleans up vstr so that it's a pure "variable buffer", and the user
      can decide whether they need to add a terminating null byte.  In most
      places where vstr is used, the vstr did not need to be null terminated
      and so this patch saves code size, a tiny bit of RAM, and makes vstr
      usage more efficient.  When null termination is needed it must be
      done explicitly using vstr_null_terminate.
      0d3cb672
  4. 24 Jan, 2015 1 commit
    • Damien George's avatar
      stmhal: Bug fix for usocket's accept and setsockopt methods. · 23342c09
      Damien George authored
      accept might raise an exception, in which case the new socket is not
      fully created.  It has a finaliser so will run close() method when GC'd.
      Before this patch close would try to close an invalid socket.  Now
      fixed.
      
      setsockopt took address of stack value which became out of scope.  Now
      fixed.
      23342c09
  5. 22 Jan, 2015 1 commit
  6. 21 Jan, 2015 1 commit
    • Damien George's avatar
      py: Remove mp_obj_str_builder and use vstr instead. · 05005f67
      Damien George authored
      With this patch str/bytes construction is streamlined.  Always use a
      vstr to build a str/bytes object.  If the size is known beforehand then
      use vstr_init_len to allocate only required memory.  Otherwise use
      vstr_init and the vstr will grow as needed.  Then use
      mp_obj_new_str_from_vstr to create a str/bytes object using the vstr
      memory.
      
      Saves code ROM: 68 bytes on stmhal, 108 bytes on bare-arm, and 336 bytes
      on unix x64.
      05005f67
  7. 01 Jan, 2015 1 commit
  8. 07 Dec, 2014 1 commit
  9. 05 Dec, 2014 1 commit
  10. 04 Dec, 2014 1 commit
    • Damien George's avatar
      stmhal: Overhaul network drivers; has generic network protocol in C. · 29a1ec1b
      Damien George authored
      This patch overhauls the network driver interface.  A generic NIC must
      provide a set of C-level functions to implement low-level socket control
      (eg socket, bind, connect, send, recv).  Doing this, the network and
      usocket modules can then use such a NIC to implement proper socket
      control at the Python level.
      
      This patch also updates the CC3K and WIZNET5K drivers to conform to the
      new interface, and fixes some bugs in the drivers.  They now work
      reasonably well.
      29a1ec1b
  11. 29 Nov, 2014 1 commit
  12. 31 Oct, 2014 1 commit
  13. 30 Sep, 2014 1 commit
    • Damien George's avatar
      stmhal: Add network and usocket module. · 3a1c4c5b
      Damien George authored
      As per issue #876, the network module is used to configure NICs
      (hardware modules) and configure routing.  The usocket module is
      supposed to implement the normal Python socket module and selects the
      underlying NIC using routing logic.
      
      Right now the routing logic is brain dead: first-initialised,
      first-used.  And the routing table is just a list of registered NICs.
      
      cc3k and wiznet5k work, but not at the same time due to C name clashes
      (to be fixed).
      
      Note that the usocket module has alias socket, so that one can import
      socket and it works as normal.  But you can also override socket with
      your own module, using usocket at the backend.
      3a1c4c5b