react-native-ble-nitro 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/lib/commonjs/BleManagerCompatFactory.d.ts +56 -0
  2. package/lib/commonjs/BleManagerCompatFactory.d.ts.map +1 -0
  3. package/lib/commonjs/BleManagerCompatFactory.js +201 -0
  4. package/lib/commonjs/BleManagerCompatFactory.js.map +1 -0
  5. package/lib/commonjs/BleManagerFactory.d.ts +31 -0
  6. package/lib/commonjs/BleManagerFactory.d.ts.map +1 -0
  7. package/lib/commonjs/BleManagerFactory.js +81 -0
  8. package/lib/commonjs/BleManagerFactory.js.map +1 -0
  9. package/lib/commonjs/compatibility/constants.d.ts +50 -0
  10. package/lib/commonjs/compatibility/constants.d.ts.map +1 -0
  11. package/lib/commonjs/compatibility/constants.js +58 -0
  12. package/lib/commonjs/compatibility/constants.js.map +1 -0
  13. package/lib/commonjs/compatibility/deviceWrapper.d.ts +100 -0
  14. package/lib/commonjs/compatibility/deviceWrapper.d.ts.map +1 -0
  15. package/lib/commonjs/compatibility/deviceWrapper.js +268 -0
  16. package/lib/commonjs/compatibility/deviceWrapper.js.map +1 -0
  17. package/lib/commonjs/compatibility/enums.d.ts +39 -0
  18. package/lib/commonjs/compatibility/enums.d.ts.map +1 -0
  19. package/lib/commonjs/compatibility/enums.js +179 -0
  20. package/lib/commonjs/compatibility/enums.js.map +1 -0
  21. package/lib/commonjs/compatibility/index.d.ts +13 -0
  22. package/lib/commonjs/compatibility/index.d.ts.map +1 -0
  23. package/lib/commonjs/compatibility/index.js +41 -0
  24. package/lib/commonjs/compatibility/index.js.map +1 -0
  25. package/lib/commonjs/compatibility/serviceData.d.ts +52 -0
  26. package/lib/commonjs/compatibility/serviceData.d.ts.map +1 -0
  27. package/lib/commonjs/compatibility/serviceData.js +80 -0
  28. package/lib/commonjs/compatibility/serviceData.js.map +1 -0
  29. package/lib/commonjs/errors/BleError.d.ts +60 -0
  30. package/lib/commonjs/errors/BleError.d.ts.map +1 -0
  31. package/lib/commonjs/errors/BleError.js +125 -0
  32. package/lib/commonjs/errors/BleError.js.map +1 -0
  33. package/lib/commonjs/index.d.ts +11 -0
  34. package/lib/commonjs/index.d.ts.map +1 -0
  35. package/lib/commonjs/index.js +42 -0
  36. package/lib/commonjs/index.js.map +1 -0
  37. package/lib/commonjs/specs/BleManager.nitro.d.ts +45 -0
  38. package/lib/commonjs/specs/BleManager.nitro.d.ts.map +1 -0
  39. package/lib/commonjs/specs/BleManager.nitro.js +3 -0
  40. package/lib/commonjs/specs/BleManager.nitro.js.map +1 -0
  41. package/lib/commonjs/specs/Characteristic.nitro.d.ts +27 -0
  42. package/lib/commonjs/specs/Characteristic.nitro.d.ts.map +1 -0
  43. package/lib/commonjs/specs/Characteristic.nitro.js +3 -0
  44. package/lib/commonjs/specs/Characteristic.nitro.js.map +1 -0
  45. package/lib/commonjs/specs/Descriptor.nitro.d.ts +18 -0
  46. package/lib/commonjs/specs/Descriptor.nitro.d.ts.map +1 -0
  47. package/lib/commonjs/specs/Descriptor.nitro.js +3 -0
  48. package/lib/commonjs/specs/Descriptor.nitro.js.map +1 -0
  49. package/lib/commonjs/specs/Device.nitro.d.ts +38 -0
  50. package/lib/commonjs/specs/Device.nitro.d.ts.map +1 -0
  51. package/lib/commonjs/specs/Device.nitro.js +3 -0
  52. package/lib/commonjs/specs/Device.nitro.js.map +1 -0
  53. package/lib/commonjs/specs/Service.nitro.d.ts +20 -0
  54. package/lib/commonjs/specs/Service.nitro.d.ts.map +1 -0
  55. package/lib/commonjs/specs/Service.nitro.js +3 -0
  56. package/lib/commonjs/specs/Service.nitro.js.map +1 -0
  57. package/lib/commonjs/specs/types.d.ts +229 -0
  58. package/lib/commonjs/specs/types.d.ts.map +1 -0
  59. package/lib/commonjs/specs/types.js +150 -0
  60. package/lib/commonjs/specs/types.js.map +1 -0
  61. package/lib/commonjs/utils/base64.d.ts +26 -0
  62. package/lib/commonjs/utils/base64.d.ts.map +1 -0
  63. package/lib/commonjs/utils/base64.js +88 -0
  64. package/lib/commonjs/utils/base64.js.map +1 -0
  65. package/lib/commonjs/utils/index.d.ts +3 -0
  66. package/lib/commonjs/utils/index.d.ts.map +1 -0
  67. package/lib/commonjs/utils/index.js +19 -0
  68. package/lib/commonjs/utils/index.js.map +1 -0
  69. package/lib/commonjs/utils/uuid.d.ts +10 -0
  70. package/lib/commonjs/utils/uuid.d.ts.map +1 -0
  71. package/lib/commonjs/utils/uuid.js +41 -0
  72. package/lib/commonjs/utils/uuid.js.map +1 -0
  73. package/package.json +5 -4
