this.on("close", function() {
   try {
     Bleacon.stopAdvertising();
   } catch (err) {
     console.log(err);
   }
 });
 this.on("input", function(msg) {
   if (msg.payload == "on" || msg.payload == 1) {
     if ((this.beacon_uuid != "") && (this.beacon_major != "") && (
         this.beacon_minor !=
         "") && (this.beacon_power != "")) {
       try {
         Bleacon.startAdvertising(this.beacon_uuid, this.beacon_major,
           this.beacon_minor, this.beacon_power);
         this.status({
           fill: "blue",
           shape: "dot",
           text: "sending"
         });
       } catch (err) {
         console.log(err);
       }
     }
   } else {
     try {
       Bleacon.stopAdvertising();
       this.status({
         fill: "grey",
         shape: "dot",
         text: "not sending"
       });
     } catch (err) {
       console.log(err);
     }
   }
 });
Beispiel #3
0
var advertise = function() {
  b.stopAdvertising();
  b.startAdvertising(uuid, major, minor, power);
}