0.0.4 • Published 8 years ago

noble-mock v0.0.4

Weekly downloads
7
License
ISC
Repository
github
Last release
8 years ago

noble-mock

noble-mock mimics basic API's and behaviours of noble.js to allow automated or manual testing without using real BLE device.

this is the server part of the mock. the client part is located at: noble-mock-device

communication happens over an IPC channel.

building

npm run build

usage

server part:

if (process.env.NOBLE_MOCK) {
  // `AppNamespace` is a namespace for IPC channel
  noble = require('noble-mock')('AppNamespace');
} else {
  noble = require('noble');
}

reflected api's:

  • noble.startScanning()
  • noble.stopScanning()
  • noble.on()
  • noble.addPeripheral()

  • peripheral.characteristics

  • peripheral.discoverSomeServicesAndCharacteristics()
  • peripheral.updateRssi()
  • peripheral.connect()
  • peripheral.disconnect() (peripheral gets extended with client data sent over ipc channel when connection is estabilished)

  • characteristic.write()

  • characteristic.on()
  • characteristic.notify()
0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago