Skip to content

Commit

Permalink
Improved readability
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosinigaglia committed Dec 30, 2023
1 parent 48b2c6d commit ef7a7fb
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 39 deletions.
31 changes: 21 additions & 10 deletions docs/events.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parent: Usage

# Events

### BleManagerStopScan
## BleManagerStopScan

The scanning for peripherals is ended.

Expand All @@ -23,8 +23,9 @@ bleManagerEmitter.addListener("BleManagerStopScan", (args) => {
// Scanning is stopped
});
```
---

### BleManagerDidUpdateState
## BleManagerDidUpdateState

The BLE change state.

Expand All @@ -39,8 +40,9 @@ bleManagerEmitter.addListener("BleManagerDidUpdateState", (args) => {
// The new state: args.state
});
```
---

### BleManagerDiscoverPeripheral
## BleManagerDiscoverPeripheral

The scanning find a new peripheral.

Expand All @@ -65,8 +67,9 @@ bleManagerEmitter.addListener("BleManagerDiscoverPeripheral", (args) => {
// The name: args.name
});
```
---

### BleManagerDidUpdateValueForCharacteristic
## BleManagerDidUpdateValueForCharacteristic

A characteristic notify a new value.

Expand Down Expand Up @@ -107,8 +110,9 @@ async function connectAndPrepare(peripheral, service, characteristic) {
// Actions triggereng BleManagerDidUpdateValueForCharacteristic event
}
```
---

### BleManagerConnectPeripheral
## BleManagerConnectPeripheral

A peripheral was connected.

Expand All @@ -117,7 +121,9 @@ A peripheral was connected.
- `peripheral` - `String` - the id of the peripheral
- `status` - `Number` - [Android only] connect [`reasons`](<https://developer.android.com/reference/android/bluetooth/BluetoothGattCallback.html#onConnectionStateChange(android.bluetooth.BluetoothGatt,%20int,%20int)>)

### BleManagerDisconnectPeripheral
---

## BleManagerDisconnectPeripheral

A peripheral was disconnected.

Expand All @@ -128,15 +134,19 @@ A peripheral was disconnected.
- `domain` - `String` - [iOS only] disconnect error domain
- `code` - `Number` - [iOS only] disconnect error code (<https://developer.apple.com/documentation/corebluetooth/cberror/code>)

### BleManagerPeripheralDidBond
---

## BleManagerPeripheralDidBond

A bond with a peripheral was established

**Arguments**

Object with information about the device

### BleManagerCentralManagerWillRestoreState [iOS only]
---

## BleManagerCentralManagerWillRestoreState [iOS only]

This is fired when [`centralManager:WillRestoreState:`](https://developer.apple.com/documentation/corebluetooth/cbcentralmanagerdelegate/1518819-centralmanager) is called (app relaunched in the background to handle a bluetooth event).

Expand All @@ -148,9 +158,10 @@ _For more on performing long-term bluetooth actions in the background:_

[iOS Bluetooth State Preservation and Restoration](https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html#//apple_ref/doc/uid/TP40013257-CH7-SW10)

[iOS Relaunch Conditions](https://developer.apple.com/library/archive/qa/qa1962/_index.html)
[iOS Relaunch Conditions](https://developer.apple.com/documentation/technotes/tn3115-bluetooth-state-restoration-app-relaunch-rules/)

### BleManagerDidUpdateNotificationStateFor [iOS only]
---
## BleManagerDidUpdateNotificationStateFor [iOS only]

The peripheral received a request to start or stop providing notifications for a specified characteristic's value.

Expand Down
Loading

0 comments on commit ef7a7fb

Please sign in to comment.