mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I8be5378519ca952da43c40fba96141a7f8517748
203 lines
7.2 KiB
Protocol Buffer
203 lines
7.2 KiB
Protocol Buffer
syntax = "proto2";
|
||
|
||
package location.nearby.proto;
|
||
|
||
import "logs/proto/logs_annotations/logs_annotations.proto";
|
||
|
||
option optimize_for = LITE_RUNTIME;
|
||
option (logs_proto.file_not_used_for_logging_except_enums) = true;
|
||
option java_api_version = 2;
|
||
option java_package = "com.google.location.nearby.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;
|
||
|
||
// Reserved 5 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;
|
||
|
||
// Next ID :46
|
||
}
|
||
|
||
// 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;
|
||
|
||
// Next ID :34
|
||
}
|
||
|
||
enum Description {
|
||
reserved 28;
|
||
|
||
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;
|
||
WITHOUT_CONNECTED_WIFI_NETWOR = 29;
|
||
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;
|
||
}
|