Add Wifi Radar Refresh API

This commit is contained in:
alphayax 2016-06-08 13:28:15 +02:00
parent ecff48d027
commit f8abc7a9c4
1 changed files with 22 additions and 6 deletions

View File

@ -9,11 +9,12 @@ use alphayax\freebox\api\v3\Service;
*/ */
class AccessPoint extends Service { class AccessPoint extends Service {
const API_WIFI_AP = '/api/v3/wifi/ap/'; 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_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_STATIONS = '/api/v3/wifi/ap/%u/stations/';
const API_WIFI_AP_NEIGHBORS = '/api/v3/wifi/ap/%u/neighbors/'; 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_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[] * @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 * @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) { public function getChannelUsageFromId( $accessPointId) {
$service = sprintf( self::API_WIFI_AP_CHANNEL_USAGE, $accessPointId); $service = sprintf( self::API_WIFI_AP_CHANNEL_USAGE, $accessPointId);