diff --git a/freebox/api/v3/services/config/WiFi/AccessPoint.php b/freebox/api/v3/services/config/WiFi/AccessPoint.php index b1d7f59..3095d08 100644 --- a/freebox/api/v3/services/config/WiFi/AccessPoint.php +++ b/freebox/api/v3/services/config/WiFi/AccessPoint.php @@ -9,11 +9,12 @@ use alphayax\freebox\api\v3\Service; */ 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/'; - const API_WIFI_AP_CHANNEL_USAGE = '/api/v3/wifi/ap/%u/channel_usage/'; + 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/'; + const API_WIFI_AP_NEIGHBORS_SCAN = '/api/v3/wifi/ap/%u/neighbors/scan'; + const API_WIFI_AP_CHANNEL_USAGE = '/api/v3/wifi/ap/%u/channel_usage/'; /** * @return \alphayax\freebox\api\v3\models\WiFi\AccessPoint\AP[] @@ -87,8 +88,23 @@ class AccessPoint extends Service { } /** + * WARNING during the scan the AP will be unavailable. Therefore, you should ask for user confirmation prior to launching a scan. + * Once launched you should wait until the ap state comes back from scanning to get updated info. * @param int $accessPointId - * @return models\WiFi\Radar\Neighbor[] + * @return boolean + */ + public function refreshNeighborsScan( $accessPointId) { + $service = sprintf( self::API_WIFI_AP_NEIGHBORS, $accessPointId); + $rest = $this->getAuthService( $service); + $rest->POST(); + + return $rest->getSuccess(); + } + + /** + * List Wi-Fi channels usage + * @param int $accessPointId + * @return models\WiFi\Radar\ChannelUsage[] */ public function getChannelUsageFromId( $accessPointId) { $service = sprintf( self::API_WIFI_AP_CHANNEL_USAGE, $accessPointId);