1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! The network, Arduino-shaped: `begin` or `host` once, then `local_ip`.
//!
//! Two ways onto a network and one way to ask where you are.
//! [`begin`] joins somebody else's; [`host`] runs one of the device's own,
//! which is what a board with no access point in reach has to do. Either
//! way [`local_ip`] is the address to hand out and [`connected`] is whether
//! there is one.
use IpAddr;
use crateboard;
use crateerror;
/// Join `ssid` with `psk`; returns once joined. `false` (and
/// [`crate::last_error`]) when refused or no board is installed. On the
/// laptop board this records the name and succeeds: the laptop is already
/// on its network.
/// Host an access point named `ssid` with `psk` instead of joining one, for
/// a device with no network in reach. `false` (and [`crate::last_error`])
/// when the board has no access-point mode or refuses the arguments.
///
/// `psk` must be 8 to 63 bytes. Clients then reach the device at
/// [`local_ip`], which is the address of the network it is now running.
/// The interface address, once joined or once hosting.
/// Whether [`begin`] or [`host`] has succeeded.