Commit Graph

25 Commits

Author SHA1 Message Date
Paul Sokolovsky 35e63f0007 esp8266/modnetwork: Remove .mac() method, move to .config("mac").
Querying/setting MAC address is pretty adhoc operation to belong to
.config() instead of taking a whole method on its own.
2016-05-03 01:02:14 +03:00
Paul Sokolovsky 7b7c99fec1 esp8266/modnetwork: Remove deprecated wifi_mode().
Network interfaces are now controlled individually using .active() method.
2016-05-03 00:09:23 +03:00
Aex Aey af554b4ba2 esp8266/modnetwork: Make WLAN.ifconfig() read/write.
Allow setting ip, netmask, gw and dns server (also, allows getting dns).
For docs see: https://github.com/micropython/micropython/commit/06deec9
2016-04-28 23:51:04 +03:00
Paul Sokolovsky 4fa1731b6e esp8266/modnetwork: .config(): Add "hidden ESSID" param. 2016-04-21 00:42:45 +03:00
Paul Sokolovsky 46f0641fba esp8266/modnetwork: .config(): Add "channel" param. 2016-04-20 00:25:31 +03:00
Paul Sokolovsky 54b89665fc esp8266/modnetwork: .config(): Add "password" param (W/O). 2016-04-12 00:18:40 +03:00
Paul Sokolovsky 7acc252e93 esp8266/modnetwork: .config(): Add "authmode" param. 2016-04-12 00:17:31 +03:00
Paul Sokolovsky 6f3fc9bfa1 esp8266/modnetwork: .config(): Check interface whose config is requested. 2016-04-12 00:16:16 +03:00
Paul Sokolovsky 2c8356c482 esp8266/modnetwork: require_if(): Report the actual interface required. 2016-04-05 16:09:03 +03:00
Paul Sokolovsky 5531437941 esp8266: Move PHY mode constants from modesp to modnetwork. 2016-04-01 12:10:11 +03:00
Damien George 9475cc59e6 esp8266: Support synchronous wifi scanning.
That is: aps = if0.scan()

TODO: make sure that returned list has tuple with values in "standard"
order (whatever that standard is).
2016-03-30 11:35:03 +03:00
Paul Sokolovsky 5239a8a82b esp8266/modnetwork: Add symbolic names for network interfaces: STA_IF & AP_IF.
These are expected to be passed to network.WLAN() to instantiate network
interface objects.
2016-03-10 10:44:15 +07:00
Paul Sokolovsky a49c16069c esp8266/modnetwork: Introduce interface .config() method.
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-10 10:41:55 +07:00
Paul Sokolovsky d5a12a6608 esp8266/modnetwork: Move config defines to the top. 2016-03-10 10:39:52 +07:00
Paul Sokolovsky 1c43a0fbf8 esp8266/modnetwork: Add per-interface .active() method.
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-10 09:31:23 +07:00
Paul Sokolovsky 7378c50b2f esp8266: Move wifi_mode() and phy_mode() to network module. 2016-03-10 09:29:21 +07:00
Paul Sokolovsky 9e8396accb esp8266/modnetwork: Allow to configure STA and AP interfaces separately.
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-10 09:24:54 +07:00
Damien George 02ea74d8f5 esp8266: Add network.ifconfig(). 2016-03-02 23:04:21 +02:00
Paul Sokolovsky fce0036a67 esp8266: mac() function belongs to network module per the latest API. 2015-12-27 10:03:32 +02:00
Paul Sokolovsky abd0fcfc86 esp8266: Remove superfluous includes. 2015-12-21 22:08:06 +02:00
Bill Owens e2bfa471fa esp8266: Added wlan.isconnected() to maintain parity with other ports. 2015-09-15 20:07:50 +03:00
Bill Owens 60ccb41fac esp8266: Move status() from esp module to network 2015-06-20 23:35:55 +03:00
Bill Owens 686516f90a esp8266: Move scan from esp module to network 2015-06-17 23:13:12 +03:00
Paul Sokolovsky 32eb4b9055 esp8266: Move connect/disconnect from "esp" module to network. 2015-06-12 17:45:28 +03:00
Paul Sokolovsky ee3fec3167 esp8266: Add skeleton "network" module.
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.
2015-06-12 17:45:20 +03:00