示例#1
0
 def __init__(self):
     BTAgent.__init__(self, auto_authorize_connections=False, cb_notify_on_authorize=self.auto_accept_one, default_pass_key=7130, cb_notify_on_request_confirmation=self.confirm_request, cb_notify_on_request_pin_code=self.pincode_request, cb_notify_on_request_pass_key=self.passkey_request)
     self.adapter = BTAdapter(config.get('bluez', 'device_path'))
     self.allowed_uuids = [ SERVICES["AdvancedAudioDistribution"].uuid, SERVICES["AVRemoteControl"].uuid ]
     self.connected = None
     self.tracked_devices =  []
     self.update_discoverable()
示例#2
0
 def __init__(self, connect_callback, disconnect_callback):
     BTAgent.__init__(self, cb_notify_on_authorize=self.auto_accept_one)
     self.adapter = BTAdapter(config.get('bluez', 'device_path'))
     self.allowed_uuids = [ SERVICES["AdvancedAudioDistribution"].uuid, SERVICES["AVRemoteControl"].uuid ]
     self.connected = None
     self.tracked_devices =  []
     self.connect_callback = connect_callback
     self.disconnect_callback = disconnect_callback
     self.update_discoverable()
示例#3
0
 def __init__(self, connect_callback, disconnect_callback):
     BTAgent.__init__(self,
                      auto_authorize_connections=False,
                      cb_notify_on_authorize=self.auto_accept_one,
                      default_pin_code=config.get('bluez', 'pincode'),
                      default_pass_key=config.get('bluez', 'pincode'))
     self.adapter = BTAdapter(config.get('bluez', 'device_path'))
     self.adapter.set_property('Discoverable',
                               config.getboolean('bluez', 'discoverable'))
     self.allowed_uuids = [SERVICES["AdvancedAudioDistribution"].uuid]
     self.allowed_uuids.append(SERVICES["AVRemoteControl"].uuid)
     #self.allowed_uuids.append(SERVICES["Headset"].uuid)
     self.connected = None
     self.tracked_devices = []
     self.connect_callback = connect_callback
     self.disconnect_callback = disconnect_callback
     self.update_discoverable()