本文整理汇总了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);
}
示例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);
}
示例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;
}
}
示例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);
}
}
示例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();
}
示例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);
}
示例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);
}
示例8: checkServiceRecord
import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
protected abstract void checkServiceRecord()
throws ServiceRegistrationException;
示例9: rfServerUpdateServiceRecord
import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void rfServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen) throws ServiceRegistrationException {
sdpServiceUpdateServiceRecord(handle, 'r', serviceRecord);
}
示例10: l2ServerUpdateServiceRecord
import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void l2ServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen) throws ServiceRegistrationException {
sdpServiceUpdateServiceRecord(handle, 'l', serviceRecord);
}
示例11: updateServiceRecord
import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void updateServiceRecord(boolean acceptAndOpen) throws ServiceRegistrationException {
((BluetoothConnectionNotifierServiceRecordAccess) impl).updateServiceRecord(acceptAndOpen);
}
示例12: rfServerUpdateServiceRecord
import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void rfServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen)
throws ServiceRegistrationException {
// TODO Auto-generated method stub
}
示例13: l2ServerUpdateServiceRecord
import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void l2ServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen)
throws ServiceRegistrationException {
// TODO Auto-generated method stub
}
示例14: updateStackServiceRecord
import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
protected void updateStackServiceRecord(ServiceRecordImpl serviceRecord, boolean acceptAndOpen)
throws ServiceRegistrationException {
bluetoothStack.rfServerUpdateServiceRecord(handle, serviceRecord, acceptAndOpen);
}
示例15: rfServerUpdateServiceRecord
import javax.bluetooth.ServiceRegistrationException; //导入依赖的package包/类
public void rfServerUpdateServiceRecord(long handle, ServiceRecordImpl serviceRecord, boolean acceptAndOpen) throws ServiceRegistrationException {
sdpServiceUpdateServiceRecord(handle, 'R', serviceRecord);
}