Skip to content

Commit c0fd846

Browse files
committed
add comments
1 parent 523a0ae commit c0fd846

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

command/device/configure.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func NetConfigure(ctx context.Context, boardFilters *CreateParams, NetConfig *Ne
6464

6565
type ConfigStatus int
6666

67+
// This enum represents the different states of the network configuration process
68+
// of the Arduino Board Configuration Protocol.
6769
const (
6870
NoneState ConfigStatus = iota
6971
WaitForConnection
@@ -177,6 +179,8 @@ func (nc *NetworkConfigure) waitingForInitialStatus() error {
177179
return nil
178180
}
179181

182+
// In this state the cli is waiting for the available network options as specified in the
183+
// Arduino Board Configuration Protocol.
180184
func (nc *NetworkConfigure) waitingForNetworkOptions() error {
181185
logrus.Info("NetworkConfigure: waiting for network options from device")
182186
res, err := nc.configProtocol.ReceiveData(30)
@@ -185,6 +189,8 @@ func (nc *NetworkConfigure) waitingForNetworkOptions() error {
185189
}
186190

187191
if res != nil {
192+
// At the moment of writing, the only type of message that can be received in this state is the
193+
// WiFiNetworksType, which contains the available WiFi networks list.
188194
if res.Type() == cborcoders.WiFiNetworksType {
189195
nc.state = ConfigureNetwork
190196
} else if res.Type() == cborcoders.ProvisioningStatusMessageType {

0 commit comments

Comments
 (0)