blob: 7dcda51744bd6aa01d9e28760ad8cb4441c207c9 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.wlan.sme;
struct BssInfo {
array<uint8>:6 bssid;
vector<uint8>:32 ssid;
int8 rx_dbm;
uint8 channel;
bool protected;
bool compatible;
};
struct EssInfo {
BssInfo best_bss;
};
enum ScanErrorCode {
NOT_SUPPORTED = 1;
INTERNAL_ERROR = 2;
};
struct ScanError {
ScanErrorCode code;
string message;
};
interface ScanTransaction {
// Can be called several times to deliver incremental scan results
1: -> OnResult(vector<EssInfo> aps);
2: -> OnFinished();
3: -> OnError(ScanError error);
};
struct ScanRequest {
uint8 timeout; // seconds
};
enum ConnectResultCode {
// Connected successfully
SUCCESS = 0;
// The request was superseded by another connect or disconnect command
CANCELED = 1;
// Failed to join for some reason
FAILED = 2;
// Failed to join due to bad credentials
BAD_CREDENTIALS = 3;
// TODO(hahnr): Add result code for attempting to join an incompatible network
};
interface ConnectTransaction {
// Could add more events here to notify the client of the progress
1: -> OnFinished(ConnectResultCode code);
};
enum Phy {
HR = 1; // IEEE 802.11b, used for DSSS, HR/DSSS, ERP-DSSS/CCK
ERP = 2; // IEEE 802.11a/g, used for ERP-OFDM
HT = 3; // IEEE 802.11n
VHT = 4; // IEEE 802.11ac
HEW = 5; // IEEE 802.11ax
};
enum Cbw { // Channel Bandwidth
CBW20 = 0;
CBW40 = 1;
// CBW40ABOVE = CBW40;
CBW40BELOW = 2;
CBW80 = 3;
CBW160 = 4;
CBW80P80 = 5;
CBW_COUNT = 6;
};
struct ConnectPhyParams {
bool override_phy;
Phy phy;
bool override_cbw;
Cbw cbw;
};
struct ConnectRequest {
vector<uint8>:32 ssid;
vector<uint8>:64 password;
ConnectPhyParams params;
};
struct ClientStatusResponse {
BssInfo? connected_to;
// If non-empty, this is the SSID we are currently trying to connect to
vector<uint8>:32 connecting_to_ssid;
};
interface ClientSme {
1: Scan(ScanRequest req, request<ScanTransaction> txn);
2: Connect(ConnectRequest req, request<ConnectTransaction>? txn);
3: Disconnect() -> ();
4: Status() -> (ClientStatusResponse resp);
};
struct ApConfig {
vector<uint8>:32 ssid;
vector<uint8>:64 password;
uint8 channel;
};
enum StartApResultCode {
SUCCESS = 0;
ALREADY_STARTED = 1;
INTERNAL_ERROR = 2;
CANCELED = 3;
TIMED_OUT = 4;
PREVIOUS_START_IN_PROGRESS = 5;
};
interface ApSme {
1: Start(ApConfig config) -> (StartApResultCode code);
2: Stop() -> ();
};
struct MeshConfig {
vector<uint8>:32 mesh_id;
uint8 channel;
};
enum JoinMeshResultCode {
SUCCESS = 0;
CANCELED = 1;
INTERNAL_ERROR = 2;
};
interface MeshSme {
1: Join(MeshConfig config) -> (JoinMeshResultCode code);
};