当前位置: 首页>>代码示例>>Java>>正文


Java ServiceRegistrationException类代码示例

本文整理汇总了Java中javax.bluetooth.ServiceRegistrationException的典型用法代码示例。如果您正苦于以下问题:Java ServiceRegistrationException类的具体用法?Java ServiceRegistrationException怎么用?Java ServiceRegistrationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServiceRegistrationException类属于javax.bluetooth包,在下文中一共展示了ServiceRegistrationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void updateRecord(ServiceRecord srvRecord)
        throws ServiceRegistrationException {
    if (DEBUG) {
        System.out.println("LocalDeviceImpl.updateRecord");
    }
    if (srvRecord == null) {
        throw new NullPointerException("Null record specified.");
    }
    if (!(srvRecord instanceof ServiceRecordImpl)) {
        throw new IllegalArgumentException("Invalid service record class.");
    }
    ServiceRecordImpl record = (ServiceRecordImpl)srvRecord;
    BluetoothNotifier notifier = record.getNotifier();
    if (notifier == null) {
        throw new IllegalArgumentException(
                "Service record is not from local SDDB.");
    }
    notifier.updateServiceRecord(record);
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:20,代码来源:LocalDeviceImpl.java

示例2: sdpServiceUpdateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
private void sdpServiceUpdateServiceRecord(long handle, char handleType, ServiceRecordImpl serviceRecord) throws ServiceRegistrationException {
    int[] ids = serviceRecord.getAttributeIDs();
    if ((ids == null) || (ids.length == 0)) {
        return;
    }
    for (int i = 0; i < ids.length; i++) {
        int attrID = ids[i];
        switch (attrID) {
        case BluetoothConsts.ServiceRecordHandle:
            continue;
        case BluetoothConsts.ProtocolDescriptorList:
        case BluetoothConsts.AttributeIDServiceName:
            continue;
        }
        sdpServiceAddAttribute(handle, handleType, attrID, serviceRecord.getAttributeValue(attrID));
    }
    sdpServiceUpdateServiceRecordPublish(handle, handleType);
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:19,代码来源:BluetoothStackOSX.java

示例3: updateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void updateServiceRecord(boolean acceptAndOpen) throws ServiceRegistrationException {
	if (serviceRecord.attributeUpdated || (!acceptAndOpen)) {
		try {
			validateServiceRecord(this.serviceRecord);
		} catch (IllegalArgumentException e) {
			if (acceptAndOpen) {
				throw new ServiceRegistrationException(e.getMessage());
			} else {
				throw e;
			}
		}
		try {
			updateStackServiceRecord(serviceRecord, acceptAndOpen);
		} finally {
			serviceRecord.attributeUpdated = false;
		}
	}
	if ((serviceRecord.deviceServiceClasses != serviceRecord.deviceServiceClassesRegistered)
			&& ((bluetoothStack.getFeatureSet() & BluetoothStack.FEATURE_SET_DEVICE_SERVICE_CLASSES) != 0)) {

		bluetoothStack.setLocalDeviceServiceClasses(ServiceRecordsRegistry.getDeviceServiceClasses());

		serviceRecord.deviceServiceClassesRegistered = serviceRecord.deviceServiceClasses;
	}
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:26,代码来源:BluetoothConnectionNotifierBase.java

示例4: updateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
protected void updateServiceRecord(ServiceRecordImpl record)
        throws ServiceRegistrationException {
    ServiceRecordImpl oldRecord = serviceRec;
    serviceRec = record.copy();
    try {
        checkServiceRecord();
    } catch (ServiceRegistrationException e) {
        serviceRec = oldRecord;
        throw new IllegalArgumentException(e.getMessage());
    }
    if (SDDB.getInstance().contains(serviceRec)) {
        SDDB.getInstance().updateServiceRecord(serviceRec);
    }
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:15,代码来源:BluetoothNotifier.java

示例5: sdpServiceSequenceAttribute

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
private byte[] sdpServiceSequenceAttribute(Enumeration en) throws ServiceRegistrationException {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    SDPOutputStream sdpOut = new SDPOutputStream(out);
    try {
        while (en.hasMoreElements()) {
            sdpOut.writeElement((DataElement) en.nextElement());
        }
    } catch (IOException e) {
        throw new ServiceRegistrationException(e.getMessage());
    }
    return out.toByteArray();
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:13,代码来源:BluetoothStackWIDCOMM.java

示例6: rfServerUpdateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void rfServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen)
		throws ServiceRegistrationException {
	unregisterService(serviceRecord.getHandle());
	byte[] blob;
	try {
		blob = serviceRecord.toByteArray();
	} catch (IOException e) {
		throw new ServiceRegistrationException(e.toString());
	}
	serviceRecord.setHandle(registerService(blob, serviceRecord.deviceServiceClasses));
	DebugLog.debug("new serviceRecord", serviceRecord);
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:13,代码来源:BluetoothStackMicrosoft.java

示例7: updateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public static void updateServiceRecord(ServiceRecord srvRecord) throws ServiceRegistrationException {
	BluetoothConnectionNotifierServiceRecordAccess owner;
	synchronized (ServiceRecordsRegistry.class) {
		owner = (BluetoothConnectionNotifierServiceRecordAccess) serviceRecordsMap.get(srvRecord);
	}
	if (owner == null) {
		throw new IllegalArgumentException("Service record is not registered");
	}
	owner.updateServiceRecord(false);
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:11,代码来源:ServiceRecordsRegistry.java

示例8: checkServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
protected abstract void checkServiceRecord()
throws ServiceRegistrationException;
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:3,代码来源:BluetoothNotifier.java

示例9: rfServerUpdateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void rfServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen) throws ServiceRegistrationException {
    sdpServiceUpdateServiceRecord(handle, 'r', serviceRecord);
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:4,代码来源:BluetoothStackWIDCOMM.java

示例10: l2ServerUpdateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void l2ServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen) throws ServiceRegistrationException {
    sdpServiceUpdateServiceRecord(handle, 'l', serviceRecord);
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:4,代码来源:BluetoothStackWIDCOMM.java

示例11: updateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void updateServiceRecord(boolean acceptAndOpen) throws ServiceRegistrationException {
	((BluetoothConnectionNotifierServiceRecordAccess) impl).updateServiceRecord(acceptAndOpen);
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:4,代码来源:Connection.java

示例12: rfServerUpdateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void rfServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen)
		throws ServiceRegistrationException {
	// TODO Auto-generated method stub

}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:6,代码来源:BluetoothStackToshiba.java

示例13: l2ServerUpdateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void l2ServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen)
		throws ServiceRegistrationException {
	// TODO Auto-generated method stub
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:5,代码来源:BluetoothStackToshiba.java

示例14: updateStackServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
protected void updateStackServiceRecord(ServiceRecordImpl serviceRecord, boolean acceptAndOpen)
		throws ServiceRegistrationException {
	bluetoothStack.rfServerUpdateServiceRecord(handle, serviceRecord, acceptAndOpen);
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:5,代码来源:BluetoothRFCommConnectionNotifier.java

示例15: rfServerUpdateServiceRecord

import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void rfServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen) throws ServiceRegistrationException {
    sdpServiceUpdateServiceRecord(handle, 'R', serviceRecord);
}
 
开发者ID:empeeoh,项目名称:bluecove-osx,代码行数:4,代码来源:BluetoothStackOSX.java


注:本文中的javax.bluetooth.ServiceRegistrationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。