syntax = "proto2";

package androidauto.bluetooth;

enum MessageId {
  BLUETOOTH_SOCKET_INFO_REQUEST = 1;
  BLUETOOTH_NETWORK_INFO_REQUEST = 2;
  BLUETOOTH_NETWORK_INFO_MESSAGE = 3;
  BLUETOOTH_SOCKET_INFO_RESPONSE = 7;
}

enum SecurityMode {
    UNKNOWN_SECURITY_MODE = 0;
    OPEN = 1;
    WEP_64 = 2;
    WEP_128 = 3;
    WPA_PERSONAL = 4;
    WPA2_PERSONAL = 8;
    WPA_WPA2_PERSONAL = 12;
    WPA_ENTERPRISE = 20;
    WPA2_ENTERPRISE = 24;
    WPA_WPA2_ENTERPRISE = 28;
}

enum AccessPointType {
    STATIC = 0;
    DYNAMIC = 1;
}

message NetworkInfo
{
    required string ssid = 1;
    required string psk = 2;
    required string mac_addr = 3;
    required SecurityMode security_mode = 4;
    required AccessPointType ap_type = 5;
}

message SocketInfoRequest
{
    required string ip_address = 1;
    optional uint32 port = 2;
}

enum Status {
    STATUS_UNSOLICITED_MESSAGE = 1;
    STATUS_SUCCESS = 0;
    STATUS_NO_COMPATIBLE_VERSION = -1;
    STATUS_WIFI_INACCESSIBLE_CHANNEL = -2;
    STATUS_WIFI_INCORRECT_CREDENTIALS = -3;
    STATUS_PROJECTION_ALREADY_STARTED = -4;
    STATUS_WIFI_DISABLED = -5;
    STATUS_WIFI_NOT_YET_STARTED = -6;
    STATUS_INVALID_HOST = -7;
    STATUS_NO_SUPPORTED_WIFI_CHANNELS = -8;
    STATUS_INSTRUCT_USER_TO_CHECK_THE_PHONE = -9;
    STATUS_PHONE_WIFI_DISABLED = -10;
    STATUS_WIFI_NETWORK_UNAVAILABLE = -11;
}

message SocketInfoResponse
{
    optional string ip_address = 1;
    optional int32 port = 2;
    required Status status = 3;
}