react-native-ble-nitro
Version:
High-performance React Native BLE library built on Nitro Modules - drop-in replacement for react-native-ble-plx
147 lines (146 loc) • 10.2 kB
JavaScript
export var RefreshGattMoment;
(function (RefreshGattMoment) {
RefreshGattMoment[RefreshGattMoment["OnConnected"] = 0] = "OnConnected";
})(RefreshGattMoment || (RefreshGattMoment = {}));
export var CharacteristicSubscriptionType;
(function (CharacteristicSubscriptionType) {
CharacteristicSubscriptionType[CharacteristicSubscriptionType["Notification"] = 0] = "Notification";
CharacteristicSubscriptionType[CharacteristicSubscriptionType["Indication"] = 1] = "Indication";
})(CharacteristicSubscriptionType || (CharacteristicSubscriptionType = {}));
// Enums
export var State;
(function (State) {
State[State["Unknown"] = 0] = "Unknown";
State[State["Resetting"] = 1] = "Resetting";
State[State["Unsupported"] = 2] = "Unsupported";
State[State["Unauthorized"] = 3] = "Unauthorized";
State[State["PoweredOff"] = 4] = "PoweredOff";
State[State["PoweredOn"] = 5] = "PoweredOn";
})(State || (State = {}));
export var LogLevel;
(function (LogLevel) {
LogLevel[LogLevel["None"] = 0] = "None";
LogLevel[LogLevel["Verbose"] = 1] = "Verbose";
LogLevel[LogLevel["Debug"] = 2] = "Debug";
LogLevel[LogLevel["Info"] = 3] = "Info";
LogLevel[LogLevel["Warning"] = 4] = "Warning";
LogLevel[LogLevel["Error"] = 5] = "Error";
})(LogLevel || (LogLevel = {}));
export var ScanMode;
(function (ScanMode) {
ScanMode[ScanMode["Opportunistic"] = -1] = "Opportunistic";
ScanMode[ScanMode["LowPower"] = 0] = "LowPower";
ScanMode[ScanMode["Balanced"] = 1] = "Balanced";
ScanMode[ScanMode["LowLatency"] = 2] = "LowLatency";
})(ScanMode || (ScanMode = {}));
export var ScanCallbackType;
(function (ScanCallbackType) {
ScanCallbackType[ScanCallbackType["AllMatches"] = 1] = "AllMatches";
ScanCallbackType[ScanCallbackType["FirstMatch"] = 2] = "FirstMatch";
ScanCallbackType[ScanCallbackType["MatchLost"] = 4] = "MatchLost";
})(ScanCallbackType || (ScanCallbackType = {}));
export var ConnectionPriority;
(function (ConnectionPriority) {
ConnectionPriority[ConnectionPriority["Balanced"] = 0] = "Balanced";
ConnectionPriority[ConnectionPriority["High"] = 1] = "High";
ConnectionPriority[ConnectionPriority["LowPower"] = 2] = "LowPower";
})(ConnectionPriority || (ConnectionPriority = {}));
// Complex error code enums
export var BleErrorCode;
(function (BleErrorCode) {
BleErrorCode[BleErrorCode["UnknownError"] = 0] = "UnknownError";
BleErrorCode[BleErrorCode["BluetoothManagerDestroyed"] = 1] = "BluetoothManagerDestroyed";
BleErrorCode[BleErrorCode["OperationCancelled"] = 2] = "OperationCancelled";
BleErrorCode[BleErrorCode["OperationTimedOut"] = 3] = "OperationTimedOut";
BleErrorCode[BleErrorCode["OperationStartFailed"] = 4] = "OperationStartFailed";
BleErrorCode[BleErrorCode["InvalidIdentifiers"] = 5] = "InvalidIdentifiers";
BleErrorCode[BleErrorCode["BluetoothUnsupported"] = 100] = "BluetoothUnsupported";
BleErrorCode[BleErrorCode["BluetoothUnauthorized"] = 101] = "BluetoothUnauthorized";
BleErrorCode[BleErrorCode["BluetoothPoweredOff"] = 102] = "BluetoothPoweredOff";
BleErrorCode[BleErrorCode["BluetoothInUnknownState"] = 103] = "BluetoothInUnknownState";
BleErrorCode[BleErrorCode["BluetoothResetting"] = 104] = "BluetoothResetting";
BleErrorCode[BleErrorCode["BluetoothStateChangeFailed"] = 105] = "BluetoothStateChangeFailed";
BleErrorCode[BleErrorCode["DeviceConnectionFailed"] = 200] = "DeviceConnectionFailed";
BleErrorCode[BleErrorCode["DeviceDisconnected"] = 201] = "DeviceDisconnected";
BleErrorCode[BleErrorCode["DeviceRSSIReadFailed"] = 202] = "DeviceRSSIReadFailed";
BleErrorCode[BleErrorCode["DeviceAlreadyConnected"] = 203] = "DeviceAlreadyConnected";
BleErrorCode[BleErrorCode["DeviceNotFound"] = 204] = "DeviceNotFound";
BleErrorCode[BleErrorCode["DeviceNotConnected"] = 205] = "DeviceNotConnected";
BleErrorCode[BleErrorCode["DeviceMTUChangeFailed"] = 206] = "DeviceMTUChangeFailed";
BleErrorCode[BleErrorCode["ServicesDiscoveryFailed"] = 300] = "ServicesDiscoveryFailed";
BleErrorCode[BleErrorCode["IncludedServicesDiscoveryFailed"] = 301] = "IncludedServicesDiscoveryFailed";
BleErrorCode[BleErrorCode["ServiceNotFound"] = 302] = "ServiceNotFound";
BleErrorCode[BleErrorCode["ServicesNotDiscovered"] = 303] = "ServicesNotDiscovered";
BleErrorCode[BleErrorCode["CharacteristicsDiscoveryFailed"] = 400] = "CharacteristicsDiscoveryFailed";
BleErrorCode[BleErrorCode["CharacteristicWriteFailed"] = 401] = "CharacteristicWriteFailed";
BleErrorCode[BleErrorCode["CharacteristicReadFailed"] = 402] = "CharacteristicReadFailed";
BleErrorCode[BleErrorCode["CharacteristicNotifyChangeFailed"] = 403] = "CharacteristicNotifyChangeFailed";
BleErrorCode[BleErrorCode["CharacteristicNotFound"] = 404] = "CharacteristicNotFound";
BleErrorCode[BleErrorCode["CharacteristicsNotDiscovered"] = 405] = "CharacteristicsNotDiscovered";
BleErrorCode[BleErrorCode["CharacteristicInvalidDataFormat"] = 406] = "CharacteristicInvalidDataFormat";
BleErrorCode[BleErrorCode["DescriptorsDiscoveryFailed"] = 500] = "DescriptorsDiscoveryFailed";
BleErrorCode[BleErrorCode["DescriptorWriteFailed"] = 501] = "DescriptorWriteFailed";
BleErrorCode[BleErrorCode["DescriptorReadFailed"] = 502] = "DescriptorReadFailed";
BleErrorCode[BleErrorCode["DescriptorNotFound"] = 503] = "DescriptorNotFound";
BleErrorCode[BleErrorCode["DescriptorsNotDiscovered"] = 504] = "DescriptorsNotDiscovered";
BleErrorCode[BleErrorCode["DescriptorInvalidDataFormat"] = 505] = "DescriptorInvalidDataFormat";
BleErrorCode[BleErrorCode["DescriptorWriteNotAllowed"] = 506] = "DescriptorWriteNotAllowed";
BleErrorCode[BleErrorCode["ScanStartFailed"] = 600] = "ScanStartFailed";
BleErrorCode[BleErrorCode["LocationServicesDisabled"] = 601] = "LocationServicesDisabled";
})(BleErrorCode || (BleErrorCode = {}));
export var BleATTErrorCode;
(function (BleATTErrorCode) {
BleATTErrorCode[BleATTErrorCode["Success"] = 0] = "Success";
BleATTErrorCode[BleATTErrorCode["InvalidHandle"] = 1] = "InvalidHandle";
BleATTErrorCode[BleATTErrorCode["ReadNotPermitted"] = 2] = "ReadNotPermitted";
BleATTErrorCode[BleATTErrorCode["WriteNotPermitted"] = 3] = "WriteNotPermitted";
BleATTErrorCode[BleATTErrorCode["InvalidPdu"] = 4] = "InvalidPdu";
BleATTErrorCode[BleATTErrorCode["InsufficientAuthentication"] = 5] = "InsufficientAuthentication";
BleATTErrorCode[BleATTErrorCode["RequestNotSupported"] = 6] = "RequestNotSupported";
BleATTErrorCode[BleATTErrorCode["InvalidOffset"] = 7] = "InvalidOffset";
BleATTErrorCode[BleATTErrorCode["InsufficientAuthorization"] = 8] = "InsufficientAuthorization";
BleATTErrorCode[BleATTErrorCode["PrepareQueueFull"] = 9] = "PrepareQueueFull";
BleATTErrorCode[BleATTErrorCode["AttributeNotFound"] = 10] = "AttributeNotFound";
BleATTErrorCode[BleATTErrorCode["AttributeNotLong"] = 11] = "AttributeNotLong";
BleATTErrorCode[BleATTErrorCode["InsufficientEncryptionKeySize"] = 12] = "InsufficientEncryptionKeySize";
BleATTErrorCode[BleATTErrorCode["InvalidAttributeValueLength"] = 13] = "InvalidAttributeValueLength";
BleATTErrorCode[BleATTErrorCode["UnlikelyError"] = 14] = "UnlikelyError";
BleATTErrorCode[BleATTErrorCode["InsufficientEncryption"] = 15] = "InsufficientEncryption";
BleATTErrorCode[BleATTErrorCode["UnsupportedGroupType"] = 16] = "UnsupportedGroupType";
BleATTErrorCode[BleATTErrorCode["InsufficientResources"] = 17] = "InsufficientResources";
})(BleATTErrorCode || (BleATTErrorCode = {}));
export var BleIOSErrorCode;
(function (BleIOSErrorCode) {
BleIOSErrorCode[BleIOSErrorCode["Unknown"] = 0] = "Unknown";
BleIOSErrorCode[BleIOSErrorCode["InvalidParameters"] = 1] = "InvalidParameters";
BleIOSErrorCode[BleIOSErrorCode["InvalidHandle"] = 2] = "InvalidHandle";
BleIOSErrorCode[BleIOSErrorCode["NotConnected"] = 3] = "NotConnected";
BleIOSErrorCode[BleIOSErrorCode["OutOfSpace"] = 4] = "OutOfSpace";
BleIOSErrorCode[BleIOSErrorCode["OperationCancelled"] = 5] = "OperationCancelled";
BleIOSErrorCode[BleIOSErrorCode["ConnectionTimeout"] = 6] = "ConnectionTimeout";
BleIOSErrorCode[BleIOSErrorCode["PeripheralDisconnected"] = 7] = "PeripheralDisconnected";
BleIOSErrorCode[BleIOSErrorCode["UuidNotAllowed"] = 8] = "UuidNotAllowed";
BleIOSErrorCode[BleIOSErrorCode["AlreadyAdvertising"] = 9] = "AlreadyAdvertising";
BleIOSErrorCode[BleIOSErrorCode["ConnectionFailed"] = 10] = "ConnectionFailed";
BleIOSErrorCode[BleIOSErrorCode["ConnectionLimitReached"] = 11] = "ConnectionLimitReached";
BleIOSErrorCode[BleIOSErrorCode["UnknownDevice"] = 12] = "UnknownDevice";
})(BleIOSErrorCode || (BleIOSErrorCode = {}));
export var BleAndroidErrorCode;
(function (BleAndroidErrorCode) {
BleAndroidErrorCode[BleAndroidErrorCode["NoResources"] = 128] = "NoResources";
BleAndroidErrorCode[BleAndroidErrorCode["InternalError"] = 129] = "InternalError";
BleAndroidErrorCode[BleAndroidErrorCode["WrongState"] = 130] = "WrongState";
BleAndroidErrorCode[BleAndroidErrorCode["DbFull"] = 131] = "DbFull";
BleAndroidErrorCode[BleAndroidErrorCode["Busy"] = 132] = "Busy";
BleAndroidErrorCode[BleAndroidErrorCode["Error"] = 133] = "Error";
BleAndroidErrorCode[BleAndroidErrorCode["CmdStarted"] = 134] = "CmdStarted";
BleAndroidErrorCode[BleAndroidErrorCode["IllegalParameter"] = 135] = "IllegalParameter";
BleAndroidErrorCode[BleAndroidErrorCode["Pending"] = 136] = "Pending";
BleAndroidErrorCode[BleAndroidErrorCode["AuthFail"] = 137] = "AuthFail";
BleAndroidErrorCode[BleAndroidErrorCode["More"] = 138] = "More";
BleAndroidErrorCode[BleAndroidErrorCode["InvalidCfg"] = 139] = "InvalidCfg";
BleAndroidErrorCode[BleAndroidErrorCode["ServiceStarted"] = 140] = "ServiceStarted";
BleAndroidErrorCode[BleAndroidErrorCode["EncrypedNoMitm"] = 141] = "EncrypedNoMitm";
BleAndroidErrorCode[BleAndroidErrorCode["NotEncrypted"] = 142] = "NotEncrypted";
BleAndroidErrorCode[BleAndroidErrorCode["Congested"] = 143] = "Congested";
})(BleAndroidErrorCode || (BleAndroidErrorCode = {}));