Add websocket wifi updates
This commit is contained in:
parent
c443fce24f
commit
1477d909b0
11 changed files with 755 additions and 10 deletions
|
|
@ -12,6 +12,18 @@ import (
|
|||
"github.com/nemunaire/repeater/internal/wifi"
|
||||
)
|
||||
|
||||
// GetWiFiNetworks returns cached WiFi networks without scanning
|
||||
func GetWiFiNetworks(c *gin.Context) {
|
||||
networks, err := wifi.GetCachedNetworks()
|
||||
if err != nil {
|
||||
logging.AddLog("WiFi", "Erreur lors de la récupération des réseaux: "+err.Error())
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Erreur lors de la récupération des réseaux"})
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, networks)
|
||||
}
|
||||
|
||||
// ScanWiFi handles WiFi network scanning
|
||||
func ScanWiFi(c *gin.Context) {
|
||||
networks, err := wifi.ScanNetworks()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue