Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@particle/device-control-ble-setup-library
Advanced tools
Library that provides interfaces to execute the ble setup of a device
@particle/device-control-ble-setup-library
Library that provides interfaces to execute the ble setup of a device
npm install @particle/device-control-ble-setup-library --save
note: you'll need to be signed into an npm account that is a member of the @particle
org (docs)
A class to write data to a stream. Extends the EventEmitter class.
Kind: global class
Constructor
Param | Type | Description |
---|---|---|
callback | StreamWithCallback~callback | The callback used to write data. |
Writes data using a callback.
Kind: instance method of StreamWithCallback
Param | Type | Description |
---|---|---|
data | Uint8Array | The data to write. |
A class that implements the BLEDevice interface.
Kind: global class
string
Promise.<number>
Promise.<void>
Promise.<void>
Constructor.
Param | Type | Description |
---|---|---|
device | Device | Device instance which can be retrieved only by calling bleManager.startDeviceScan(). |
uuids | UUIDs | |
env | Object |
string
The name of the device.
Kind: instance property of BLEDevice
Connects to a device using its mobile secret. It first estalishes a connection, and then tries to find the device characteristic based on the UUIDs provided. It then tries to check the protocol version to finally open a control request channel using the mobile secret.
Kind: instance method of BLEDevice
Param | Type | Description |
---|---|---|
mobileSecret | string | A string of the mobile secret. |
Disconnects from a device closing the control request channel, removing the characteristics and cancelling the device connection.
Kind: instance method of BLEDevice
Finds the characteristics of a mobile's connection service.
Kind: instance method of BLEDevice
Param | Type |
---|---|
UUIDs | UUIDs |
Promise.<number>
Gets the current protocol version from the read characteristics of the connection.
Kind: instance method of BLEDevice
Returns: Promise.<number>
- Promise with a number coming from a decoded base64 input.
Checks for the protocol version. If the protocol is different that 2, it throws an error instance of type InvalidProtocolVersionError.
Kind: instance method of BLEDevice
Opens a new control request channel using the mobile's secret.
Kind: instance method of BLEDevice
Param | Type |
---|---|
mobileSecret | string |
Closes a control requested channel.
Kind: instance method of BLEDevice
Promise.<void>
Scans for nearby networks. Filters invalid names and returns unique SSIDs.
Kind: instance method of BLEDevice
Returns: Promise.<void>
- Returns a successful promise with the scanned networks.
Promise.<void>
Joins a scanned network.
Kind: instance method of BLEDevice
Returns: Promise.<void>
- Returns a successful promise if network was joinable.
Param | Type | Description |
---|---|---|
network | INetwork | Network interface with information like the SSID and channel. |
password | string | Password to join the network. |
Listener function triggered when disconnection happens.
Kind: instance method of BLEDevice
Param | Type | Description |
---|---|---|
listener | callback | Listener callback that gets executed when disconnecting. |
A class for capturing device requests
Kind: global class
Promise.<ReplyType>
Promise.<Array.<INetwork>>
Constructor
Param | Type |
---|---|
requestChannel | * |
Promise.<ReplyType>
Send a connection request.
Kind: instance method of DeviceRequests
Returns: Promise.<ReplyType>
- Promise
Param | Type |
---|---|
RequestClass | ProtobufMessage.<ReplyType> |
ReplyClass | ProtobufMessage.<ReplyType> |
type | number |
requestData | RequestType |
Promise.<Array.<INetwork>>
Scans the nearby networks.
Kind: instance method of DeviceRequests
Returns: Promise.<Array.<INetwork>>
- Promise containing the network information
Sends a request to join a new network.
Kind: instance method of DeviceRequests
Param | Type | Description |
---|---|---|
network | INetwork | INetwork interface |
password | string |
string
Decode base64 string into a string
Kind: global function
Returns: string
- Decoded string
Param | Type | Description |
---|---|---|
input | string | Base64 encoded input |
number
Decode base64 string into a number
Kind: global function
Returns: number
- Decoded number
Param | Type | Description |
---|---|---|
input | string | Base64 encoded input |
Object
A Device interface
Kind: global typedef
Object
A UUID interface
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
serviceUUID | string | The UUID of the service. |
versionCharacteristicUUID | string | The version characteristic UUID of the service. |
rxCharacteristicUUID | string | The receiver characteristic UUID of the service. |
txCharacteristicUUID | string | The transmitter UUID of the service. |
Object
A ProtobufMessage interface
Kind: global typedef
Properties
Name | Type |
---|---|
create | function |
NOTE: Unfortunately, docs have a nasty habit of falling out of date. When in doubt, check usage in tests
FAQs
Library that provides interfaces to execute the ble setup of a device
We found that @particle/device-control-ble-setup-library demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 29 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.