react-native-ble-nitro
Version:
High-performance React Native BLE library built on Nitro Modules - drop-in replacement for react-native-ble-plx
51 lines (50 loc) • 1.28 kB
JavaScript
/**
* React-native-ble-plx compatibility constants
*
* Re-exports all constants and types to maintain API compatibility
*/
// Re-export original string-based constants for backward compatibility
export const State = {
Unknown: 'Unknown',
Resetting: 'Resetting',
Unsupported: 'Unsupported',
Unauthorized: 'Unauthorized',
PoweredOff: 'PoweredOff',
PoweredOn: 'PoweredOn',
};
export const LogLevel = {
None: 'None',
Verbose: 'Verbose',
Debug: 'Debug',
Info: 'Info',
Warning: 'Warning',
Error: 'Error',
};
// Subscription type constants
export const CharacteristicSubscriptionType = {
Notification: 'notification',
Indication: 'indication',
};
// Connection options constants
export const RefreshGattMoment = {
OnConnected: 'OnConnected',
};
// Scan mode constants (these remain numeric as in original)
export const ScanMode = {
Opportunistic: -1,
LowPower: 0,
Balanced: 1,
LowLatency: 2,
};
export const ScanCallbackType = {
AllMatches: 1,
FirstMatch: 2,
MatchLost: 4,
};
export const ConnectionPriority = {
Balanced: 0,
High: 1,
LowPower: 2,
};
// Re-export all BLE error codes
export { BleErrorCode, BleATTErrorCode, BleIOSErrorCode, BleAndroidErrorCode } from '../specs/types';