blob: a2e07b1b771f5ca10c37b74adf58d0dc8bd9e382 [file] [log] [blame]
// Copyright 2020 Google LLC
//
// 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
//
// https://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 location.nearby.errorcode.proto;
option optimize_for = LITE_RUNTIME;
option java_package = "com.google.location.nearby.errorcode.proto";
option java_outer_classname = "ErrorCodeEnums";
option objc_class_prefix = "GNCP";
// The type of the error.
// It help to sort error codes to different types to analyze and also impact the
// logcat print it as Warning or Severe.
enum ErrorType {
UNKNOWN_TYPE = 0;
// The error should not happen on production, it's like the input is null or
// not invalid or it's a unexpected API call. For example, start advertising
// with empty service ID or start advertising with the same service ID twice.
DEVELOPING = 1;
// It’s about the device's capabilities, some devices may not support the
// feature Nearby used. E.g. The device not support BLE advertising
DEVICE = 2;
// The failure return from the system or library API we used to communicate
// with the medium. E.g. get null OS objects or call the API but get a
// negative return value which indicates that the system does not allow to do
// that now.
SYSTEM = 3;
// The network related failure. E.g. get an EOF exception while reading pipe
// or fail to create connection.
NETWORK = 4;
// This may not be a failure, it can be the things we are interested in, like
// to count how many BLE advertisements the device received in a specified
// period and how many different advertisements in it, it can help us to know
// the user under a clean or dirty environment.
OTHERS = 5;
}
// The event which the error occurs on.
enum Event {
UNKNOWN_EVENT = 0;
START_ADVERTISING = 1;
STOP_ADVERTISING = 2;
START_LISTENING_INCOMING_CONNECTION = 3;
STOP_LISTENING_INCOMING_CONNECTION = 4;
START_DISCOVERING = 5;
STOP_DISCOVERING = 6;
CONNECT = 7;
DISCONNECT = 8;
ACCEPT_CONNECTION = 9;
REJECT_CONNECTION = 10;
SEND_PAYLOAD = 11;
CANCEL_PAYLOAD = 12;
RECEIVE_PAYLOAD = 13;
}
// The error to identify the common failure for all mediums. The range between 0
// and 30.
enum CommonError {
UNKNOWN_ERROR = 0;
// The common error for all mediums, the range between 0 and 30.
// Developing error, the input with invalid format or empty.
INVALID_PARAMETER = 1;
// Device error, the medium not available on this device.
MEDIUM_NOT_AVAILABLE = 2;
// System error, the medium in the unexpected state, e.g. we have check the
// medium is on, after then it suddently off and cause Nearby
// Connection failed.
UNEXPECTED_MEDIUM_STATE = 3;
// System error, the medim not available because the resource ran out. e.g.
// the Wi-Fi Direct initialized cause Wi-Fi Aware not available, or BLE
// connections hit the maximan number, or Wi-Fi Hotstop already created.
OUT_OF_RESOURCE = 4;
// Others error, the error happens when user cancel the flow, it's not a
// real failure.
FLOW_CANCELED = 5;
// Developing error, an unexpect call that the medium not ready, need to do
// something before this call. e.g. call WifiAwareImpli#connectToSocket but
// never join network before this call.
UNEXPECTED_CALL = 6;
// Reserved 7 to 30
}
// The error for event START_ADVERTISING. The range between 31 and 99.
enum StartAdvertisingError {
reserved 37, 39;
// Developing error, not allow to advertising fast pair model id and sharing
// fast advertisement at the same time, they are both use fast
// advertisement, and only allow 1 fast advertisement at the same time.
MULTIPLE_FAST_ADVERTISEMENT_NOT_ALLOWED = 31;
// System error, there's already someone advertising fast advertisement, not
// allow to start another one.
FAST_ADVERTISEMENT_ALREADY_ADVERTISED = 32;
// Developing error, this service ID already requested, should not request
// it again without stop advertising.
DUPLICATE_ADVERTISING_REQUESTED = 33;
// System error, failed to start GATT server
START_GATT_SERVER_FAILED = 34;
// System error, all advertising slot ran out, can't available for new
// regular advertisement.
BLE_MAX_GATT_ADVERTISEMENT_SLOT_REACHED = 35;
// System error, failed to start advertising for legacy advertisements on BLE
START_LEGACY_ADVERTISING_FAILED = 36;
// System error, failed to start advertising for extended advertisements on
// BLE
START_EXTENDED_ADVERTISING_FAILED = 38;
// System error, there's already someone advertising on Bluetooth, not allow
// to start another one.
BLUETOOTH_ALREADY_ADVERTISED = 40;
// System error, failed to modify the Bluetooth name.
MODIFY_BLUETOOTH_NAME_FAILED = 41;
// System error, failed to persist the original Bluetooth name into shared
// preference.
PERSIST_ORIGINAL_BLUETOOTH_NAME_FAILED = 42;
// System error, failed to start advertising.
START_ADVERTISING_FAILED = 43;
// Developing error, not allow to advertising on Wi-Fi Lan(TDLS) without
// accetpting connections. The connection may comes in very quickly, so need
// to accetpt connections before advertising.
SHOULD_ACCEPT_CONNECTIONS_BEFORE_ADVERTISING_ON_WIFI_LAN = 44;
// System error, failed to acquire WifiAwareSession
ACQUIRE_WIFI_AWARE_SESSION_FAILED = 45;
// The default value for clearcut
UNKNOWN_START_ADVERTISING_ERROR = 46;
// System error, failed to update Aware PublishConfig
AWARE_UPDATE_PUBLISHING_FAILED = 47;
// Next ID :48
}
// The error for event STOP_ADVERTISING. The range between 31 and 99.
enum StopAdvertisingError {
// System error, failed to stop advertising.
STOP_ADVERTISING_FAILED = 31;
// System error, failed to modify the Bluetooth name.
RESTORE_BLUETOOTH_NAME_FAILED = 32;
// System error, failed to stop advertising for BLE legacy advertisements.
STOP_LEGACY_ADVERTISING_FAILED = 33;
// System error, failed to stop advertising for BLE extended advertisements.
STOP_EXTENDED_ADVERTISING_FAILED = 34;
// The default value for clearcut
UNKNOWN_STOP_ADVERTISING_ERROR = 35;
// Next ID :36
}
// The error for event START_DISCOVERING. The range between 31 and 99.
enum StartDiscoveringError {
// Developing error, this service ID already requested, should not request it
// again without stop discovering.
DUPLICATE_DISCOVERING_REQUESTED = 31;
// System error, failed to start discovering for legacy advertisements on BLE
START_LEGACY_DISCOVERING_FAILED = 32;
// System error, failed to start discovering for extended advertisements on
// BLE
START_EXTENDED_DISCOVERING_FAILED = 33;
// System error, failed to start discovering.
START_DISCOVERING_FAILED = 34;
// Network error, invalid remote target info, discover the nearby devices but
// the information not valid.
INVALID_TARGET_INFO = 35;
// Network error, failed to fetch the advertisement from the remote devices.
FETCH_ADVERTISEMENT_FAILED = 36;
// Network error, failed to fetch the advertisement via GATT from the remote
// devices.
GATT_FETCH_ADVERTISEMENT_FAILED = 37;
// Network error, failed to fetch the advertisement via L2CAP from the remote
// devices.
L2CAP_FETCH_ADVERTISEMENT_FAILED = 38;
// System error, the medium not available when trying to fetch advertisements.
// e.g. fetch advertisements but BT disabled unexpectedly.
NOT_AVAILABLE_TO_FETCH_ADVERTISEMENT = 39;
// System error, failed to acquire WifiAwareSession
ACQUIRE_WIFI_AWARE_SESSION_FOR_DISCOVERING_FAILED = 40;
// The default value for clearcut
UNKNOWN_START_DISCOVERING_ERROR = 41;
// Next ID :42
}
// The error for event STOP_DISCOVERING. The range between 31 and 99.
enum StopDiscoveringError {
// System error, failed to stop discovering.
STOP_DISCOVERING_FAILED = 31;
// System error, failed to stop discovering for BLE legacy scanning.
STOP_LEGACY_DISCOVERING_FAILED = 32;
// System error, failed to stop discovering for BLE extended scanning.
STOP_EXTENDED_DISCOVERING_FAILED = 33;
// The default value for clearcut
UNKNOWN_STOP_DISCOVERING_ERROR = 34;
// Next ID :35
}
// The error for event START_LISTENING_INCOMING_CONNECTION. The range between 31
// and 99.
enum StartListeningIncomingConnectionError {
// Developing error, this service ID already requested, should not request it
// again without stop accepting.
DUPLICATE_ACCEPTING_CONNECTION_REQUESTED = 31;
// System error, failed to open a GATT server for listening incoming GATT
// connection.
OPEN_GATT_SERVER_FAILED = 32;
// System error, failed to accept the incoming GATT connection
ACCEPT_GATT_CONNECTION_FAILED = 33;
// System error, failed to accept the incoming L2CAP connection
ACCEPT_L2CAP_CONNECTION_FAILED = 34;
// Network error, wait the GATT connection ready after the connection
// established but never.
CREATE_GATT_SERVER_SOCKET_NOT_READY = 35;
// System error, failed to accept the incoming connection
ACCEPT_CONNECTION_FAILED = 36;
// System error, failed to create a server socket for listening incoming
// connection.
CREATE_SERVER_SOCKET_FAILED = 37;
// The default value for clearcut
UNKNOWN_START_LISTENING_INCOMING_CONNECTION_ERROR = 38;
// Network error, failed to send L2 Message to the remote peer
ACCEPT_SEND_AWARE_L2_MESSAGE_FAILED = 39;
// Network error, failed to receive L2 Message from the remote peer
ACCEPT_RECEIVE_AWARE_L2_MESSAGE_FAILED = 40;
// Next ID :41
}
// The error for event STOP_LISTENING_INCOMING_CONNECTION. The range between 31
// and 99.
enum StopListeningIncomingConnectionError {
// System error, failed to stop accepting the incoming connection
STOP_ACCEPTING_CONNECTION_FAILED = 31;
// The default value for clearcut
UNKNOWN_STOP_LISTENING_INCOMING_CONNECTION_ERROR = 32;
// Next ID :33
}
// The error for event CONNECT. The range between 31 and 99.
enum ConnectError {
// Network error, failed to connect to remote device because we lost the
// target without MAC address to connect to. e.g. BLE cache MAC address in
// medium, it may lost when just try to connect.
UNEXPECT_TARGET_LOST = 31;
// System error, failed to establish connection on GATT
ESTABLISH_GATT_CONNECTION_FAILED = 32;
// System error, failed to establish connection on L2CAP
ESTABLISH_L2CAP_CONNECTION_FAILED = 33;
// Developing error, the MAC address not valid for connecting
INVALID_MAC_ADDRESS = 34;
// Others error, unexpected interrupt when sleep before connect GATT for
// waiting GATT server ready. Should not hapepen, it may be the process be
// killed.
SLEEP_BEFORE_CONNECT_GATT_INTERRUPTED = 35;
// Others error, unexpected interrupt when sleep after GATT connect to wait
// GATT connection ready to transfer data. Should not hapepen, it may be
// the process be killed.
SLEEP_AFTER_GATT_CONNECTED_INTERRUPTED = 36;
// Network error, failed to configure the GATT connection priority, it may
// failed when the connection still wait for the status update from network or
// just a RemoteException.
REQUEST_GATT_CONNECTION_PRIORITY_FAILED = 37;
// Network error, failed to change connection for data transferring on L2CAP
// connection.
L2CAP_SWITCH_TO_DATA_TRANSFERRING_FAILED = 38;
// Network error, failed to change connection for data transferring on GATT
// connection.
GATT_SWITCH_TO_DATA_TRANSFERRING_FAILED = 39;
// System error, failed to establish connection
ESTABLISH_CONNECTION_FAILED = 40;
// Developing error, this connection already established, should not request
// it again.
DUPLICATE_CONNECTION_REQUESTED = 41;
// Network error, the connection lost.
CONNECTION_LOST = 42;
// Network error, failed to connect to the network. e.g. an aware network,
// hotspot or a direct network.
CONNECT_TO_NETWORK_FAILED = 43;
// The default value for clearcut
UNKNOWN_CONNECT_ERROR = 44;
// Network error, failed to send L2 Message to the remote peer
CONNECT_SEND_AWARE_L2_MESSAGE_FAILED = 45;
// Network error, failed to send L2 Message to the remote peer
CONNECT_READ_AWARE_L2_MESSAGE_FAILED = 46;
// Next ID :47
}
// The error for event DISCONNECT. The range between 31 and 99.
enum DisconnectError {
// System error, failed to disconnect the network.
DISCONNECT_NETWORK_FAILED = 31;
// The default value for clearcut
UNKNOWN_DISCONNECT_ERROR = 32;
// Next ID :33
}
enum Description {
reserved 28, 29;
UNKNOWN = 0;
NULL_SERVICE_ID = 1;
NULL_ADVERTISEMENT_BYTES = 2;
CONNECTIONS_FEATURE_DISABLED = 3;
STALE_SDK_VERSION = 4;
FEATURE_BLUETOOTH_NOT_SUPPORTED = 5;
FEATURE_BLUETOOTH_LE_NOT_SUPPORTED = 6;
NULL_BLUETOOTH_MANAGER = 7;
NULL_BLUETOOTH_ADAPTER = 8;
INVALID_FAST_PAIR_MODEL_ID = 9;
INVALID_FAST_ADVERTISEMENT_DATA = 10;
INVALID_ADVERTISEMENT_HEADER_DATA = 11;
INVALID_REGULAR_ADVERTISEMENT_DATA = 12;
NULL_BLUETOOTH_LE_ADVERTISER_COMPAT = 13;
ADVERTISE_FAILED_ALREADY_STARTED = 14;
ADVERTISE_FAILED_DATA_TOO_LARGE = 15;
ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 16;
ADVERTISE_FAILED_INTERNAL_ERROR = 17;
ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = 18;
INTERRUPTED_EXCEPTION = 19;
EXECUTION_EXCEPTION = 20;
NULL_BLUETOOTH_DEVICE_NAME = 21;
SET_SCAN_MODE_FAILED = 22;
INVOKE_API_FAILED = 23;
TIMEOUT = 24;
NULL_NFC_TAG = 25;
FEATURE_NFC_NOT_SUPPORTED = 26;
FEATURE_NFC_HOST_CARD_EMULATION_NOT_SUPPORTED = 27;
MULTICAST_NOT_SUPPORTED = 30;
NSD_NOT_ENABLED = 31;
INVALID_PORT_NUMBER = 32;
NULL_SERVICE_NAME = 33;
NULL_SERVICE_TYPE = 34;
WITHOUT_CONNECTED_WIFI_NETWORK = 35;
FEATURE_WIFI_AWARE_NOT_SUPPORTED = 36;
NULL_CONNECTIVITY_MANAGER = 37;
NULL_WIFI_AWARE_MANAGER = 38;
STALE_ANDROID_VERSION = 39;
NULL_SERVICE_INFO = 40;
NULL_WORK_SOURCE = 41;
NULL_CALLBACK = 42;
NULL_BLUETOOTH_LE_SCANNER_COMPAT = 43;
EMPTY_WORK_SOURCE_CACHE = 44;
SCAN_FAILED_ALREADY_STARTED = 45;
SCAN_FAILED_APPLICATION_REGISTRATION_FAILED = 46;
SCAN_FAILED_INTERNAL_ERROR = 47;
SCAN_FAILED_FEATURE_UNSUPPORTED = 48;
SCAN_FAILED_BLUETOOTH_DISABLED = 49;
SCAN_FILTERS_NOT_ALLOWED_FOR_LOCATION = 50;
BLUETOOTH_SCAN_REJUVENATE_FAILED = 51;
NULL_BLE_PERIPHERAL = 52;
NULL_BLUETOOTH_GATT = 53;
UNEXPECTED_BLUETOOTH_STATE = 54;
REMOTE_EXCEPTION = 55;
INVALID_BLUETOOTH_SOCKET_STATE_BEFORE_CONNECT = 56;
BLUETOOTH_SOCKET_CLOSED_AFTER_CONNECTED = 57;
INVALID_BLUETOOTH_CHANNEL = 58;
NULL_BLUETOOTH_DEVICE = 59;
NULL_BLUETOOTH_PROXY = 60;
INVALID_PACKET_LENGTH = 61;
INVALID_PACKET_BYTES = 62;
UNEXPECTED_EOF_EXCEPTION = 63;
SOCKET_CLOSED_OR_TIMEOUT = 64;
INVALID_IPV4_ADDRESS = 65;
INVALID_IPV6_ADDRESS = 66;
NULL_ADDRESS = 67;
INVALID_VERSION = 68;
SET_CONNECTION_PRIORITY_FAILED = 69;
SET_CONNECTION_PRIORITY_INTERRUPTED = 70;
UNKNOWN_IO_EXCEPTION = 71;
READ_CHARACTERISTIC_FAILED = 72;
WIFI_HOTSPOT_ENABLED = 73;
AWARE_UNAVAILABLE = 74;
IN_BLACK_LIST = 75;
FEATURE_WIFI_NOT_SUPPORTED = 76;
NULL_WIFI_MANAGER = 77;
SOCKET_CLOSED = 78;
SOCKET_ALREADY_CONNECTED = 79;
NFC_TECH_NOT_SUPPORTED = 80;
NFC_SERVICE_DIED = 81;
BIND_NFC_SERVICE_FAILED = 82;
NFC_CREATE_SOCKET_FAILED = 83;
NULL_WIFI_AWARE_PEER = 84;
NETWORK_ALREADY_JOINED = 85;
JOIN_AWARE_NETWORK_CANCELLED = 86;
NETWORK_UNAVAILABLE = 87;
WITHOUT_ACTIVE_AWARE_NETWORK = 88;
WITHOUT_JOINED_AWARE_NETWORK = 89;
CONNET_TO_SOCKET_CANCELLED = 90;
NULL_SSID = 91;
NULL_PASSWORD = 92;
FEATURE_WIFI_DIRECT_NOT_SUPPORTED = 93;
NULL_WIFI_P2P_MANAGER = 94;
P2P_GROUP_FORMED = 95;
ACQUIRE_P2P_CHANNEL_FAILED = 96;
P2P_UNSUPPORTED = 97;
INTERNAL_ERROR = 98;
BUSY = 99;
REFLECTION_ERROR = 100;
NETWORK_ERROR_EHOSTUNREACH = 101;
NETWORK_ERROR_ENETUNREACH = 102;
ADD_NETWORK_FAILED = 103;
UPDATE_NETWORK_FAILED = 104;
ALREADY_IN_PROGRESS = 105;
INVALID_ARGS = 106;
NOT_AUTHORIZED = 107;
INVALID_NETWORK_ID = 108;
WIFI_MANAGER_ENABLE_NETWORK_FAILED = 109;
WIFI_MANAGER_RECONNECT_FAILED = 110;
WITHOUT_ACTIVE_NETWORK = 111;
WEBRTC_CONNECTION_FLOW_EXIST = 112;
NULL_DROID_GUARD_RESULT = 113;
TACHYON_SIGNALING_MESSENGER_EXIST = 114;
TACHYON_ALREADY_START_RECEIVE_MESSAGE = 115;
TACHYON_RECEIVE_MESSAGE_FAILED = 116;
TACHYON_RECEIVE_MESSAGE_INTERRUPTED = 117;
TACHYON_RECEIVE_MESSAGE_EXECUTION_EXCEPTION = 118;
TACHYON_RECEIVE_MESSAGE_TIMEOUT = 119;
TACHYON_RECEIVE_MESSAGE_AUTH_EXCEPTION = 120;
TACHYON_RECEIVE_MESSAGE_STATUS_EXCEPTION = 121;
TACHYON_SEND_MESSAGE_AUTH_EXCEPTION = 122;
TACHYON_SEND_MESSAGE_STATUS_EXCEPTION = 123;
TACHYON_GET_ICE_SERVER_AUTH_EXCEPTION = 124;
TACHYON_GET_ICE_SERVER_STATUS_EXCEPTION = 125;
EMPTY_TACHYON_ICE_SERVER = 126;
POTENTIAL_WEBRTC_LIB_LOADING_FAILURE = 127;
UNEXPECTED_GATT_DESCRIPTOR = 128;
FAIL_TO_RECEIVE_L2CAP_PACKET = 129;
WITHOUT_PSM_VALUE = 130;
SOCKET_BIND_LISTEN_FAILED = 131;
UNEXPECTED_PACKET_CONTENT = 132;
UNREGISTER_NSD_MANAGER_FAILED = 133;
PUBLISH_EMPTY_ADVERTISEMENT_FAILED = 134;
BLUETOOTH_SOCKET_NOT_IN_LISTENING_STATE = 135;
INVALID_BLUETOOTH_SOCKET_SIGNAL_SIZE = 136;
INVALID_BLUETOOTH_SOCKET_SIGNAL_STATUS = 137;
GET_ADDRESS_FAILED = 138;
NULL_LOCAL_ADDRESS = 139;
IS_LOOPBACK_ADDRESS = 140;
SOCKET_NOT_BOUND = 141;
INVALID_REMOTE_ADDRESS = 142;
SOCKET_ALREADY_BOUND = 143;
HOTSPOT_NOT_STARTED = 144;
WEBRTC_ALREADY_INITIALIZED = 145;
INVALID_WEBRTC_STATE = 146;
NULL_DATA_CHANNEL = 147;
CREATE_OFFER_FAILED = 148;
CLOSE_SERVER_SOCKET_FAILED = 149;
WIFI_AWARE_STARTED = 150;
AWARE_PUBLISH_SESSION_RAN_OUT = 151;
AWARE_SUBSCRIBE_SESSION_RAN_OUT = 152;
AWARE_DATA_PATH_RAN_OUT = 153;
WIFI_SIGNAL_STRENGTH_POOR = 154;
POTENTIAL_SRD_ISSUE = 155;
AWARE_L2_MESSAGE_HOST_NETWORK_ERROR = 156;
AWARE_L2_MESSAGE_NETWORK_AVAILABLE_ERROR = 157;
AWARE_L2_MESSAGE_IP_AVAILABLE_ERROR = 158;
AWARE_L2_MESSAGE_CANCELLATION_RECEIVED = 159;
TIE_BREAK_LOSER = 160;
SERVER_SOCKET_UNAVAILABLE = 161;
HOSTED_NETWORK_UNAVAILABLE = 162;
AWARE_UPDATE_PUBLISHING_CONFIG_FAILED = 163;
L2CAP_UNAVAILABLE = 164;
ALREADY_HAS_GATT_CONNECTION = 165;
UNSUPPORTED_DEVICE_TYPE = 166;
UNSUPPORTED_DEVICE_TYPE_CHROME_OS = 167;
UNSUPPORTED_DEVICE_TYPE_AUTO = 168;
UNSUPPORTED_DEVICE_TYPE_TV = 169;
UNSUPPORTED_DEVICE_TYPE_WEAR = 170;
NULL_MESSAGE = 171;
}