ivan_novembri/progetti/caricabatterie_piaggio/docs/home.md
... ...
@@ -1,6 +1,11 @@
1 1
# Documentazione
2 2
3
-## wifi_manager
3
+## Firmware
4
+
5
+### Connessione alla rete wifi
6
+
7
+* Se il dispositivo non ha memorizzate le credenziali della rete a cui connettersi attiva una rete wifi aperta
8
+* Se il dispositivo ha memorizzate le credenziali della rete a cui connettersi tenta di connettersi
4 9
5 10
@startuml
6 11
!theme plain
... ...
@@ -24,3 +29,66 @@ endif
24 29
stop
25 30
26 31
@enduml
32
+
33
+## Componente `wifi_manager`
34
+
35
+### Dettaglio procedura connessione alla rete wifi locale
36
+
37
+La procedura che viene seguita per connettersi alla rete wifi locale รจ la seguente
38
+
39
+@startuml
40
+!theme plain
41
+
42
+|Codice|
43
+
44
+start
45
+
46
+group wifi_init
47
+ :Registra handler eventi WIFI_EVENT;
48
+ :Registra handler eventi IP_EVENT;
49
+ :esp_netif_init();
50
+ :esp_wifi_init();
51
+end group
52
+
53
+group wifi_connect
54
+ :esp_netif_create_default_wifi_sta();
55
+ :esp_wifi_set_mode();
56
+ :esp_wifi_set_config();
57
+ :esp_wifi_start();
58
+end group
59
+
60
+|Eventi|
61
+
62
+:Generato evento\n**WIFI_EVENT_STA_START**;
63
+floating note right
64
+ Inizia il processo di
65
+ connessione alla
66
+ rete locale
67
+end note
68
+
69
+|Codice|
70
+
71
+group wifi_event_handler
72
+ :Imposta il bit\nWIFI_CONNECTION_IN_PROGRESS_BIT;
73
+ :esp_wifi_connect();
74
+end group
75
+
76
+|Eventi|
77
+
78
+:Generato evento\n**IP_EVENT_STA_GOT_IP**;
79
+
80
+floating note right
81
+ Adesso siamo connessi
82
+ alla rete locale
83
+end note
84
+
85
+|Codice|
86
+
87
+group ip_event_handler
88
+ :Imposta il bit\nWIFI_CONNECTION_OK_BIT;
89
+ :Imposta le informazioni\nsulla connessione (ip, mac...);
90
+end group
91
+
92
+stop
93
+
94
+@enduml