@@ -0,0 +1,56 @@
1
+ /**
2
+ * BleManager Compatibility Factory
3
+ *
4
+ * Creates BleManager instances with full react-native-ble-plx compatibility
5
+ * by wrapping the Nitro implementation with compatibility shims
6
+ */
7
+ import type { BleManagerOptions, UUID, DeviceId, TransactionId, ConnectionPriority, ConnectionOptions, ScanOptions, NativeService, NativeCharacteristic, NativeDescriptor, LogLevel, Subscription } from './specs/types.js';
8
+ import { DeviceWrapper } from './compatibility/deviceWrapper.js';
9
+ import { State as PlxState, LogLevel as PlxLogLevel } from './compatibility/enums.js';
10
+ /**
11
+ * BleManager wrapper that provides react-native-ble-plx compatibility
12
+ */
13
+ export declare class BleManagerCompat {
14
+ private bleManager;
15
+ constructor(options?: BleManagerOptions);
16
+ destroy(): Promise<void>;
17
+ setLogLevel(logLevel: LogLevel | string): Promise<PlxLogLevel>;
18
+ logLevel(): Promise<PlxLogLevel>;
19
+ cancelTransaction(transactionId: TransactionId): Promise<void>;
20
+ enable(transactionId?: TransactionId): Promise<BleManagerCompat>;
21
+ disable(transactionId?: TransactionId): Promise<BleManagerCompat>;
22
+ state(): Promise<PlxState>;
23
+ onStateChange(listener: (newState: PlxState) => void, emitCurrentState?: boolean): Subscription;
24
+ startDeviceScan(uuids: UUID[] | null, options: ScanOptions | null, listener: (error: any | null, scannedDevice: DeviceWrapper | null) => void): Promise<void>;
25
+ stopDeviceScan(): Promise<void>;
26
+ connectToDevice(deviceIdentifier: DeviceId, options?: Partial<ConnectionOptions>): Promise<DeviceWrapper>;
27
+ cancelDeviceConnection(deviceIdentifier: DeviceId): Promise<DeviceWrapper>;
28
+ isDeviceConnected(deviceIdentifier: DeviceId): Promise<boolean>;
29
+ onDeviceDisconnected(deviceIdentifier: DeviceId, listener: (error: any | null, device: DeviceWrapper | null) => void): Subscription;
30
+ devices(deviceIdentifiers: DeviceId[]): Promise<DeviceWrapper[]>;
31
+ connectedDevices(serviceUUIDs: UUID[]): Promise<DeviceWrapper[]>;
32
+ readRSSIForDevice(deviceIdentifier: DeviceId, transactionId?: TransactionId): Promise<DeviceWrapper>;
33
+ requestMTUForDevice(deviceIdentifier: DeviceId, mtu: number, transactionId?: TransactionId): Promise<DeviceWrapper>;
34
+ requestConnectionPriorityForDevice(deviceIdentifier: DeviceId, connectionPriority: ConnectionPriority, transactionId?: TransactionId): Promise<DeviceWrapper>;
35
+ discoverAllServicesAndCharacteristicsForDevice(deviceIdentifier: DeviceId, transactionId?: TransactionId): Promise<DeviceWrapper>;
36
+ servicesForDevice(deviceIdentifier: DeviceId): Promise<NativeService[]>;
37
+ characteristicsForDevice(deviceIdentifier: DeviceId, serviceUUID: UUID): Promise<NativeCharacteristic[]>;
38
+ readCharacteristicForDevice(deviceIdentifier: DeviceId, serviceUUID: UUID, characteristicUUID: UUID, transactionId?: TransactionId): Promise<NativeCharacteristic>;
39
+ writeCharacteristicWithResponseForDevice(deviceIdentifier: DeviceId, serviceUUID: UUID, characteristicUUID: UUID, base64Value: string, transactionId?: TransactionId): Promise<NativeCharacteristic>;
40
+ writeCharacteristicWithoutResponseForDevice(deviceIdentifier: DeviceId, serviceUUID: UUID, characteristicUUID: UUID, base64Value: string, transactionId?: TransactionId): Promise<NativeCharacteristic>;
41
+ monitorCharacteristicForDevice(deviceIdentifier: DeviceId, serviceUUID: UUID, characteristicUUID: UUID, listener: (error: any | null, characteristic: NativeCharacteristic | null) => void, // TODO: COMPAT! use proper error type like in react-native-ble-plx
42
+ transactionId?: TransactionId, subscriptionType?: 'notification' | 'indication'): Subscription;
43
+ descriptorsForDevice(deviceIdentifier: DeviceId, serviceUUID: UUID, characteristicUUID: UUID): Promise<NativeDescriptor[]>;
44
+ readDescriptorForDevice(deviceIdentifier: DeviceId, serviceUUID: UUID, characteristicUUID: UUID, descriptorUUID: UUID, transactionId?: TransactionId): Promise<NativeDescriptor>;
45
+ writeDescriptorForDevice(deviceIdentifier: DeviceId, serviceUUID: UUID, characteristicUUID: UUID, descriptorUUID: UUID, valueBase64: string, transactionId?: TransactionId): Promise<NativeDescriptor>;
46
+ /**
47
+ * Helper method to create a Device wrapper from NativeDevice data
48
+ * This is a temporary method until we have proper Device Nitro objects
49
+ */
50
+ private createDeviceFromNative;
51
+ }
52
+ /**
53
+ * Factory function to create a compatibility BleManager
54
+ */
55
+ export declare function createBleManagerCompat(options?: BleManagerOptions): BleManagerCompat;
56
+ //# sourceMappingURL=BleManagerCompatFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BleManagerCompatFactory.d.ts","sourceRoot":"","sources":["../../src/BleManagerCompatFactory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,iBAAiB,EACjB,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EAEX,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAKL,KAAK,IAAI,QAAQ,EACjB,QAAQ,IAAI,WAAW,EACxB,MAAM,0BAA0B,CAAC;AAGlC;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,UAAU,CAAsB;gBAE5B,OAAO,CAAC,EAAE,iBAAiB;IAKjC,OAAO,IAAI,OAAO,C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,kBAAkB,EAAE,IAAI,EACxB,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,oBAAoB,CAAC;IAUhC,8BAA8B,CAC5B,gBAAgB,EAAE,QAAQ,EAC1B,WAAW,EAAE,IAAI,EACjB,kBAAkB,EAAE,IAAI,EACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,EAAE,cAAc,EAAE,oBAAoB,GAAG,IAAI,KAAK,IAAI,EAAE,mEAAmE;IACvJ,aAAa,CAAC,EAAE,aAAa,EAC7B,gBAAgB,CAAC,EAAE,cAAc,GAAG,YAAY,GAC/C,YAAY;IAgBT,oBAAoB,CACxB,gBAAgB,EAAE,QAAQ,EAC1B,WAAW,EAAE,IAAI,EACjB,kBAAkB,EAAE,IAAI,GACvB,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAQxB,uBAAuB,CAC3B,gBAAgB,EAAE,QAAQ,EAC1B,WAAW,EAAE,IAAI,EACjB,kBAAkB,EAAE,IAAI,EACxB,cAAc,EAAE,IAAI,EACpB,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,gBAAgB,CAAC;IAUtB,wBAAwB,CAC5B,gBAAgB,EAAE,QAAQ,EAC1B,WAAW,EAAE,IAAI,EACjB,kBAAkB,EAAE,IAAI,EACxB,cAAc,EAAE,IAAI,EACpB,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,gBAAgB,CAAC;IAW5B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;CAqC/B;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAEpF"}
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ /**
3
+ * BleManager Compatibility Factory
4
+ *
5
+ * Creates BleManager instances with full react-native-ble-plx compatibility
6
+ * by wrapping the Nitro implementation with compatibility shims
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.BleManagerCompat = void 0;
10
+ exports.createBleManagerCompat = createBleManagerCompat;
11
+ const BleManagerFactory_js_1 = require("./BleManagerFactory.js");
12
+ const deviceWrapper_js_1 = require("./compatibility/deviceWrapper.js");
13
+ const enums_js_1 = require("./compatibility/enums.js");
14
+ /**
15
+ * BleManager wrapper that provides react-native-ble-plx compatibility
16
+ */
17
+ class BleManagerCompat {
18
+ constructor(options) {
19
+ this.bleManager = (0, BleManagerFactory_js_1.createBleManager)(options);
20
+ }
21
+ // Lifecycle
22
+ async destroy() {
23
+ return await this.bleManager.destroy();
24
+ }
25
+ // Common operations with compatibility
26
+ async setLogLevel(logLevel) {
27
+ const normalizedLogLevel = (0, enums_js_1.normalizeLogLevel)(logLevel);
28
+ const result = await this.bleManager.setLogLevel(normalizedLogLevel);
29
+ return (0, enums_js_1.logLevelToString)(result);
30
+ }
31
+ async logLevel() {
32
+ const result = await this.bleManager.logLevel();
33
+ return (0, enums_js_1.logLevelToString)(result);
34
+ }
35
+ async cancelTransaction(transactionId) {
36
+ return await this.bleManager.cancelTransaction(transactionId);
37
+ }
38
+ // State management with string conversion
39
+ async enable(transactionId) {
40
+ await this.bleManager.enable(transactionId);
41
+ return this;
42
+ }
43
+ async disable(transactionId) {
44
+ await this.bleManager.disable(transactionId);
45
+ return this;
46
+ }
47
+ async state() {
48
+ const result = await this.bleManager.state();
49
+ return (0, enums_js_1.stateToString)(result);
50
+ }
51
+ onStateChange(listener, emitCurrentState) {
52
+ return this.bleManager.onStateChange((state) => {
53
+ listener((0, enums_js_1.stateToString)(state));
54
+ }, emitCurrentState);
55
+ }
56
+ // Device scanning with compatibility wrappers
57
+ async startDeviceScan(uuids, options, listener // TODO: COMPAT! remove any and move to BleError as react-native-ble-plx uses this type as well!
58
+ ) {
59
+ return await this.bleManager.startDeviceScan(uuids, options, (error, device) => {
60
+ listener(error, device ? new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(device)) : null);
61
+ });
62
+ }
63
+ async stopDeviceScan() {
64
+ return await this.bleManager.stopDeviceScan();
65
+ }
66
+ // Connection management
67
+ async connectToDevice(deviceIdentifier, options) {
68
+ var _a, _b, _c;
69
+ // Provide defaults for Nitro's required fields
70
+ const connectionOptions = {
71
+ autoConnect: (_a = options === null || options === void 0 ? void 0 : options.autoConnect) !== null && _a !== void 0 ? _a : false,
72
+ requestMTU: (_b = options === null || options === void 0 ? void 0 : options.requestMTU) !== null && _b !== void 0 ? _b : 23,
73
+ timeout: (_c = options === null || options === void 0 ? void 0 : options.timeout) !== null && _c !== void 0 ? _c : 0,
74
+ };
75
+ const result = await this.bleManager.connectToDevice(deviceIdentifier, connectionOptions);
76
+ return new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(result));
77
+ }
78
+ async cancelDeviceConnection(deviceIdentifier) {
79
+ const result = await this.bleManager.cancelDeviceConnection(deviceIdentifier);
80
+ return new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(result));
81
+ }
82
+ async isDeviceConnected(deviceIdentifier) {
83
+ return await this.bleManager.isDeviceConnected(deviceIdentifier);
84
+ }
85
+ onDeviceDisconnected(deviceIdentifier, listener // TODO: COMPAT! use propper error type like in react-native-ble-plx!!!
86
+ ) {
87
+ return this.bleManager.onDeviceDisconnected(deviceIdentifier, (error, device) => {
88
+ listener(error, device ? new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(device)) : null);
89
+ });
90
+ }
91
+ // Device discovery
92
+ async devices(deviceIdentifiers) {
93
+ const result = await this.bleManager.devices(deviceIdentifiers);
94
+ return result.map(device => new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(device)));
95
+ }
96
+ async connectedDevices(serviceUUIDs) {
97
+ const result = await this.bleManager.connectedDevices(serviceUUIDs);
98
+ return result.map(device => new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(device)));
99
+ }
100
+ // RSSI and MTU operations
101
+ async readRSSIForDevice(deviceIdentifier, transactionId) {
102
+ const result = await this.bleManager.readRSSIForDevice(deviceIdentifier, transactionId);
103
+ return new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(result));
104
+ }
105
+ async requestMTUForDevice(deviceIdentifier, mtu, transactionId) {
106
+ const result = await this.bleManager.requestMTUForDevice(deviceIdentifier, mtu, transactionId);
107
+ return new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(result));
108
+ }
109
+ async requestConnectionPriorityForDevice(deviceIdentifier, connectionPriority, transactionId) {
110
+ const result = await this.bleManager.requestConnectionPriorityForDevice(deviceIdentifier, connectionPriority, transactionId);
111
+ return new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(result));
112
+ }
113
+ // Service discovery
114
+ async discoverAllServicesAndCharacteristicsForDevice(deviceIdentifier, transactionId) {
115
+ const result = await this.bleManager.discoverAllServicesAndCharacteristicsForDevice(deviceIdentifier, transactionId);
116
+ return new deviceWrapper_js_1.DeviceWrapper(this.createDeviceFromNative(result));
117
+ }
118
+ // Service operations
119
+ async servicesForDevice(deviceIdentifier) {
120
+ return await this.bleManager.servicesForDevice(deviceIdentifier);
121
+ }
122
+ // Characteristic operations
123
+ async characteristicsForDevice(deviceIdentifier, serviceUUID) {
124
+ return await this.bleManager.characteristicsForDevice(deviceIdentifier, serviceUUID);
125
+ }
126
+ async readCharacteristicForDevice(deviceIdentifier, serviceUUID, characteristicUUID, transactionId) {
127
+ return await this.bleManager.readCharacteristicForDevice(deviceIdentifier, serviceUUID, characteristicUUID, transactionId);
128
+ }
129
+ async writeCharacteristicWithResponseForDevice(deviceIdentifier, serviceUUID, characteristicUUID, base64Value, transactionId) {
130
+ return await this.bleManager.writeCharacteristicWithResponseForDevice(deviceIdentifier, serviceUUID, characteristicUUID, base64Value, transactionId);
131
+ }
132
+ async writeCharacteristicWithoutResponseForDevice(deviceIdentifier, serviceUUID, characteristicUUID, base64Value, transactionId) {
133
+ return await this.bleManager.writeCharacteristicWithoutResponseForDevice(deviceIdentifier, serviceUUID, characteristicUUID, base64Value, transactionId);
134
+ }
135
+ monitorCharacteristicForDevice(deviceIdentifier, serviceUUID, characteristicUUID, listener, // TODO: COMPAT! use proper error type like in react-native-ble-plx
136
+ transactionId, subscriptionType) {
137
+ const nitroSubscriptionType = subscriptionType
138
+ ? (0, enums_js_1.normalizeCharacteristicSubscriptionType)(subscriptionType)
139
+ : undefined;
140
+ return this.bleManager.monitorCharacteristicForDevice(deviceIdentifier, serviceUUID, characteristicUUID, listener, transactionId, nitroSubscriptionType);
141
+ }
142
+ // Descriptor operations
143
+ async descriptorsForDevice(deviceIdentifier, serviceUUID, characteristicUUID) {
144
+ return await this.bleManager.descriptorsForDevice(deviceIdentifier, serviceUUID, characteristicUUID);
145
+ }
146
+ async readDescriptorForDevice(deviceIdentifier, serviceUUID, characteristicUUID, descriptorUUID, transactionId) {
147
+ return await this.bleManager.readDescriptorForDevice(deviceIdentifier, serviceUUID, characteristicUUID, descriptorUUID, transactionId);
148
+ }
149
+ async writeDescriptorForDevice(deviceIdentifier, serviceUUID, characteristicUUID, descriptorUUID, valueBase64, transactionId) {
150
+ return await this.bleManager.writeDescriptorForDevice(deviceIdentifier, serviceUUID, characteristicUUID, descriptorUUID, valueBase64, transactionId);
151
+ }
152
+ /**
153
+ * Helper method to create a Device wrapper from NativeDevice data
154
+ * This is a temporary method until we have proper Device Nitro objects
155
+ */
156
+ createDeviceFromNative(nativeDevice) {
157
+ // This is a placeholder - in the actual implementation, we'd need to create
158
+ // proper Nitro Device objects, but for now we'll work with the native data
159
+ return {
160
+ id: nativeDevice.id,
161
+ deviceName: nativeDevice.name,
162
+ rssi: nativeDevice.rssi,
163
+ mtu: nativeDevice.mtu,
164
+ manufacturerData: nativeDevice.manufacturerData,
165
+ rawScanRecord: nativeDevice.rawScanRecord,
166
+ serviceData: nativeDevice.serviceData,
167
+ serviceUUIDs: nativeDevice.serviceUUIDs,
168
+ localName: nativeDevice.localName,
169
+ txPowerLevel: nativeDevice.txPowerLevel,
170
+ solicitedServiceUUIDs: nativeDevice.solicitedServiceUUIDs,
171
+ isConnectable: nativeDevice.isConnectable,
172
+ overflowServiceUUIDs: nativeDevice.overflowServiceUUIDs,
173
+ // Add placeholder methods - these would be implemented in the actual Device class
174
+ requestConnectionPriority: async () => this.createDeviceFromNative(nativeDevice),
175
+ readRSSI: async () => this.createDeviceFromNative(nativeDevice),
176
+ requestMTU: async () => this.createDeviceFromNative(nativeDevice),
177
+ connect: async () => this.createDeviceFromNative(nativeDevice),
178
+ cancelConnection: async () => this.createDeviceFromNative(nativeDevice),
179
+ isConnected: async () => false,
180
+ onDisconnected: () => ({ remove: () => { } }),
181
+ discoverAllServicesAndCharacteristics: async () => this.createDeviceFromNative(nativeDevice),
182
+ services: async () => [],
183
+ characteristicsForService: async () => [],
184
+ readCharacteristicForService: async () => ({}),
185
+ writeCharacteristicWithResponseForService: async () => ({}),
186
+ writeCharacteristicWithoutResponseForService: async () => ({}),
187
+ monitorCharacteristicForService: () => ({ remove: () => { } }),
188
+ descriptorsForService: async () => [],
189
+ readDescriptorForService: async () => ({}),
190
+ writeDescriptorForService: async () => ({}),
191
+ };
192
+ }
193
+ }
194
+ exports.BleManagerCompat = BleManagerCompat;
195
+ /**
196
+ * Factory function to create a compatibility BleManager
197
+ */
198
+ function createBleManagerCompat(options) {
199
+ return new BleManagerCompat(options);
200
+ }
201
+ //# sourceMappingURL=BleManagerCompatFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BleManagerCompatFactory.js","sourceRoot":"","sources":["../../src/BleManagerCompatFactory.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA2WH,wDAEC;AA3WD,iEAA0D;AAiB1D,uEAAiE;AACjE,uDAOkC;AAGlC;;GAEG;AACH,MAAa,gBAAgB;IAG3B,YAAY,OAA2B;QACrC,IAAI,CAAC,UAAU,GAAG,IAAA,uCAAgB,EAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,YAAY;IACZ,KAAK,CAAC,OAAO;QAC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AgB,sBAAsB,CAAC,OAA2B;IAChE,OAAO,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { BleManager as BleManagerInterface } from './specs/BleManager.nitro.js';
2
+ import type { BleManagerOptions } from './specs/types.js';
3
+ /**
4
+ * Creates a BleManager instance using Nitro Modules
5
+ * This function maintains compatibility with react-native-ble-plx's BleManager constructor
6
+ */
7
+ export declare function createBleManager(options?: BleManagerOptions): BleManagerInterface;
8
+ /**
9
+ * Helper function to retrieve stored callbacks for a BleManager instance
10
+ * This is used internally when callbacks need to be invoked
11
+ */
12
+ export declare function getStoredCallbacks(manager: BleManagerInterface): {
13
+ restoreStateFunction?: (restoredState: any) => void;
14
+ errorCodesToMessagesMapping?: {
15
+ [key: number]: string;
16
+ };
17
+ } | undefined;
18
+ /**
19
+ * Helper function to get custom error message if available
20
+ * @param manager The BleManager instance
21
+ * @param errorCode The BLE error code
22
+ * @param defaultMessage Default error message
23
+ * @returns Custom message if available, otherwise default message
24
+ */
25
+ export declare function getCustomErrorMessage(manager: BleManagerInterface, errorCode: number, defaultMessage: string): string;
26
+ /**
27
+ * Legacy compatibility: Export a BleManager constructor function
28
+ * This maintains compatibility with code that imports { BleManager } from 'react-native-ble-plx'
29
+ */
30
+ export declare const BleManager: (options?: BleManagerOptions) => BleManagerInterface;
31
+ //# sourceMappingURL=BleManagerFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BleManagerFactory.d.ts","sourceRoot":"","sources":["../../src/BleManagerFactory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,IAAI,mBAAmB,EAA0B,MAAM,6BAA6B,CAAC;AAC7G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAQ1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,mBAAmB,CA6CjF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB;2BA3DtC,CAAC,aAAa,EAAE,GAAG,KAAK,IAAI;kCACrB;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;cA4DxD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,GACrB,MAAM,CAIR;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,EAElB,CAAC,OAAO,CAAC,EAAE,iBAAiB,KAAK,mBAAmB,CAAC"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BleManager = void 0;
4
+ exports.createBleManager = createBleManager;
5
+ exports.getStoredCallbacks = getStoredCallbacks;
6
+ exports.getCustomErrorMessage = getCustomErrorMessage;
7
+ const react_native_nitro_modules_1 = require("react-native-nitro-modules");
8
+ // Store callbacks that can't be passed to Nitro
9
+ const storedCallbacks = new WeakMap();
10
+ /**
11
+ * Creates a BleManager instance using Nitro Modules
12
+ * This function maintains compatibility with react-native-ble-plx's BleManager constructor
13
+ */
14
+ function createBleManager(options) {
15
+ const BleManagerModule = react_native_nitro_modules_1.NitroModules.createHybridObject('BleManager');
16
+ if (!BleManagerModule) {
17
+ throw new Error('Failed to create BleManager: Nitro module not found. ' +
18
+ 'Make sure react-native-ble-nitro is properly installed and linked.');
19
+ }
20
+ // Initialize with options if provided
21
+ if (options) {
22
+ // Extract Nitro-compatible options
23
+ const nitroOptions = {
24
+ restoreStateIdentifier: options.restoreStateIdentifier,
25
+ };
26
+ // Store callbacks and mappings that can't be passed to Nitro
27
+ if (options.restoreStateFunction || options.errorCodesToMessagesMapping) {
28
+ storedCallbacks.set(BleManagerModule, {
29
+ restoreStateFunction: options.restoreStateFunction,
30
+ errorCodesToMessagesMapping: options.errorCodesToMessagesMapping,
31
+ });
32
+ }
33
+ // Note: initialize() is async but we need to maintain sync compatibility with react-native-ble-plx
34
+ // The initialization will happen asynchronously in the background
35
+ BleManagerModule.initialize(nitroOptions).then(async () => {
36
+ // Check for restored state and call the callback if available
37
+ if (options.restoreStateFunction) {
38
+ try {
39
+ const restoredState = await BleManagerModule.getRestoredState();
40
+ if (restoredState) {
41
+ options.restoreStateFunction(restoredState);
42
+ }
43
+ }
44
+ catch (error) {
45
+ console.warn('BleManager restore state callback failed:', error);
46
+ }
47
+ }
48
+ }).catch(error => {
49
+ console.warn('BleManager initialization failed:', error);
50
+ });
51
+ }
52
+ return BleManagerModule;
53
+ }
54
+ /**
55
+ * Helper function to retrieve stored callbacks for a BleManager instance
56
+ * This is used internally when callbacks need to be invoked
57
+ */
58
+ function getStoredCallbacks(manager) {
59
+ return storedCallbacks.get(manager);
60
+ }
61
+ /**
62
+ * Helper function to get custom error message if available
63
+ * @param manager The BleManager instance
64
+ * @param errorCode The BLE error code
65
+ * @param defaultMessage Default error message
66
+ * @returns Custom message if available, otherwise default message
67
+ */
68
+ function getCustomErrorMessage(manager, errorCode, defaultMessage) {
69
+ var _a;
70
+ const callbacks = storedCallbacks.get(manager);
71
+ const customMessage = (_a = callbacks === null || callbacks === void 0 ? void 0 : callbacks.errorCodesToMessagesMapping) === null || _a === void 0 ? void 0 : _a[errorCode];
72
+ return customMessage || defaultMessage;
73
+ }
74
+ /**
75
+ * Legacy compatibility: Export a BleManager constructor function
76
+ * This maintains compatibility with code that imports { BleManager } from 'react-native-ble-plx'
77
+ */
78
+ exports.BleManager = function (options) {
79
+ return createBleManager(options);
80
+ };
81
+ //# sourceMappingURL=BleManagerFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BleManagerFactory.js","sourceRoot":"","sources":["../../src/BleManagerFactory.ts"],"names":[],"mappings":";;;AAcA,4CA6CC;AAMD,gDAEC;AASD,sDAQC;AApFD,2EAA0D;AAI1D,gDAAgD;AAChD,MAAM,eAAe,GAAG,IAAI,OAAO,EAG/B,CAAC;AA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AAC;IACL,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,OAA4B;IAC7D,OAAO,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,qBAAqB,CACnC,OAA4B,EAC5B,SAAiB,EACjB,cAAsB;;IAEtB,MAAM,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,aAAa,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,2BAA2B,0CAAG,SAAS,CAAC,CAAC;IAC1E,OAAO,aAAa,IAAI,cAAc,CAAC;AACzC,CAAC;AAED;;;GAGG;AACU,QAAA,UAAU,GAAG,UAAS,OAA2B;IAC5D,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAyD,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * React-native-ble-plx compatibility constants
3
+ *
4
+ * Re-exports all constants and types to maintain API compatibility
5
+ */
6
+ export declare const State: {
7
+ readonly Unknown: "Unknown";
8
+ readonly Resetting: "Resetting";
9
+ readonly Unsupported: "Unsupported";
10
+ readonly Unauthorized: "Unauthorized";
11
+ readonly PoweredOff: "PoweredOff";
12
+ readonly PoweredOn: "PoweredOn";
13
+ };
14
+ export declare const LogLevel: {
15
+ readonly None: "None";
16
+ readonly Verbose: "Verbose";
17
+ readonly Debug: "Debug";
18
+ readonly Info: "Info";
19
+ readonly Warning: "Warning";
20
+ readonly Error: "Error";
21
+ };
22
+ export type StateString = typeof State[keyof typeof State];
23
+ export type LogLevelString = typeof LogLevel[keyof typeof LogLevel];
24
+ export declare const CharacteristicSubscriptionType: {
25
+ readonly Notification: "notification";
26
+ readonly Indication: "indication";
27
+ };
28
+ export type CharacteristicSubscriptionTypeString = typeof CharacteristicSubscriptionType[keyof typeof CharacteristicSubscriptionType];
29
+ export declare const RefreshGattMoment: {
30
+ readonly OnConnected: "OnConnected";
31
+ };
32
+ export type RefreshGattMomentString = typeof RefreshGattMoment[keyof typeof RefreshGattMoment];
33
+ export declare const ScanMode: {
34
+ readonly Opportunistic: -1;
35
+ readonly LowPower: 0;
36
+ readonly Balanced: 1;
37
+ readonly LowLatency: 2;
38
+ };
39
+ export declare const ScanCallbackType: {
40
+ readonly AllMatches: 1;
41
+ readonly FirstMatch: 2;
42
+ readonly MatchLost: 4;
43
+ };
44
+ export declare const ConnectionPriority: {
45
+ readonly Balanced: 0;
46
+ readonly High: 1;
47
+ readonly LowPower: 2;
48
+ };
49
+ export { BleErrorCode, BleATTErrorCode, BleIOSErrorCode, BleAndroidErrorCode } from '../specs/types.js';
50
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/compatibility/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,eAAO,MAAM,KAAK;;;;;;;CAOR,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;;;;CAOX,CAAC;AAGX,MAAM,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC,MAAM,OAAO,KAAK,CAAC,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,OAAO,QAAQ,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAGpE,eAAO,MAAM,8BAA8B;;;CAGjC,CAAC;AAEX,MAAM,MAAM,oCAAoC,GAAG,OAAO,8BAA8B,CAAC,MAAM,OAAO,8BAA8B,CAAC,CAAC;AAGtI,eAAO,MAAM,iBAAiB;;CAEpB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,OAAO,iBAAiB,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAG/F,eAAO,MAAM,QAAQ;;;;;CAKX,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC;AAGX,OAAO,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,mBAAmB,EACpB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * React-native-ble-plx compatibility constants
4
+ *
5
+ * Re-exports all constants and types to maintain API compatibility
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BleAndroidErrorCode = exports.BleIOSErrorCode = exports.BleATTErrorCode = exports.BleErrorCode = exports.ConnectionPriority = exports.ScanCallbackType = exports.ScanMode = exports.RefreshGattMoment = exports.CharacteristicSubscriptionType = exports.LogLevel = exports.State = void 0;
9
+ // Re-export original string-based constants for backward compatibility
10
+ exports.State = {
11
+ Unknown: 'Unknown',
12
+ Resetting: 'Resetting',
13
+ Unsupported: 'Unsupported',
14
+ Unauthorized: 'Unauthorized',
15
+ PoweredOff: 'PoweredOff',
16
+ PoweredOn: 'PoweredOn',
17
+ };
18
+ exports.LogLevel = {
19
+ None: 'None',
20
+ Verbose: 'Verbose',
21
+ Debug: 'Debug',
22
+ Info: 'Info',
23
+ Warning: 'Warning',
24
+ Error: 'Error',
25
+ };
26
+ // Subscription type constants
27
+ exports.CharacteristicSubscriptionType = {
28
+ Notification: 'notification',
29
+ Indication: 'indication',
30
+ };
31
+ // Connection options constants
32
+ exports.RefreshGattMoment = {
33
+ OnConnected: 'OnConnected',
34
+ };
35
+ // Scan mode constants (these remain numeric as in original)
36
+ exports.ScanMode = {
37
+ Opportunistic: -1,
38
+ LowPower: 0,
39
+ Balanced: 1,
40
+ LowLatency: 2,
41
+ };
42
+ exports.ScanCallbackType = {
43
+ AllMatches: 1,
44
+ FirstMatch: 2,
45
+ MatchLost: 4,
46
+ };
47
+ exports.ConnectionPriority = {
48
+ Balanced: 0,
49
+ High: 1,
50
+ LowPower: 2,
51
+ };
52
+ // Re-export all BLE error codes
53
+ var types_js_1 = require("../specs/types.js");
54
+ Object.defineProperty(exports, "BleErrorCode", { enumerable: true, get: function () { return types_js_1.BleErrorCode; } });
55
+ Object.defineProperty(exports, "BleATTErrorCode", { enumerable: true, get: function () { return types_js_1.BleATTErrorCode; } });
56
+ Object.defineProperty(exports, "BleIOSErrorCode", { enumerable: true, get: function () { return types_js_1.BleIOSErrorCode; } });
57
+ Object.defineProperty(exports, "BleAndroidErrorCode", { enumerable: true, get: function () { return types_js_1.BleAndroidErrorCode; } });
58
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/compatibility/constants.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,uEAAuE;AAC1D,QAAA,KAAK,GAAG;IACnB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;CACd,CAAC;AAEE,QAAA,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACN,CAAC;AAMX,8BAA8B;AACjB,QAAA,8BAA8B,GAAG;IAC5C,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;CAChB,CAAC;AAIX,+BAA+B;AAClB,QAAA,iBAAiB,GAAG;IAC/B,WAAW,EAAE,aAAa;CAClB,CAAC;AAIX,4DAA4D;AAC/C,QAAA,QAAQ,GAAG;IACtB,aAAa,EAAE,CAAC,CAAC;IACjB,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,UAAU,EAAE,CAAC;CACL,CAAC;AAEE,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE,CAAC;IACb,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,CAAC;CACJ,CAAC;AAEE,QAAA,kBAAkB,GAAG;IAChC,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;CACH,CAAC;AAEX,gCAAgC;AAChC,8CAK2B;AAJzB,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Device wrapper for compatibility
3
+ *
4
+ * Wraps Nitro Device objects to provide the original react-native-ble-plx API
5
+ */
6
+ import type { Device as NitroDevice } from '../specs/Device.nitro.js';
7
+ import type { UUID, Base64, DeviceId, TransactionId, ConnectionPriority, ConnectionOptions, NativeService, NativeCharacteristic, NativeDescriptor, Subscription } from '../specs/types.js';
8
+ /**
9
+ * Device wrapper that provides react-native-ble-plx compatibility
10
+ * Maps Nitro device properties to the expected API surface
11
+ */
12
+ export declare class DeviceWrapper {
13
+ private nitroDevice;
14
+ constructor(nitroDevice: NitroDevice | any);
15
+ get id(): DeviceId;
16
+ get name(): string | null;
17
+ get rssi(): number | null;
18
+ get mtu(): number;
19
+ get manufacturerData(): Base64 | null;
20
+ get rawScanRecord(): Base64;
21
+ get serviceData(): {
22
+ [uuid: string]: Base64;
23
+ } | null;
24
+ get serviceUUIDs(): UUID[] | null;
25
+ get localName(): string | null;
26
+ get txPowerLevel(): number | null;
27
+ get solicitedServiceUUIDs(): UUID[] | null;
28
+ get isConnectable(): boolean | null;
29
+ get overflowServiceUUIDs(): UUID[] | null;
30
+ requestConnectionPriority(connectionPriority: ConnectionPriority, transactionId?: TransactionId): Promise<DeviceWrapper>;
31
+ readRSSI(transactionId?: TransactionId): Promise<DeviceWrapper>;
32
+ requestMTU(mtu: number, transactionId?: TransactionId): Promise<DeviceWrapper>;
33
+ connect(options?: Partial<ConnectionOptions>): Promise<DeviceWrapper>;
34
+ cancelConnection(): Promise<DeviceWrapper>;
35
+ isConnected(): Promise<boolean>;
36
+ onDisconnected(listener: (error: any | null, device: DeviceWrapper) => void): Subscription;
37
+ discoverAllServicesAndCharacteristics(transactionId?: TransactionId): Promise<DeviceWrapper>;
38
+ services(): Promise<ServiceWrapper[]>;
39
+ characteristicsForService(serviceUUID: UUID): Promise<CharacteristicWrapper[]>;
40
+ readCharacteristicForService(serviceUUID: UUID, characteristicUUID: UUID, transactionId?: TransactionId): Promise<CharacteristicWrapper>;
41
+ writeCharacteristicWithResponseForService(serviceUUID: UUID, characteristicUUID: UUID, valueBase64: Base64, transactionId?: TransactionId): Promise<CharacteristicWrapper>;
42
+ writeCharacteristicWithoutResponseForService(serviceUUID: UUID, characteristicUUID: UUID, valueBase64: Base64, transactionId?: TransactionId): Promise<CharacteristicWrapper>;
43
+ monitorCharacteristicForService(serviceUUID: UUID, characteristicUUID: UUID, listener: (error: any | null, characteristic: CharacteristicWrapper | null) => void, transactionId?: TransactionId, subscriptionType?: 'notification' | 'indication'): Subscription;
44
+ descriptorsForService(serviceUUID: UUID, characteristicUUID: UUID): Promise<DescriptorWrapper[]>;
45
+ readDescriptorForService(serviceUUID: UUID, characteristicUUID: UUID, descriptorUUID: UUID, transactionId?: TransactionId): Promise<DescriptorWrapper>;
46
+ writeDescriptorForService(serviceUUID: UUID, characteristicUUID: UUID, descriptorUUID: UUID, valueBase64: Base64, transactionId?: TransactionId): Promise<DescriptorWrapper>;
47
+ }
48
+ /**
49
+ * Service wrapper for compatibility
50
+ */
51
+ export declare class ServiceWrapper {
52
+ private nativeService;
53
+ private nitroDevice;
54
+ constructor(nativeService: NativeService, nitroDevice: NitroDevice);
55
+ get id(): number;
56
+ get uuid(): UUID;
57
+ get deviceID(): DeviceId;
58
+ get isPrimary(): boolean;
59
+ characteristics(): Promise<CharacteristicWrapper[]>;
60
+ readCharacteristic(characteristicUUID: UUID, transactionId?: TransactionId): Promise<CharacteristicWrapper>;
61
+ }
62
+ /**
63
+ * Characteristic wrapper for compatibility
64
+ */
65
+ export declare class CharacteristicWrapper {
66
+ private nativeCharacteristic;
67
+ private nitroDevice;
68
+ constructor(nativeCharacteristic: NativeCharacteristic, nitroDevice: NitroDevice);
69
+ get id(): number;
70
+ get uuid(): UUID;
71
+ get serviceID(): number;
72
+ get serviceUUID(): UUID;
73
+ get deviceID(): DeviceId;
74
+ get isReadable(): boolean;
75
+ get isWritableWithResponse(): boolean;
76
+ get isWritableWithoutResponse(): boolean;
77
+ get isNotifiable(): boolean;
78
+ get isNotifying(): boolean;
79
+ get isIndicatable(): boolean;
80
+ get value(): Base64 | null;
81
+ read(transactionId?: TransactionId): Promise<CharacteristicWrapper>;
82
+ }
83
+ /**
84
+ * Descriptor wrapper for compatibility
85
+ */
86
+ export declare class DescriptorWrapper {
87
+ private nativeDescriptor;
88
+ private nitroDevice;
89
+ constructor(nativeDescriptor: NativeDescriptor, nitroDevice: NitroDevice);
90
+ get id(): number;
91
+ get uuid(): UUID;
92
+ get characteristicID(): number;
93
+ get characteristicUUID(): UUID;
94
+ get serviceID(): number;
95
+ get serviceUUID(): UUID;
96
+ get deviceID(): DeviceId;
97
+ get value(): Base64 | null;
98
+ read(transactionId?: TransactionId): Promise<DescriptorWrapper>;
99
+ }
100
+ //# sourceMappingURL=deviceWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceWrapper.d.ts","sourceRoot":"","sources":["../../../src/compatibility/deviceWrapper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAEV,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EAEjB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAEhB,YAAY,EACb,MAAM,mBAAmB,CAAC;AAQ3B;;;GAGG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW,GAAG,GAAG;IAGlD,IAAI,EAAE,IAAI,QAAQ,CAEjB;IAGD,IAAI,IAAI,IAAI,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