diff --git a/README.md b/README.md index d22e713..b99482d 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,8 @@ Jusqu'a présent, les fonctionalités suivantes ont été implémentées : - AP (core) - Allowed Comb - Stations - - BSS + - Radar + - BSS ## Utilisation diff --git a/exemple/config/WiFi.php b/exemple/config/WiFi.php index 06dfb4c..216675d 100644 --- a/exemple/config/WiFi.php +++ b/exemple/config/WiFi.php @@ -14,9 +14,10 @@ $a = $WiFiConfigService->getConfiguration(); print_r( $a); */ -/* + $WiFiAccessPointService = new \alphayax\freebox\api\v3\services\config\WiFi\AccessPoint( $App); $AccessPoints = $WiFiAccessPointService->getAll(); +/* print_r( $AccessPoints); $AllowedComb = $WiFiAccessPointService->getAllowedCombFromId( $AccessPoints[0]->getId()); @@ -26,10 +27,15 @@ $Stations = $WiFiAccessPointService->getStationsFromId( $AccessPoints[1]->getId( print_r( $Stations); */ +$Neighbors = $WiFiAccessPointService->getNeighborsFromId( $AccessPoints[1]->getId()); +print_r( $Neighbors); + + +/* $WiFiBssService = new \alphayax\freebox\api\v3\services\config\WiFi\Bss( $App); $Bsss = $WiFiBssService->getAll(); print_r( $Bsss); $Bss = $WiFiBssService->getFromId( $Bsss[0]->getId()); print_r( $Bss); - +*/ diff --git a/freebox/api/v3/models/WiFi/Radar/Neighbor.php b/freebox/api/v3/models/WiFi/Radar/Neighbor.php new file mode 100644 index 0000000..756bb8e --- /dev/null +++ b/freebox/api/v3/models/WiFi/Radar/Neighbor.php @@ -0,0 +1,96 @@ +bssid; + } + + /** + * @return string + */ + public function getSsid() { + return $this->ssid; + } + + /** + * @return string + * @see alphayax\freebox\api\v3\symbols\WiFi\APConfig\Band + */ + public function getBand() { + return $this->band; + } + + /** + * @return int + */ + public function getChannelWidth() { + return $this->channel_width; + } + + /** + * @return int + */ + public function getChannel() { + return $this->channel; + } + + /** + * @return int + */ + public function getSecondaryChannel() { + return $this->secondary_channel; + } + + /** + * @return int + */ + public function getSignal() { + return $this->signal; + } + + /** + * @return NeighborCap + */ + public function getCapabilities() { + return $this->capabilities; + } + + +} diff --git a/freebox/api/v3/models/WiFi/Radar/NeighborCap.php b/freebox/api/v3/models/WiFi/Radar/NeighborCap.php new file mode 100644 index 0000000..d29e14f --- /dev/null +++ b/freebox/api/v3/models/WiFi/Radar/NeighborCap.php @@ -0,0 +1,44 @@ +legacy; + } + + /** + * neighbor supports ht (802.11n) + * @return boolean + */ + public function isHt() { + return $this->ht; + } + + /** + * neighbor supports vht (802.11ac) + * @return boolean + */ + public function isVht() { + return $this->vht; + } + +} diff --git a/freebox/api/v3/services/config/WiFi/AccessPoint.php b/freebox/api/v3/services/config/WiFi/AccessPoint.php index ef2a291..e540a5b 100644 --- a/freebox/api/v3/services/config/WiFi/AccessPoint.php +++ b/freebox/api/v3/services/config/WiFi/AccessPoint.php @@ -12,6 +12,7 @@ class AccessPoint extends Service { const API_WIFI_AP = '/api/v3/wifi/ap/'; const API_WIFI_AP_ALLOWED_COMB = '/api/v3/wifi/ap/%u/allowed_channel_comb'; const API_WIFI_AP_STATIONS = '/api/v3/wifi/ap/%u/stations/'; + const API_WIFI_AP_NEIGHBORS = '/api/v3/wifi/ap/%u/neighbors/'; /** * @return \alphayax\freebox\api\v3\models\WiFi\AccessPoint\AP[] @@ -71,4 +72,17 @@ class AccessPoint extends Service { return $rest->getResult( models\WiFi\AccessPoint\AP::class); } + /** + * Get the list of Neighbor seen by the AP + * @param int $accessPointId + * @return models\WiFi\Radar\Neighbor[] + */ + public function getNeighborsFromId( $accessPointId) { + $service = sprintf( self::API_WIFI_AP_NEIGHBORS, $accessPointId); + $rest = $this->getAuthService( $service); + $rest->GET(); + + return $rest->getResultAsArray( models\WiFi\Radar\Neighbor::class); + } + }