bcsphere / bluetooth

Please support! Kindly "Star" this standard Bluetooth Smart API / SDK :) The "bcsphere/bluetooth" is a phonegap/cordova plugin. It's a Bluetooth JavaScript API from JUMA, a Bluetooth expert team. It supports both Bluetooth 4.0 GATT/Bluetooth Low Energy (BLE) interface in iOS/Android and Bluetooth 2.1 Classic Rfcomm / L2cap socket interface as Bluetooth Serial Port/SPP, as well as iBeacon!
Apache License 2.0
299 stars 12 forks source link

bleprofiles fetch fails while fetching org.bcsphere.bluetooth #19

Closed defrag86 closed 10 years ago

defrag86 commented 10 years ago

hi I get this issue while fetching the plugin via cordova

cordova plugin add https://github.com/bcsphere/bleprofiles.git
Fetching plugin "https://github.com/bcsphere/bleprofiles.git" via git clone
Installing "org.bcsphere.bleprofiles" for android
Fetching plugin "https://github.com/bcsphere/bluetooth.git" via git clone
Failed to install 'org.bcsphere.bleprofiles':Error: Expected fetched plugin to have ID "org.bcsphere.bluetooth" but got "org".
    at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:116:19)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:61:24
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)
Error: Expected fetched plugin to have ID "org.bcsphere.bluetooth" but got "org".
    at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:116:19)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:61:24
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44
    at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)

similar behavior if I get bluetooth plugin alone: it creates a hierarchy named /plugins/org. I see in plugin.xml of org.bcsphere.bluetooth that id tag (5th line) is set to org.

is there a way to have both plugins interacting?

lizhijumacc commented 10 years ago

Sorry, the org.bcsphere.bleprofiles plugin is deprecated. We merge the bluetooth profiles into org.bcsphere.bluetooth plugin , execute 'cordova plugin add https://github.com/bcsphere/bluetooth.git' to install it in your project, and use 'cordova plugin remove org' to remove it. you can use the profiles immediately.

this is an example to use the profile in project, hope it help. :)

      var findmeProfile = {};
      var isAlerting = false;

      document.addEventListener('deviceready',function(){
          findmeProfile = new BC.FindMeProfile();
      });

      function device_alert(){
          var device = new BC.Device({deviceAddress:DEVICEADDRESS,deviceName:"O-Click",isConnected:false,type:DEVICETYPE});

            device.connect(function(){                                                                  
                if(!isAlerting){                                                                        
                 findmeProfile.high_alert(device);
                 isAlerting = true;                                                                     
                }else{
                 findmeProfile.no_alert(device);                                                        
                 isAlerting = false;                                                                    
                }
            );
      }
defrag86 commented 10 years ago

ok thank you, I also noticed you removed the bleprofiles project, so nothing to remark. I consider this issue closed from my part.

b.r.