8000 GitHub - PoweredBySAM/noble-mock: A mock noble object for testing purposes
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PoweredBySAM/noble-mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

A mock noble object for testing purposes

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0