kard-network-ble-mesh 1.0.0
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.
- package/README.md +216 -0
- package/android/build.gradle +94 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +18 -0
- package/android/src/main/AndroidManifestNew.xml +17 -0
- package/android/src/main/java/com/blemesh/BleMeshModule.kt +1143 -0
- package/android/src/main/java/com/blemesh/BleMeshPackage.kt +16 -0
- package/ios/BleMesh.m +45 -0
- package/ios/BleMesh.swift +1075 -0
- package/kard-network-ble-mesh.podspec +27 -0
- package/lib/commonjs/index.js +241 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +236 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/index.d.ts +103 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +90 -0
- package/src/index.ts +334 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "kard-network-ble-mesh"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => "14.0" }
|
|
14
|
+
s.source = { :git => "https://github.com/anthropics/kard-network-ble-mesh.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
17
|
+
s.swift_version = "5.0"
|
|
18
|
+
|
|
19
|
+
s.dependency "React-Core"
|
|
20
|
+
|
|
21
|
+
s.frameworks = "CoreBluetooth", "Security", "CryptoKit"
|
|
22
|
+
|
|
23
|
+
s.pod_target_xcconfig = {
|
|
24
|
+
'DEFINES_MODULE' => 'YES',
|
|
25
|
+
'SWIFT_OPTIMIZATION_LEVEL' => '-Onone'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.BleMeshService = exports.BleMesh = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const LINKING_ERROR = `The package 'kard-network-ble-mesh' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
9
|
+
ios: "- You have run 'pod install'\n",
|
|
10
|
+
default: ''
|
|
11
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go (this package requires a development build)\n';
|
|
12
|
+
const BleMeshModule = _reactNative.NativeModules.BleMesh ? _reactNative.NativeModules.BleMesh : new Proxy({}, {
|
|
13
|
+
get() {
|
|
14
|
+
throw new Error(LINKING_ERROR);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const eventEmitter = new _reactNative.NativeEventEmitter(BleMeshModule);
|
|
18
|
+
|
|
19
|
+
// Types
|
|
20
|
+
|
|
21
|
+
// Event types
|
|
22
|
+
|
|
23
|
+
// Event listener types
|
|
24
|
+
|
|
25
|
+
class BleMeshService {
|
|
26
|
+
isInitialized = false;
|
|
27
|
+
|
|
28
|
+
// Request all required permissions for BLE mesh networking
|
|
29
|
+
async requestPermissions() {
|
|
30
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
31
|
+
return this.requestAndroidPermissions();
|
|
32
|
+
} else if (_reactNative.Platform.OS === 'ios') {
|
|
33
|
+
return this.requestIOSPermissions();
|
|
34
|
+
}
|
|
35
|
+
throw new Error('Unsupported platform');
|
|
36
|
+
}
|
|
37
|
+
async requestAndroidPermissions() {
|
|
38
|
+
const apiLevel = _reactNative.Platform.Version;
|
|
39
|
+
let permissions = [];
|
|
40
|
+
if (apiLevel >= 31) {
|
|
41
|
+
// Android 12+ (API 31+)
|
|
42
|
+
permissions = [_reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE, _reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT, _reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN, _reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION];
|
|
43
|
+
} else {
|
|
44
|
+
// Android 11 and below
|
|
45
|
+
permissions = [_reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, _reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION];
|
|
46
|
+
}
|
|
47
|
+
const results = await _reactNative.PermissionsAndroid.requestMultiple(permissions);
|
|
48
|
+
const status = {
|
|
49
|
+
bluetooth: true,
|
|
50
|
+
location: results[_reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION] === 'granted'
|
|
51
|
+
};
|
|
52
|
+
if (apiLevel >= 31) {
|
|
53
|
+
status.bluetoothAdvertise = results[_reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE] === 'granted';
|
|
54
|
+
status.bluetoothConnect = results[_reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT] === 'granted';
|
|
55
|
+
status.bluetoothScan = results[_reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN] === 'granted';
|
|
56
|
+
status.bluetooth = status.bluetoothAdvertise && status.bluetoothConnect && status.bluetoothScan;
|
|
57
|
+
}
|
|
58
|
+
return status;
|
|
59
|
+
}
|
|
60
|
+
async requestIOSPermissions() {
|
|
61
|
+
// On iOS, Bluetooth permissions are requested automatically when starting services
|
|
62
|
+
// The native module handles the permission prompts
|
|
63
|
+
const result = await BleMeshModule.requestPermissions();
|
|
64
|
+
return {
|
|
65
|
+
bluetooth: result.bluetooth,
|
|
66
|
+
location: result.location
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Check current permission status without requesting
|
|
71
|
+
async checkPermissions() {
|
|
72
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
73
|
+
return this.checkAndroidPermissions();
|
|
74
|
+
}
|
|
75
|
+
return BleMeshModule.checkPermissions();
|
|
76
|
+
}
|
|
77
|
+
async checkAndroidPermissions() {
|
|
78
|
+
const apiLevel = _reactNative.Platform.Version;
|
|
79
|
+
const fineLocation = await _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
|
|
80
|
+
const status = {
|
|
81
|
+
bluetooth: true,
|
|
82
|
+
location: fineLocation
|
|
83
|
+
};
|
|
84
|
+
if (apiLevel >= 31) {
|
|
85
|
+
const advertise = await _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE);
|
|
86
|
+
const connect = await _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT);
|
|
87
|
+
const scan = await _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN);
|
|
88
|
+
status.bluetoothAdvertise = advertise;
|
|
89
|
+
status.bluetoothConnect = connect;
|
|
90
|
+
status.bluetoothScan = scan;
|
|
91
|
+
status.bluetooth = advertise && connect && scan;
|
|
92
|
+
}
|
|
93
|
+
return status;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Initialize and start the mesh service
|
|
97
|
+
async start(config = {}) {
|
|
98
|
+
const {
|
|
99
|
+
nickname = 'anon',
|
|
100
|
+
autoRequestPermissions = true
|
|
101
|
+
} = config;
|
|
102
|
+
if (autoRequestPermissions) {
|
|
103
|
+
const permissions = await this.requestPermissions();
|
|
104
|
+
const hasAllPermissions = permissions.bluetooth && permissions.location;
|
|
105
|
+
if (!hasAllPermissions) {
|
|
106
|
+
throw new Error('Required permissions not granted. Bluetooth and Location permissions are required.');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
await BleMeshModule.start(nickname);
|
|
110
|
+
this.isInitialized = true;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Stop the mesh service
|
|
114
|
+
async stop() {
|
|
115
|
+
if (!this.isInitialized) return;
|
|
116
|
+
await BleMeshModule.stop();
|
|
117
|
+
this.isInitialized = false;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Set the user's nickname
|
|
121
|
+
async setNickname(nickname) {
|
|
122
|
+
this.ensureInitialized();
|
|
123
|
+
await BleMeshModule.setNickname(nickname);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Get the current peer ID
|
|
127
|
+
async getMyPeerId() {
|
|
128
|
+
this.ensureInitialized();
|
|
129
|
+
return BleMeshModule.getMyPeerId();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Get the current nickname
|
|
133
|
+
async getMyNickname() {
|
|
134
|
+
this.ensureInitialized();
|
|
135
|
+
return BleMeshModule.getMyNickname();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Get list of currently connected peers
|
|
139
|
+
async getPeers() {
|
|
140
|
+
this.ensureInitialized();
|
|
141
|
+
return BleMeshModule.getPeers();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Send a public broadcast message to all peers
|
|
145
|
+
async sendMessage(content, channel) {
|
|
146
|
+
this.ensureInitialized();
|
|
147
|
+
return BleMeshModule.sendMessage(content, channel || null);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Send a private encrypted message to a specific peer
|
|
151
|
+
async sendPrivateMessage(content, recipientPeerId) {
|
|
152
|
+
this.ensureInitialized();
|
|
153
|
+
return BleMeshModule.sendPrivateMessage(content, recipientPeerId);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Send a file (broadcast or private)
|
|
157
|
+
async sendFile(filePath, options) {
|
|
158
|
+
this.ensureInitialized();
|
|
159
|
+
return BleMeshModule.sendFile(filePath, options?.recipientPeerId || null, options?.channel || null);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Send a read receipt for a message
|
|
163
|
+
async sendReadReceipt(messageId, recipientPeerId) {
|
|
164
|
+
this.ensureInitialized();
|
|
165
|
+
await BleMeshModule.sendReadReceipt(messageId, recipientPeerId);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Check if we have an encrypted session with a peer
|
|
169
|
+
async hasEncryptedSession(peerId) {
|
|
170
|
+
this.ensureInitialized();
|
|
171
|
+
return BleMeshModule.hasEncryptedSession(peerId);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Initiate a Noise handshake with a peer
|
|
175
|
+
async initiateHandshake(peerId) {
|
|
176
|
+
this.ensureInitialized();
|
|
177
|
+
await BleMeshModule.initiateHandshake(peerId);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Get the identity fingerprint for verification
|
|
181
|
+
async getIdentityFingerprint() {
|
|
182
|
+
this.ensureInitialized();
|
|
183
|
+
return BleMeshModule.getIdentityFingerprint();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Get peer's fingerprint for verification
|
|
187
|
+
async getPeerFingerprint(peerId) {
|
|
188
|
+
this.ensureInitialized();
|
|
189
|
+
return BleMeshModule.getPeerFingerprint(peerId);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Force a broadcast announce to refresh presence
|
|
193
|
+
async broadcastAnnounce() {
|
|
194
|
+
this.ensureInitialized();
|
|
195
|
+
await BleMeshModule.broadcastAnnounce();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Event listeners
|
|
199
|
+
onPeerListUpdated(callback) {
|
|
200
|
+
const subscription = eventEmitter.addListener('onPeerListUpdated', callback);
|
|
201
|
+
return () => subscription.remove();
|
|
202
|
+
}
|
|
203
|
+
onMessageReceived(callback) {
|
|
204
|
+
const subscription = eventEmitter.addListener('onMessageReceived', callback);
|
|
205
|
+
return () => subscription.remove();
|
|
206
|
+
}
|
|
207
|
+
onFileReceived(callback) {
|
|
208
|
+
const subscription = eventEmitter.addListener('onFileReceived', callback);
|
|
209
|
+
return () => subscription.remove();
|
|
210
|
+
}
|
|
211
|
+
onConnectionStateChanged(callback) {
|
|
212
|
+
const subscription = eventEmitter.addListener('onConnectionStateChanged', callback);
|
|
213
|
+
return () => subscription.remove();
|
|
214
|
+
}
|
|
215
|
+
onReadReceipt(callback) {
|
|
216
|
+
const subscription = eventEmitter.addListener('onReadReceipt', callback);
|
|
217
|
+
return () => subscription.remove();
|
|
218
|
+
}
|
|
219
|
+
onDeliveryAck(callback) {
|
|
220
|
+
const subscription = eventEmitter.addListener('onDeliveryAck', callback);
|
|
221
|
+
return () => subscription.remove();
|
|
222
|
+
}
|
|
223
|
+
onError(callback) {
|
|
224
|
+
const subscription = eventEmitter.addListener('onError', callback);
|
|
225
|
+
return () => subscription.remove();
|
|
226
|
+
}
|
|
227
|
+
ensureInitialized() {
|
|
228
|
+
if (!this.isInitialized) {
|
|
229
|
+
throw new Error('BleMesh service not initialized. Call start() first.');
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Export singleton instance
|
|
235
|
+
exports.BleMeshService = BleMeshService;
|
|
236
|
+
const BleMesh = exports.BleMesh = new BleMeshService();
|
|
237
|
+
|
|
238
|
+
// Also export the class for those who want multiple instances
|
|
239
|
+
// Default export
|
|
240
|
+
var _default = exports.default = BleMesh;
|
|
241
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","BleMeshModule","NativeModules","BleMesh","Proxy","get","Error","eventEmitter","NativeEventEmitter","BleMeshService","isInitialized","requestPermissions","OS","requestAndroidPermissions","requestIOSPermissions","apiLevel","Version","permissions","PermissionsAndroid","PERMISSIONS","BLUETOOTH_ADVERTISE","BLUETOOTH_CONNECT","BLUETOOTH_SCAN","ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION","results","requestMultiple","status","bluetooth","location","bluetoothAdvertise","bluetoothConnect","bluetoothScan","result","checkPermissions","checkAndroidPermissions","fineLocation","check","advertise","connect","scan","start","config","nickname","autoRequestPermissions","hasAllPermissions","stop","setNickname","ensureInitialized","getMyPeerId","getMyNickname","getPeers","sendMessage","content","channel","sendPrivateMessage","recipientPeerId","sendFile","filePath","options","sendReadReceipt","messageId","hasEncryptedSession","peerId","initiateHandshake","getIdentityFingerprint","getPeerFingerprint","broadcastAnnounce","onPeerListUpdated","callback","subscription","addListener","remove","onMessageReceived","onFileReceived","onConnectionStateChanged","onReadReceipt","onDeliveryAck","onError","exports","_default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,gFAAgF,GAChFC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,2EAA2E;AAE7E,MAAMC,aAAa,GAAGC,0BAAa,CAACC,OAAO,GACvCD,0BAAa,CAACC,OAAO,GACrB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMW,YAAY,GAAG,IAAIC,+BAAkB,CAACP,aAAa,CAAC;;AAE1D;;AA6CA;;AAQA;;AAGA,MAAMQ,cAAc,CAAC;EACXC,aAAa,GAAG,KAAK;;EAE7B;EACA,MAAMC,kBAAkBA,CAAA,EAA8B;IACpD,IAAId,qBAAQ,CAACe,EAAE,KAAK,SAAS,EAAE;MAC7B,OAAO,IAAI,CAACC,yBAAyB,CAAC,CAAC;IACzC,CAAC,MAAM,IAAIhB,qBAAQ,CAACe,EAAE,KAAK,KAAK,EAAE;MAChC,OAAO,IAAI,CAACE,qBA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AY,GAAG/D,YAAY,CAACgE,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;IACxE,OAAO,MAAMC,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC;EAEAM,OAAOA,CAACT,QAAmC,EAAc;IACvD,MAAMC,YAAY,GAAG/D,YAAY,CAACgE,WAAW,CAAC,SAAS,EAAEF,QAAQ,CAAC;IAClE,OAAO,MAAMC,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC;EAEQxB,iBAAiBA,CAAA,EAAS;IAChC,IAAI,CAAC,IAAI,CAACtC,aAAa,EAAE;MACvB,MAAM,IAAIJ,KAAK,CAAC,sDAAsD,CAAC;IACzE;EACF;AACF;;AAEA;AAAAyE,OAAA,CAAAtE,cAAA,GAAAA,cAAA;AACO,MAAMN,OAAO,GAAA4E,OAAA,CAAA5E,OAAA,GAAG,IAAIM,cAAc,CAAC,CAAC;;AAE3C;AAGA;AAAA,IAAAuE,QAAA,GAAAD,OAAA,CAAA/E,OAAA,GACeG,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { NativeModules, NativeEventEmitter, Platform, PermissionsAndroid } from 'react-native';
|
|
2
|
+
const LINKING_ERROR = `The package 'kard-network-ble-mesh' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
3
|
+
ios: "- You have run 'pod install'\n",
|
|
4
|
+
default: ''
|
|
5
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go (this package requires a development build)\n';
|
|
6
|
+
const BleMeshModule = NativeModules.BleMesh ? NativeModules.BleMesh : new Proxy({}, {
|
|
7
|
+
get() {
|
|
8
|
+
throw new Error(LINKING_ERROR);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const eventEmitter = new NativeEventEmitter(BleMeshModule);
|
|
12
|
+
|
|
13
|
+
// Types
|
|
14
|
+
|
|
15
|
+
// Event types
|
|
16
|
+
|
|
17
|
+
// Event listener types
|
|
18
|
+
|
|
19
|
+
class BleMeshService {
|
|
20
|
+
isInitialized = false;
|
|
21
|
+
|
|
22
|
+
// Request all required permissions for BLE mesh networking
|
|
23
|
+
async requestPermissions() {
|
|
24
|
+
if (Platform.OS === 'android') {
|
|
25
|
+
return this.requestAndroidPermissions();
|
|
26
|
+
} else if (Platform.OS === 'ios') {
|
|
27
|
+
return this.requestIOSPermissions();
|
|
28
|
+
}
|
|
29
|
+
throw new Error('Unsupported platform');
|
|
30
|
+
}
|
|
31
|
+
async requestAndroidPermissions() {
|
|
32
|
+
const apiLevel = Platform.Version;
|
|
33
|
+
let permissions = [];
|
|
34
|
+
if (apiLevel >= 31) {
|
|
35
|
+
// Android 12+ (API 31+)
|
|
36
|
+
permissions = [PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE, PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT, PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN, PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION];
|
|
37
|
+
} else {
|
|
38
|
+
// Android 11 and below
|
|
39
|
+
permissions = [PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION];
|
|
40
|
+
}
|
|
41
|
+
const results = await PermissionsAndroid.requestMultiple(permissions);
|
|
42
|
+
const status = {
|
|
43
|
+
bluetooth: true,
|
|
44
|
+
location: results[PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION] === 'granted'
|
|
45
|
+
};
|
|
46
|
+
if (apiLevel >= 31) {
|
|
47
|
+
status.bluetoothAdvertise = results[PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE] === 'granted';
|
|
48
|
+
status.bluetoothConnect = results[PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT] === 'granted';
|
|
49
|
+
status.bluetoothScan = results[PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN] === 'granted';
|
|
50
|
+
status.bluetooth = status.bluetoothAdvertise && status.bluetoothConnect && status.bluetoothScan;
|
|
51
|
+
}
|
|
52
|
+
return status;
|
|
53
|
+
}
|
|
54
|
+
async requestIOSPermissions() {
|
|
55
|
+
// On iOS, Bluetooth permissions are requested automatically when starting services
|
|
56
|
+
// The native module handles the permission prompts
|
|
57
|
+
const result = await BleMeshModule.requestPermissions();
|
|
58
|
+
return {
|
|
59
|
+
bluetooth: result.bluetooth,
|
|
60
|
+
location: result.location
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Check current permission status without requesting
|
|
65
|
+
async checkPermissions() {
|
|
66
|
+
if (Platform.OS === 'android') {
|
|
67
|
+
return this.checkAndroidPermissions();
|
|
68
|
+
}
|
|
69
|
+
return BleMeshModule.checkPermissions();
|
|
70
|
+
}
|
|
71
|
+
async checkAndroidPermissions() {
|
|
72
|
+
const apiLevel = Platform.Version;
|
|
73
|
+
const fineLocation = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
|
|
74
|
+
const status = {
|
|
75
|
+
bluetooth: true,
|
|
76
|
+
location: fineLocation
|
|
77
|
+
};
|
|
78
|
+
if (apiLevel >= 31) {
|
|
79
|
+
const advertise = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE);
|
|
80
|
+
const connect = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT);
|
|
81
|
+
const scan = await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN);
|
|
82
|
+
status.bluetoothAdvertise = advertise;
|
|
83
|
+
status.bluetoothConnect = connect;
|
|
84
|
+
status.bluetoothScan = scan;
|
|
85
|
+
status.bluetooth = advertise && connect && scan;
|
|
86
|
+
}
|
|
87
|
+
return status;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Initialize and start the mesh service
|
|
91
|
+
async start(config = {}) {
|
|
92
|
+
const {
|
|
93
|
+
nickname = 'anon',
|
|
94
|
+
autoRequestPermissions = true
|
|
95
|
+
} = config;
|
|
96
|
+
if (autoRequestPermissions) {
|
|
97
|
+
const permissions = await this.requestPermissions();
|
|
98
|
+
const hasAllPermissions = permissions.bluetooth && permissions.location;
|
|
99
|
+
if (!hasAllPermissions) {
|
|
100
|
+
throw new Error('Required permissions not granted. Bluetooth and Location permissions are required.');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
await BleMeshModule.start(nickname);
|
|
104
|
+
this.isInitialized = true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Stop the mesh service
|
|
108
|
+
async stop() {
|
|
109
|
+
if (!this.isInitialized) return;
|
|
110
|
+
await BleMeshModule.stop();
|
|
111
|
+
this.isInitialized = false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Set the user's nickname
|
|
115
|
+
async setNickname(nickname) {
|
|
116
|
+
this.ensureInitialized();
|
|
117
|
+
await BleMeshModule.setNickname(nickname);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Get the current peer ID
|
|
121
|
+
async getMyPeerId() {
|
|
122
|
+
this.ensureInitialized();
|
|
123
|
+
return BleMeshModule.getMyPeerId();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Get the current nickname
|
|
127
|
+
async getMyNickname() {
|
|
128
|
+
this.ensureInitialized();
|
|
129
|
+
return BleMeshModule.getMyNickname();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Get list of currently connected peers
|
|
133
|
+
async getPeers() {
|
|
134
|
+
this.ensureInitialized();
|
|
135
|
+
return BleMeshModule.getPeers();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Send a public broadcast message to all peers
|
|
139
|
+
async sendMessage(content, channel) {
|
|
140
|
+
this.ensureInitialized();
|
|
141
|
+
return BleMeshModule.sendMessage(content, channel || null);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Send a private encrypted message to a specific peer
|
|
145
|
+
async sendPrivateMessage(content, recipientPeerId) {
|
|
146
|
+
this.ensureInitialized();
|
|
147
|
+
return BleMeshModule.sendPrivateMessage(content, recipientPeerId);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Send a file (broadcast or private)
|
|
151
|
+
async sendFile(filePath, options) {
|
|
152
|
+
this.ensureInitialized();
|
|
153
|
+
return BleMeshModule.sendFile(filePath, options?.recipientPeerId || null, options?.channel || null);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Send a read receipt for a message
|
|
157
|
+
async sendReadReceipt(messageId, recipientPeerId) {
|
|
158
|
+
this.ensureInitialized();
|
|
159
|
+
await BleMeshModule.sendReadReceipt(messageId, recipientPeerId);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Check if we have an encrypted session with a peer
|
|
163
|
+
async hasEncryptedSession(peerId) {
|
|
164
|
+
this.ensureInitialized();
|
|
165
|
+
return BleMeshModule.hasEncryptedSession(peerId);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Initiate a Noise handshake with a peer
|
|
169
|
+
async initiateHandshake(peerId) {
|
|
170
|
+
this.ensureInitialized();
|
|
171
|
+
await BleMeshModule.initiateHandshake(peerId);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Get the identity fingerprint for verification
|
|
175
|
+
async getIdentityFingerprint() {
|
|
176
|
+
this.ensureInitialized();
|
|
177
|
+
return BleMeshModule.getIdentityFingerprint();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Get peer's fingerprint for verification
|
|
181
|
+
async getPeerFingerprint(peerId) {
|
|
182
|
+
this.ensureInitialized();
|
|
183
|
+
return BleMeshModule.getPeerFingerprint(peerId);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Force a broadcast announce to refresh presence
|
|
187
|
+
async broadcastAnnounce() {
|
|
188
|
+
this.ensureInitialized();
|
|
189
|
+
await BleMeshModule.broadcastAnnounce();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Event listeners
|
|
193
|
+
onPeerListUpdated(callback) {
|
|
194
|
+
const subscription = eventEmitter.addListener('onPeerListUpdated', callback);
|
|
195
|
+
return () => subscription.remove();
|
|
196
|
+
}
|
|
197
|
+
onMessageReceived(callback) {
|
|
198
|
+
const subscription = eventEmitter.addListener('onMessageReceived', callback);
|
|
199
|
+
return () => subscription.remove();
|
|
200
|
+
}
|
|
201
|
+
onFileReceived(callback) {
|
|
202
|
+
const subscription = eventEmitter.addListener('onFileReceived', callback);
|
|
203
|
+
return () => subscription.remove();
|
|
204
|
+
}
|
|
205
|
+
onConnectionStateChanged(callback) {
|
|
206
|
+
const subscription = eventEmitter.addListener('onConnectionStateChanged', callback);
|
|
207
|
+
return () => subscription.remove();
|
|
208
|
+
}
|
|
209
|
+
onReadReceipt(callback) {
|
|
210
|
+
const subscription = eventEmitter.addListener('onReadReceipt', callback);
|
|
211
|
+
return () => subscription.remove();
|
|
212
|
+
}
|
|
213
|
+
onDeliveryAck(callback) {
|
|
214
|
+
const subscription = eventEmitter.addListener('onDeliveryAck', callback);
|
|
215
|
+
return () => subscription.remove();
|
|
216
|
+
}
|
|
217
|
+
onError(callback) {
|
|
218
|
+
const subscription = eventEmitter.addListener('onError', callback);
|
|
219
|
+
return () => subscription.remove();
|
|
220
|
+
}
|
|
221
|
+
ensureInitialized() {
|
|
222
|
+
if (!this.isInitialized) {
|
|
223
|
+
throw new Error('BleMesh service not initialized. Call start() first.');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Export singleton instance
|
|
229
|
+
export const BleMesh = new BleMeshService();
|
|
230
|
+
|
|
231
|
+
// Also export the class for those who want multiple instances
|
|
232
|
+
export { BleMeshService };
|
|
233
|
+
|
|
234
|
+
// Default export
|
|
235
|
+
export default BleMesh;
|
|
236
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","NativeEventEmitter","Platform","PermissionsAndroid","LINKING_ERROR","select","ios","default","BleMeshModule","BleMesh","Proxy","get","Error","eventEmitter","BleMeshService","isInitialized","requestPermissions","OS","requestAndroidPermissions","requestIOSPermissions","apiLevel","Version","permissions","PERMISSIONS","BLUETOOTH_ADVERTISE","BLUETOOTH_CONNECT","BLUETOOTH_SCAN","ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION","results","requestMultiple","status","bluetooth","location","bluetoothAdvertise","bluetoothConnect","bluetoothScan","result","checkPermissions","checkAndroidPermissions","fineLocation","check","advertise","connect","scan","start","config","nickname","autoRequestPermissions","hasAllPermissions","stop","setNickname","ensureInitialized","getMyPeerId","getMyNickname","getPeers","sendMessage","content","channel","sendPrivateMessage","recipientPeerId","sendFile","filePath","options","sendReadReceipt","messageId","hasEncryptedSession","peerId","initiateHandshake","getIdentityFingerprint","getPeerFingerprint","broadcastAnnounce","onPeerListUpdated","callback","subscription","addListener","remove","onMessageReceived","onFileReceived","onConnectionStateChanged","onReadReceipt","onDeliveryAck","onError"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,EAAEC,QAAQ,EAAEC,kBAAkB,QAAoB,cAAc;AAE1G,MAAMC,aAAa,GACjB,gFAAgF,GAChFF,QAAQ,CAACG,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,2EAA2E;AAE7E,MAAMC,aAAa,GAAGR,aAAa,CAACS,OAAO,GACvCT,aAAa,CAACS,OAAO,GACrB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMS,YAAY,GAAG,IAAIZ,kBAAkB,CAACO,aAAa,CAAC;;AAE1D;;AA6CA;;AAQA;;AAGA,MAAMM,cAAc,CAAC;EACXC,aAAa,GAAG,KA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CAAC;IACnF,OAAO,MAAMC,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC;EAEAI,aAAaA,CAACP,QAAkE,EAAc;IAC5F,MAAMC,YAAY,GAAG7D,YAAY,CAAC8D,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;IACxE,OAAO,MAAMC,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC;EAEAK,aAAaA,CAACR,QAAkE,EAAc;IAC5F,MAAMC,YAAY,GAAG7D,YAAY,CAAC8D,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;IACxE,OAAO,MAAMC,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC;EAEAM,OAAOA,CAACT,QAAmC,EAAc;IACvD,MAAMC,YAAY,GAAG7D,YAAY,CAAC8D,WAAW,CAAC,SAAS,EAAEF,QAAQ,CAAC;IAClE,OAAO,MAAMC,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC;EAEQxB,iBAAiBA,CAAA,EAAS;IAChC,IAAI,CAAC,IAAI,CAACrC,aAAa,EAAE;MACvB,MAAM,IAAIH,KAAK,CAAC,sDAAsD,CAAC;IACzE;EACF;AACF;;AAEA;AACA,OAAO,MAAMH,OAAO,GAAG,IAAIK,cAAc,CAAC,CAAC;;AAE3C;AACA,SAASA,cAAc;;AAEvB;AACA,eAAeL,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export interface Peer {
|
|
2
|
+
peerId: string;
|
|
3
|
+
nickname: string;
|
|
4
|
+
isConnected: boolean;
|
|
5
|
+
rssi?: number;
|
|
6
|
+
lastSeen: number;
|
|
7
|
+
isVerified: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface Message {
|
|
10
|
+
id: string;
|
|
11
|
+
content: string;
|
|
12
|
+
senderPeerId: string;
|
|
13
|
+
senderNickname: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
isPrivate: boolean;
|
|
16
|
+
channel?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface FileTransfer {
|
|
19
|
+
id: string;
|
|
20
|
+
fileName: string;
|
|
21
|
+
fileSize: number;
|
|
22
|
+
mimeType: string;
|
|
23
|
+
data: string;
|
|
24
|
+
senderPeerId: string;
|
|
25
|
+
timestamp: number;
|
|
26
|
+
}
|
|
27
|
+
export interface PermissionStatus {
|
|
28
|
+
bluetooth: boolean;
|
|
29
|
+
bluetoothAdvertise?: boolean;
|
|
30
|
+
bluetoothConnect?: boolean;
|
|
31
|
+
bluetoothScan?: boolean;
|
|
32
|
+
location: boolean;
|
|
33
|
+
}
|
|
34
|
+
export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'scanning';
|
|
35
|
+
export interface MeshServiceConfig {
|
|
36
|
+
nickname?: string;
|
|
37
|
+
autoRequestPermissions?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type PeerListUpdatedEvent = {
|
|
40
|
+
peers: Peer[];
|
|
41
|
+
};
|
|
42
|
+
export type MessageReceivedEvent = {
|
|
43
|
+
message: Message;
|
|
44
|
+
};
|
|
45
|
+
export type FileReceivedEvent = {
|
|
46
|
+
file: FileTransfer;
|
|
47
|
+
};
|
|
48
|
+
export type ConnectionStateChangedEvent = {
|
|
49
|
+
state: ConnectionState;
|
|
50
|
+
peerCount: number;
|
|
51
|
+
};
|
|
52
|
+
export type PermissionsChangedEvent = {
|
|
53
|
+
permissions: PermissionStatus;
|
|
54
|
+
};
|
|
55
|
+
export type ErrorEvent = {
|
|
56
|
+
code: string;
|
|
57
|
+
message: string;
|
|
58
|
+
};
|
|
59
|
+
type EventCallback<T> = (data: T) => void;
|
|
60
|
+
declare class BleMeshService {
|
|
61
|
+
private isInitialized;
|
|
62
|
+
requestPermissions(): Promise<PermissionStatus>;
|
|
63
|
+
private requestAndroidPermissions;
|
|
64
|
+
private requestIOSPermissions;
|
|
65
|
+
checkPermissions(): Promise<PermissionStatus>;
|
|
66
|
+
private checkAndroidPermissions;
|
|
67
|
+
start(config?: MeshServiceConfig): Promise<void>;
|
|
68
|
+
stop(): Promise<void>;
|
|
69
|
+
setNickname(nickname: string): Promise<void>;
|
|
70
|
+
getMyPeerId(): Promise<string>;
|
|
71
|
+
getMyNickname(): Promise<string>;
|
|
72
|
+
getPeers(): Promise<Peer[]>;
|
|
73
|
+
sendMessage(content: string, channel?: string): Promise<string>;
|
|
74
|
+
sendPrivateMessage(content: string, recipientPeerId: string): Promise<string>;
|
|
75
|
+
sendFile(filePath: string, options?: {
|
|
76
|
+
recipientPeerId?: string;
|
|
77
|
+
channel?: string;
|
|
78
|
+
}): Promise<string>;
|
|
79
|
+
sendReadReceipt(messageId: string, recipientPeerId: string): Promise<void>;
|
|
80
|
+
hasEncryptedSession(peerId: string): Promise<boolean>;
|
|
81
|
+
initiateHandshake(peerId: string): Promise<void>;
|
|
82
|
+
getIdentityFingerprint(): Promise<string>;
|
|
83
|
+
getPeerFingerprint(peerId: string): Promise<string | null>;
|
|
84
|
+
broadcastAnnounce(): Promise<void>;
|
|
85
|
+
onPeerListUpdated(callback: EventCallback<PeerListUpdatedEvent>): () => void;
|
|
86
|
+
onMessageReceived(callback: EventCallback<MessageReceivedEvent>): () => void;
|
|
87
|
+
onFileReceived(callback: EventCallback<FileReceivedEvent>): () => void;
|
|
88
|
+
onConnectionStateChanged(callback: EventCallback<ConnectionStateChangedEvent>): () => void;
|
|
89
|
+
onReadReceipt(callback: EventCallback<{
|
|
90
|
+
messageId: string;
|
|
91
|
+
fromPeerId: string;
|
|
92
|
+
}>): () => void;
|
|
93
|
+
onDeliveryAck(callback: EventCallback<{
|
|
94
|
+
messageId: string;
|
|
95
|
+
fromPeerId: string;
|
|
96
|
+
}>): () => void;
|
|
97
|
+
onError(callback: EventCallback<ErrorEvent>): () => void;
|
|
98
|
+
private ensureInitialized;
|
|
99
|
+
}
|
|
100
|
+
export declare const BleMesh: BleMeshService;
|
|
101
|
+
export { BleMeshService };
|
|
102
|
+
export default BleMesh;
|
|
103
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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