summaryrefslogtreecommitdiff
path: root/esp8266/modnetwork.c
AgeCommit message (Collapse)Author
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.
2017-08-30all: Convert remaining "mp_uint_t n_args" to "size_t n_args".Damien George
This is to have consistency across the whole repository.
2017-08-13all: Raise exceptions via mp_raise_XXXJavier Candeira
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-30esp8266: Convert to mp_rom_map_elem_t.Paul Sokolovsky
2017-05-16esp8266/modnetwork: In connect, fix potential buffer overflows.puuu
2017-03-31all: Use full path name when including mp-readline/timeutils/netutils.Damien George
This follows the pattern of how all other headers are now included, and makes it explicit where the header file comes from. This patch also removes -I options from Makefile's that specify the mp-readline/timeutils/ netutils directories, which are no longer needed.
2017-03-29esp8266: Update for changes to mp_obj_str_get_data.Damien George
2016-11-09esp8266/modnetwork.c: Expose configuration for station DHCP hostname.Chris Popp
The ESP SDK supports configuring the hostname that is reported when doing a DHCP request in station mode. This commit exposes that under network.WLAN(network.STA_IF).config('dhcp_hostname') as a read/write value similar to other parameters.
2016-11-01esp8266/modnetwork.c: Allows AP reconnection without WiFi credentialspuuu
There is no automatic reconnect after wlan.active(False); wlan.active(True). This commit provide the possibility to run wlan.connect() without parameter, to reconnect to the previously connected AP. resolve #2493
2016-10-31esp8266/modnetwork: config(): Fix copy-paste error in setting "mac".Paul Sokolovsky
2016-09-22all: Remove 'name' member from mp_obj_module_t struct.Damien George
One can instead lookup __name__ in the modules dict to get the value.
2016-09-06esp8266/modnetwork: Fix wlan.scan() method so it returns all networks.Damien George
According to the Arduino ESP8266 implementation the first argument to the wifi scan callback is actually a bss_info pointer. This patch fixes the iteration over this data so the first 2 entries are no longer skipped. Fixes issue #2372.
2016-06-04esp8266/modnetwork: Use struct bss_info::ssid_len for ESSID length.Mark
Instead of calling strlen(), which won't work if there're 32 chars in returned ESSID. struct bss_info::ssid_len is not documented in SDK API Guide, but is present in SDK headers since 1.4.0. Just in case, previous code is left commented.
2016-05-29esp8266/modnetwork: Allow to press ctrl-C while scan() is running.Damien George
Ctrl-C will raise a KeyboardInterrupt and stop the scan (although it will continue to run in the background, it won't report anything). If interrupted, and another scan() is started before the old one completes in the background, then the second scan will fail with an OSError.
2016-05-29esp8266/modnetwork: Protect scan() callback against memory errors.Damien George
scan() allocates memory so may cause an exception to be raised.
2016-05-29esp8266/modnetwork: scan() is only supported by STA when it's enabled.Damien George
2016-05-10esp8266: Convert to use new MP_Exxx errno symbols.Damien George
These symbols are still defined in terms of the system Exxx symbols, and can be switched to internal numeric definitions at a later stage. Note that extmod/modlwip still uses many system Exxx symbols.
2016-05-03esp8266/modnetwork: Remove .mac() method, move to .config("mac").Paul Sokolovsky
Querying/setting MAC address is pretty adhoc operation to belong to .config() instead of taking a whole method on its own.
2016-05-03esp8266/modnetwork: Remove deprecated wifi_mode().Paul Sokolovsky
Network interfaces are now controlled individually using .active() method.
2016-04-28esp8266/modnetwork: Make WLAN.ifconfig() read/write.Aex Aey
Allow setting ip, netmask, gw and dns server (also, allows getting dns). For docs see: https://github.com/micropython/micropython/commit/06deec9
2016-04-21esp8266/modnetwork: .config(): Add "hidden ESSID" param.Paul Sokolovsky
2016-04-20esp8266/modnetwork: .config(): Add "channel" param.Paul Sokolovsky
2016-04-12esp8266/modnetwork: .config(): Add "password" param (W/O).Paul Sokolovsky
2016-04-12esp8266/modnetwork: .config(): Add "authmode" param.Paul Sokolovsky
2016-04-12esp8266/modnetwork: .config(): Check interface whose config is requested.Paul Sokolovsky
2016-04-05esp8266/modnetwork: require_if(): Report the actual interface required.Paul Sokolovsky
2016-04-01esp8266: Move PHY mode constants from modesp to modnetwork.Paul Sokolovsky
2016-03-30esp8266: Support synchronous wifi scanning.Damien George
That is: aps = if0.scan() TODO: make sure that returned list has tuple with values in "standard" order (whatever that standard is).
2016-03-10esp8266/modnetwork: Add symbolic names for network interfaces: STA_IF & AP_IF.Paul Sokolovsky
These are expected to be passed to network.WLAN() to instantiate network interface objects.
2016-03-10esp8266/modnetwork: Introduce interface .config() method.Paul Sokolovsky
Allows to set (in case keyword args are given) or query (in case a single "symbolic keyword" (a string, value is the same as keyword)) arbitrary interface paramters (i.e. extensible and adaptable to various hardware). Example usage: ap_if = network.WLAN(1) ap_if.config(essid="MicroPython on Air") print(ap_if.config("essid"))
2016-03-10esp8266/modnetwork: Move config defines to the top.Paul Sokolovsky
2016-03-10esp8266/modnetwork: Add per-interface .active() method.Paul Sokolovsky
Allows to up/down interface when called with a boolean, or query current state if called without args. This per-interface method is intended to supersede adhoc network.wifi_mode() function.
2016-03-10esp8266: Move wifi_mode() and phy_mode() to network module.Paul Sokolovsky
2016-03-10esp8266/modnetwork: Allow to configure STA and AP interfaces separately.Paul Sokolovsky
On ESP8266, there're 2 different interfaces. Pretending it's not the case desn't make sense. So, network.WLAN() now takes interface id, and returns interface object. Individual operations are then methods of interface object. Some operations require i/f of specific type (e.g. .connect() makes sense only for STA), other are defined for any (e.g. .ifconfig(), .mac()).
2016-03-02esp8266: Add network.ifconfig().Damien George
2015-12-27esp8266: mac() function belongs to network module per the latest API.Paul Sokolovsky
2015-12-21esp8266: Remove superfluous includes.Paul Sokolovsky
2015-09-15esp8266: Added wlan.isconnected() to maintain parity with other ports.Bill Owens
2015-06-20esp8266: Move status() from esp module to networkBill Owens
2015-06-17esp8266: Move scan from esp module to networkBill Owens
2015-06-12esp8266: Move connect/disconnect from "esp" module to network.Paul Sokolovsky
2015-06-12esp8266: Add skeleton "network" module.Paul Sokolovsky
MicroPython "network" module interface requires it to contains classes to instantiate. But as we have a static network interace, make WLAN() "constructor" just return module itself, and just make all methods module-global functions.