Skip to content

Instantly share code, notes, and snippets.

@pcamp96
Created December 20, 2011 04:24
Show Gist options
  • Select an option

  • Save pcamp96/1500246 to your computer and use it in GitHub Desktop.

Select an option

Save pcamp96/1500246 to your computer and use it in GitHub Desktop.
var profile = 'map';
switch (event) {
case Bluetooth.serviceDown:
// This scene should not be running if the service went down
this.controller.stageController.popScene();
break;
case Bluetooth.connAccepted:
if(this.deviceDetails.address == address) {
switch(profile){
case 'map':
this.mapOnOffModel.value = true;
this.isMapAllowed = true;
this.controller.modelChanged(this.mapOnOffModel, this);
break;
case 'pbap':
this.pbapOnOffModel.value = true;
this.isPbapAllowed = true;
this.controller.modelChanged(this.pbapOnOffModel, this);
break;
}
}
break;
case Bluetooth.connRejected:
if(this.deviceDetails.address == address) {
switch(profile){
case 'map':
this.mapOnOffModel.value = false;
this.isMapAllowed = false;
this.controller.modelChanged(this.mapOnOffModel, this);
break;
case 'pbap':
this.pbapOnOffModel.value = false;
this.isPbapAllowed = false;
this.controller.modelChanged(this.pbapOnOffModel, this);
break;
}
}
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment