/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";
package android.bluetooth.rfcomm;

option java_outer_classname = "BluetoothRfcommProtoEnums";
option java_multiple_files = true;

enum RfcommConnectionResult {
  RFCOMM_CONN_RESULT_FAILURE_UNKNOWN = 0;
  RFCOMM_CONN_RESULT_SUCCESS = 1;
  RFCOMM_CONN_RESULT_SOCKET_CONNECTION_FAILED = 2;
  RFCOMM_CONN_RESULT_SOCKET_CONNECTION_CLOSED = 3;
  RFCOMM_CONN_RESULT_UNABLE_TO_SEND_RPC = 4;
  RFCOMM_CONN_RESULT_NULL_BLUETOOTH_DEVICE = 5;
  RFCOMM_CONN_RESULT_GET_SOCKET_MANAGER_FAILED = 6;
  RFCOMM_CONN_RESULT_NULL_FILE_DESCRIPTOR = 7;
}

enum SocketConnectionSecurity {
  SOCKET_SECURITY_UNKNOWN = 0;
  SOCKET_SECURITY_SECURE = 1;
  SOCKET_SECURITY_INSECURE = 2;
}

enum PortResult {
  PORT_RESULT_UNDEFINED = 0;
  PORT_RESULT_SUCCESS = 1;
  PORT_RESULT_UNKNOWN_ERROR = 2;
  PORT_RESULT_ALREADY_OPENED = 3;
  PORT_RESULT_CMD_PENDING = 4;
  PORT_RESULT_APP_NOT_REGISTERED = 5;
  PORT_RESULT_NO_MEM = 6;
  PORT_RESULT_NO_RESOURCES = 7;
  PORT_RESULT_BAD_BD_ADDR = 8;
  PORT_RESULT_BAD_HANDLE = 9;
  PORT_RESULT_NOT_OPENED = 10;
  PORT_RESULT_LINE_ERR = 11;
  PORT_RESULT_START_FAILED = 12;
  PORT_RESULT_PAR_NEG_FAILED = 13;
  PORT_RESULT_PORT_NEG_FAILED = 14;
  PORT_RESULT_SEC_FAILED = 15;
  PORT_RESULT_PEER_CONNECTION_FAILED = 16;
  PORT_RESULT_PEER_FAILED = 17;
  PORT_RESULT_PEER_TIMEOUT = 18;
  PORT_RESULT_CLOSED = 19;
  PORT_RESULT_TX_FULL = 20;
  PORT_RESULT_LOCAL_CLOSED = 21;
  PORT_RESULT_LOCAL_TIMEOUT = 22;
  PORT_RESULT_TX_QUEUE_DISABLED = 23;
  PORT_RESULT_PAGE_TIMEOUT = 24;
  PORT_RESULT_INVALID_SCN = 25;
  PORT_RESULT_ERR_MAX = 26;
}

enum RfcommPortState {
  PORT_STATE_UNKNOWN = 0;
  PORT_STATE_SABME_WAIT_UA = 1;
  PORT_STATE_ORIG_WAIT_SEC_CHECK = 2;
  PORT_STATE_TERM_WAIT_SEC_CHECK = 3;
  PORT_STATE_OPENED = 4;
  PORT_STATE_DISC_WAIT_UA = 5;
  PORT_STATE_CLOSED = 6;
}

enum RfcommPortEvent {
  PORT_EVENT_UNKNOWN = 0;
  PORT_EVENT_SABME = 1;
  PORT_EVENT_UA = 2;
  PORT_EVENT_DM = 3;
  PORT_EVENT_DISC = 4;
  PORT_EVENT_UIH = 5;
  PORT_EVENT_TIMEOUT = 6;
  PORT_EVENT_OPEN = 7;
  PORT_EVENT_ESTABLISH_RSP = 8;
  PORT_EVENT_CLOSE = 9;
  PORT_EVENT_CLEAR = 10;
  PORT_EVENT_DATA = 11;
  PORT_EVENT_SEC_COMPLETE = 12;
}
