def disconnect(profile=:all)
      case profile
      when UUID::REGEX
        block_given? ? @o_dev[I_DEVICE].DisconnectProfile(profile, &Proc.new) :
                       @o_dev[I_DEVICE].DisconnectProfile(profile)
      when :all
        block_given? ? @o_dev[I_DEVICE].Disconnect(&Proc.new) :
                       @o_dev[I_DEVICE].Disconnect()
      else raise ArgumentError, "profile uuid or :all expected"
      end
      true
    rescue DBus::Error => e
      case e.name
      when E_FAILED
      when E_IN_PROGRESS
        false
      when E_INVALID_ARGUMENTS
        raise ArgumentError, "unsupported profile (#{profile})"
      when E_NOT_SUPPORTED
        raise NotSupported
      when E_NOT_CONNECTED
        true
      when E_UNKNOWN_OBJECT
        raise StalledObject
      else raise ScriptError
      end
    end
def disconnect(profile=:all)
      case profile
      when UUID::REGEX
        block_given? ? @o_dev[I_DEVICE].DisconnectProfile(profile, &Proc.new) :
                       @o_dev[I_DEVICE].DisconnectProfile(profile)
      when :all
        block_given? ? @o_dev[I_DEVICE].Disconnect(&Proc.new) :
                       @o_dev[I_DEVICE].Disconnect()
      else raise ArgumentError, "profile uuid or :all expected"
      end
      true
    rescue DBus::Error => e
      case e.name
      when E_FAILED
      when E_IN_PROGRESS
        false
      when E_INVALID_ARGUMENTS
        raise ArgumentError, "unsupported profile (#{profile})"
      when E_NOT_SUPPORTED
        raise NotSupported
      when E_NOT_CONNECTED
        true
      when E_UNKNOWN_OBJECT
        raise StalledObject
      else raise ScriptError
      end
    end
This method gracefully disconnects :all connected profiles
 and then terminates low-level ACL connection.
 ACL connection will be terminated even if some profiles
 were not disconnected properly e.g. due to misbehaving device.
 This method can be also used to cancel a preceding #connect
 call before a reply to it has been received.
 If a profile UUID is specified, only this profile is disconnected,
 and as their is no connection tracking for a profile, so
 as long as the profile is registered this will always succeed
 @return [Boolean]