Skip to content

p-schuler/TappyBleBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TappyBleBridge

TappyBle to PhoneGap communicator bridge

This communicator implementation is creating a bridge between the TappyBLE wrapper and the BLE central plugin.

To get things working in your phonegap / cordova project, you have to follow 4 simple steps:

  1. Include the BLE central plugin in your project
  2. Include the following javascript files in your project from the TappyBLE SDK: TappyWrapper, Basic NFC, NDEFJs, TCPM System Family JS and TCPM Tappy
  3. Include the communicator bridge in your project TappyCommunicator
  4. Hook up the communicator with the TappyWrapper:
this.communicator = com.kraftbyte.tappy.TappyBleCommunicator.getCurrent();
this.wrapper = new TappyWrapper({ communicator: this.communicator });

To start listening for events, you have to call setupNotifications on the communicator:

this.communicator.setupNotifications();

A sample of a complete setup:

this.wrapper.stop();
window.setTimeout(()=>{
  this.communicator.setupNotifications();
  window.setTimeout(()=>{
    this.wrapper.detectNdef(false, 0);
  }, 500);
}, 500);

Now you can use the standard interface of the wrapper described here

About

TappyBle to PhoneGap communicator bridge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published