@stoprocent/bleno 0.7.6 → 0.8.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.
@@ -21,7 +21,7 @@
21
21
 
22
22
  - (instancetype)init {
23
23
  if (self = [super init]) {
24
- NSLog(@"-[BLEPeripheralManager init]");
24
+ // NSLog(@"-[BLEPeripheralManager init]");
25
25
 
26
26
  self.queue = dispatch_queue_create("CBqueue", 0);
27
27
  }
@@ -36,7 +36,7 @@
36
36
  }
37
37
 
38
38
  - (void)startAdvertising:(nonnull NSString *)name serviceUUIDs:(nonnull NSArray<CBUUID *> *)serviceUUIDs {
39
- NSLog(@"startAdvertising:%@ serviceUUIDs:%@", name, serviceUUIDs);
39
+ // NSLog(@"startAdvertising:%@ serviceUUIDs:%@", name, serviceUUIDs);
40
40
  if (self.peripheralManager.isAdvertising) {
41
41
  return;
42
42
  }
@@ -48,11 +48,11 @@
48
48
  }
49
49
 
50
50
  - (void)startAdvertisingIBeacon:(NSData *)data {
51
- NSLog(@"startAdvertisingIBeacon:%@", data);
51
+ // NSLog(@"startAdvertisingIBeacon:%@", data);
52
52
  }
53
53
 
54
54
  - (void)startAdvertisingWithEIRData:(NSData *)data {
55
- NSLog(@"startAdvertisingWithEIRData:%@", data);
55
+ // NSLog(@"startAdvertisingWithEIRData:%@", data);
56
56
 
57
57
  if (self.peripheralManager.isAdvertising) {
58
58
  return;
@@ -60,7 +60,7 @@
60
60
  }
61
61
 
62
62
  - (void)stopAdvertising {
63
- NSLog(@"stopAdvertising");
63
+ // NSLog(@"stopAdvertising");
64
64
 
65
65
  [self.peripheralManager stopAdvertising];
66
66
  }
@@ -72,13 +72,13 @@
72
72
  }
73
73
 
74
74
  - (void)disconnect {
75
- NSLog(@"disconnect");
75
+ // NSLog(@"disconnect");
76
76
 
77
77
  // throw new Error('disconnect is not supported on OS X!');
78
78
  }
79
79
 
80
80
  - (void)updateRssi {
81
- NSLog(@"updateRssi");
81
+ // NSLog(@"updateRssi");
82
82
  }
83
83
 
84
84
  #pragma mark - CBPeripheralManagerDelegate
@@ -111,36 +111,36 @@
111
111
  break;
112
112
  }
113
113
 
114
- NSLog(@"%@", string);
114
+ // NSLog(@"%@", string);
115
115
 
116
116
  auto state = StringFromCBPeripheralState(peripheral.state);
117
117
  emit.StateChange(state);
118
118
  }
119
119
 
120
120
  - (void)peripheralManager:(CBPeripheralManager *)peripheral willRestoreState:(NSDictionary<NSString *, id> *)dict {
121
- NSLog(@"willRestoreState");
121
+ // NSLog(@"willRestoreState");
122
122
  }
123
123
 
124
124
  - (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral error:(nullable NSError *)error {
125
- NSLog(@"peripheralManagerDidStartAdvertising: %@", peripheral.description);
125
+ // NSLog(@"peripheralManagerDidStartAdvertising: %@", peripheral.description);
126
126
  if (error) {
127
- NSLog(@"Error advertising: %@", [error localizedDescription]);
127
+ // NSLog(@"Error advertising: %@", [error localizedDescription]);
128
128
  }
129
129
 
130
130
  emit.AdvertisingStart();
131
131
  }
132
132
 
133
133
  - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(nullable NSError *)error {
134
- NSLog(@"peripheralManagerDidAddService: %@ %@", service, error);
134
+ // NSLog(@"peripheralManagerDidAddService: %@ %@", service, error);
135
135
  if (error) {
136
- NSLog(@"Error publishing service: %@", [error localizedDescription]);
136
+ // NSLog(@"Error publishing service: %@", [error localizedDescription]);
137
137
  }
138
138
 
139
139
  emit.ServicesSet();
140
140
  }
141
141
 
142
142
  - (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didSubscribeToCharacteristic:(CBMutableCharacteristic *)characteristic {
143
- NSLog(@"didSubscribeToCharacteristic");
143
+ // NSLog(@"didSubscribeToCharacteristic");
144
144
 
145
145
  CBUUID *uuid = characteristic.UUID;
146
146
 
@@ -164,7 +164,7 @@
164
164
  }
165
165
 
166
166
  - (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didUnsubscribeFromCharacteristic:(CBCharacteristic *)characteristic {
167
- NSLog(@"didUnsubscribeFromCharacteristic");
167
+ // NSLog(@"didUnsubscribeFromCharacteristic");
168
168
 
169
169
  CBUUID *uuid = characteristic.UUID;
170
170
 
@@ -176,7 +176,7 @@
176
176
  }
177
177
 
178
178
  - (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveReadRequest:(CBATTRequest *)request {
179
- NSLog(@"didReceiveReadRequest: %@ %@", request.central, request.characteristic.UUID);
179
+ // NSLog(@"didReceiveReadRequest: %@ %@", request.central, request.characteristic.UUID);
180
180
 
181
181
  CBCharacteristic *characteristic = request.characteristic;
182
182
  CBUUID *uuid = characteristic.UUID;
@@ -197,7 +197,7 @@
197
197
 
198
198
  - (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveWriteRequests:(NSArray<CBATTRequest *> *)requests {
199
199
  for (CBATTRequest *request in requests) {
200
- NSLog(@"didReceiveWriteRequest: %@ %@", request.central, request.characteristic.UUID);
200
+ // NSLog(@"didReceiveWriteRequest: %@ %@", request.central, request.characteristic.UUID);
201
201
 
202
202
  CBCharacteristic *characteristic = request.characteristic;
203
203
  CBUUID *uuid = characteristic.UUID;
@@ -223,19 +223,19 @@
223
223
  }
224
224
 
225
225
  - (void)peripheralManagerIsReadyToUpdateSubscribers:(CBPeripheralManager *)peripheral {
226
- NSLog(@"peripheralManagerIsReadyToUpdateSubscribers");
226
+ // NSLog(@"peripheralManagerIsReadyToUpdateSubscribers");
227
227
  }
228
228
 
229
229
  - (void)peripheralManager:(CBPeripheralManager *)peripheral didPublishL2CAPChannel:(CBL2CAPPSM)PSM error:(nullable NSError *)error {
230
- NSLog(@"didPublishL2CAPChannel");
230
+ // NSLog(@"didPublishL2CAPChannel");
231
231
  }
232
232
 
233
233
  - (void)peripheralManager:(CBPeripheralManager *)peripheral didUnpublishL2CAPChannel:(CBL2CAPPSM)PSM error:(nullable NSError *)error {
234
- NSLog(@"didUnpublishL2CAPChannel");
234
+ // NSLog(@"didUnpublishL2CAPChannel");
235
235
  }
236
236
 
237
237
  - (void)peripheralManager:(CBPeripheralManager *)peripheral didOpenL2CAPChannel:(nullable CBL2CAPChannel *)channel error:(nullable NSError *)error {
238
- NSLog(@"didOpenL2CAPChannel");
238
+ // NSLog(@"didOpenL2CAPChannel");
239
239
  }
240
240
 
241
241
  @end
@@ -46,7 +46,7 @@ BlenoMac::BlenoMac(const Napi::CallbackInfo& info) : ObjectWrap(info) {
46
46
  }
47
47
 
48
48
  Napi::Value BlenoMac::Init(const Napi::CallbackInfo& info) {
49
- NSLog(@"BlenoMac::Init");
49
+ // NSLog(@"BlenoMac::Init");
50
50
 
51
51
  Napi::Function emit = info.This().As<Napi::Object>().Get("emit").As<Napi::Function>();
52
52
  peripheralManager = [BLEPeripheralManager new];
@@ -64,7 +64,7 @@ Napi::Value BlenoMac::CleanUp(const Napi::CallbackInfo& info) {
64
64
 
65
65
  // startAdvertising(name, undashedServiceUuids)
66
66
  Napi::Value BlenoMac::StartAdvertising(const Napi::CallbackInfo& info) {
67
- NSLog(@"BlenoMac::StartAdvertising");
67
+ // NSLog(@"BlenoMac::StartAdvertising");
68
68
 
69
69
  CHECK_MANAGER();
70
70
  ARG2(String, Array);
@@ -80,28 +80,28 @@ Napi::Value BlenoMac::StartAdvertising(const Napi::CallbackInfo& info) {
80
80
 
81
81
  // startAdvertisingIBeacon(iBeaconData)
82
82
  Napi::Value BlenoMac::StartAdvertisingIBeacon(const Napi::CallbackInfo& info) {
83
- NSLog(@"BlenoMac::StartAdvertisingIBeacon");
83
+ // NSLog(@"BlenoMac::StartAdvertisingIBeacon");
84
84
 
85
85
  return Napi::Value();
86
86
  }
87
87
 
88
88
  // startAdvertisingWithEIRData(advertisementData, scanData)
89
89
  Napi::Value BlenoMac::StartAdvertisingWithEIRData(const Napi::CallbackInfo& info) {
90
- NSLog(@"BlenoMac::StartAdvertisingWithEIRData");
90
+ // NSLog(@"BlenoMac::StartAdvertisingWithEIRData");
91
91
 
92
92
  return Napi::Value();
93
93
  }
94
94
 
95
95
  // stopAdvertising()
96
96
  Napi::Value BlenoMac::StopAdvertising(const Napi::CallbackInfo& info) {
97
- NSLog(@"BlenoMac::StopAdvertising");
97
+ // NSLog(@"BlenoMac::StopAdvertising");
98
98
 
99
99
  return Napi::Value();
100
100
  }
101
101
 
102
102
  // setServices(services)
103
103
  Napi::Value BlenoMac::SetServices(const Napi::CallbackInfo& info) {
104
- NSLog(@"BlenoMac::SetServices");
104
+ // NSLog(@"BlenoMac::SetServices");
105
105
 
106
106
  CHECK_MANAGER();
107
107
  ARG1(Array);
@@ -131,14 +131,14 @@ Napi::Value BlenoMac::SetServices(const Napi::CallbackInfo& info) {
131
131
 
132
132
  // disconnect()
133
133
  Napi::Value BlenoMac::Disconnect(const Napi::CallbackInfo& info) {
134
- NSLog(@"BlenoMac::Disconnect");
134
+ // NSLog(@"BlenoMac::Disconnect");
135
135
 
136
136
  return Napi::Value();
137
137
  }
138
138
 
139
139
  // updateRssi()
140
140
  Napi::Value BlenoMac::UpdateRssi(const Napi::CallbackInfo& info) {
141
- NSLog(@"BlenoMac::UpdateRssi");
141
+ // NSLog(@"BlenoMac::UpdateRssi");
142
142
 
143
143
  return Napi::Value();
144
144
  }
@@ -41,7 +41,7 @@ NSNumber* napiToNumber(Napi::Number number) {
41
41
  }
42
42
 
43
43
  NSArray<CBMutableService *> *napiArrayToCBMutableServices(Napi::Array array) {
44
- NSLog(@"napiArrayToCBMutableServices");
44
+ // NSLog(@"napiArrayToCBMutableServices");
45
45
 
46
46
  NSMutableArray *services = [NSMutableArray array];
47
47
 
@@ -56,11 +56,11 @@ NSArray<CBMutableService *> *napiArrayToCBMutableServices(Napi::Array array) {
56
56
  }
57
57
 
58
58
  CBMutableService *napiToCBMutableService(Napi::Object obj) {
59
- NSLog(@"napiToCBMutableService");
59
+ // NSLog(@"napiToCBMutableService");
60
60
 
61
61
  NSString *uuid = napiToUuidString(obj.Get("uuid").ToString());
62
62
 
63
- NSLog(@"napiArrayToCBMutableService: uuid:%@", uuid);
63
+ // NSLog(@"napiArrayToCBMutableService: uuid:%@", uuid);
64
64
 
65
65
  CBMutableService *service = [[CBMutableService alloc] initWithType:[CBUUID UUIDWithString:uuid]
66
66
  primary:YES];
@@ -73,7 +73,7 @@ CBMutableService *napiToCBMutableService(Napi::Object obj) {
73
73
 
74
74
 
75
75
  NSArray<CBMutableCharacteristic *> *napiArrayToCBMutableCharacteristics(Napi::Array array) {
76
- NSLog(@"napiArrayToCBMutableCharacteristics");
76
+ // NSLog(@"napiArrayToCBMutableCharacteristics");
77
77
 
78
78
  NSMutableArray *characteristics = [NSMutableArray array];
79
79
 
@@ -88,13 +88,13 @@ NSArray<CBMutableCharacteristic *> *napiArrayToCBMutableCharacteristics(Napi::Ar
88
88
  }
89
89
 
90
90
  CBMutableCharacteristic *napiToCBMutableCharacteristic(Napi::Object obj) {
91
- NSLog(@"napiToCBMutableCharacteristic");
91
+ // NSLog(@"napiToCBMutableCharacteristic");
92
92
 
93
93
  NSString *uuid = napiToUuidString(obj.Get("uuid").ToString());
94
- NSLog(@"napiToCBMutableCharacteristic: cUUID:%@", uuid);
94
+ // NSLog(@"napiToCBMutableCharacteristic: cUUID:%@", uuid);
95
95
 
96
96
  NSData *value = obj.Get("value").IsBuffer() ? napiToData(obj.Get("value").As<Napi::Buffer<Byte>>()) : nil;
97
- NSLog(@"napiToCBMutableCharacteristic: value:%@", value);
97
+ // NSLog(@"napiToCBMutableCharacteristic: value:%@", value);
98
98
 
99
99
  auto properties = obj.Get("properties").As<Napi::Array>();
100
100
  auto secure = obj.Get("secure").As<Napi::Array>();
@@ -112,7 +112,7 @@ CBMutableCharacteristic *napiToCBMutableCharacteristic(Napi::Object obj) {
112
112
  }
113
113
 
114
114
  CBCharacteristicProperties napiToCBCharacteristicProperties(Napi::Array properties, Napi::Array secure) {
115
- NSLog(@"napiToCBCharacteristicProperties");
115
+ // NSLog(@"napiToCBCharacteristicProperties");
116
116
 
117
117
  NSArray<NSString *> *p = napiToStringArray(properties);
118
118
  NSArray<NSString *> *s = napiToStringArray(secure);
@@ -151,7 +151,7 @@ CBCharacteristicProperties napiToCBCharacteristicProperties(Napi::Array properti
151
151
  }
152
152
 
153
153
  CBAttributePermissions napiToCBAttributePermissions(Napi::Array properties, Napi::Array secure) {
154
- NSLog(@"napiToCBAttributePermissions");
154
+ // NSLog(@"napiToCBAttributePermissions");
155
155
 
156
156
  NSArray<NSString *> *p = napiToStringArray(properties);
157
157
  NSArray<NSString *> *s = napiToStringArray(secure);
@@ -186,7 +186,7 @@ CBAttributePermissions napiToCBAttributePermissions(Napi::Array properties, Napi
186
186
  }
187
187
 
188
188
  NSArray<CBDescriptor *> *napiArrayToCBDescriptors(Napi::Array array) {
189
- NSLog(@"napiArrayToCBDescriptors");
189
+ // NSLog(@"napiArrayToCBDescriptors");
190
190
 
191
191
  NSMutableArray *descriptors = [NSMutableArray array];
192
192
 
@@ -204,7 +204,7 @@ CBDescriptor *napiToCBDescriptor(Napi::Object obj) {
204
204
  NSString *uuid = napiToUuidString(obj.Get("uuid").ToString());
205
205
  NSString *value = napiToString(obj.Get("value").ToString());
206
206
 
207
- NSLog(@"napiToCBDescriptor uuid:%@ value:%@", uuid, value);
207
+ // NSLog(@"napiToCBDescriptor uuid:%@ value:%@", uuid, value);
208
208
 
209
209
  return [[CBMutableDescriptor alloc] initWithType:[CBUUID UUIDWithString:uuid]
210
210
  value:value];
@@ -224,7 +224,7 @@ NSArray<NSString *> *napiToStringArray(Napi::Array array) {
224
224
  }
225
225
 
226
226
  std::map<Napi::String, Napi::Object> napiArrayToUUIDEmitters(Napi::Array services) {
227
- NSLog(@"napiArrayToUUIDEmitters");
227
+ // NSLog(@"napiArrayToUUIDEmitters");
228
228
 
229
229
  std::map<Napi::String, Napi::Object> map;
230
230
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoprocent/bleno",
3
- "version": "0.7.6",
3
+ "version": "0.8.0",
4
4
  "description": "A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -44,31 +44,33 @@
44
44
  "license": "MIT",
45
45
  "readmeFilename": "README.md",
46
46
  "devDependencies": {
47
+ "@commitlint/cli": "^19.3.0",
48
+ "@commitlint/config-conventional": "^19.2.2",
49
+ "@semantic-release/changelog": "^6.0.3",
47
50
  "@semantic-release/exec": "^6.0.3",
51
+ "@semantic-release/git": "^10.0.1",
52
+ "@semantic-release/github": "^10.1.1",
53
+ "jshint": "^2.13.6",
48
54
  "cross-env": "^7.0.3",
49
- "jshint": "~2.13.6",
50
- "eslint": "^8.31.0",
51
- "eslint-config-semistandard": "^17.0.0",
52
- "eslint-config-standard": "^17.0.0",
53
- "eslint-plugin-import": "^2.26.0",
54
- "eslint-plugin-n": "^15.6.0",
55
- "eslint-plugin-promise": "^6.1.1",
56
- "mocha": "~10.2.0",
57
- "node-blink1": "~0.5.1",
58
- "node-gyp": "^10.0.0",
59
- "nyc": "^15.1.0",
60
- "prebuildify": "^5.0.1",
61
- "prebuildify-cross": "5.0.0",
62
- "should": "~13.2.3"
55
+ "eslint": "^8.57.1",
56
+ "eslint-plugin-import": "^2.30.0",
57
+ "eslint-plugin-n": "^17.10.3",
58
+ "eslint-plugin-promise": "^7.1.0",
59
+ "node-blink1": "^0.5.1",
60
+ "mocha": "^10.7.0",
61
+ "nyc": "^17.0.0",
62
+ "prebuildify": "^6.0.1",
63
+ "prebuildify-cross": "thegecko/prebuildify-cross#fix-docker",
64
+ "should": "^13.2.3"
63
65
  },
64
66
  "dependencies": {
65
- "debug": "^4.3.4",
67
+ "debug": "^4.3.7",
66
68
  "napi-thread-safe-callback": "^0.0.6",
67
- "node-addon-api": "^4.3.0",
68
- "node-gyp-build": "^4.6.1"
69
+ "node-addon-api": "^8.1.0",
70
+ "node-gyp-build": "^4.8.1"
69
71
  },
70
72
  "optionalDependencies": {
71
- "@stoprocent/bluetooth-hci-socket": "^1.2.1",
73
+ "@stoprocent/bluetooth-hci-socket": "^1.4.0",
72
74
  "bplist-parser": "0.3.2",
73
75
  "xpc-connect": "^3.0.0"
74
76
  },
index e1a3393..0e034da 100644
Binary file
index 22ce35f..17e6263 100644
Binary file
index 03d93c2..6637527 100644
Binary file