本文整理汇总了Java中javax.bluetooth.DiscoveryListener.INQUIRY_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java DiscoveryListener.INQUIRY_ERROR属性的具体用法?Java DiscoveryListener.INQUIRY_ERROR怎么用?Java DiscoveryListener.INQUIRY_ERROR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.bluetooth.DiscoveryListener
的用法示例。
在下文中一共展示了DiscoveryListener.INQUIRY_ERROR属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inquiryCompleted
/**
* This callback method will be called when the device discovery is
* completed.
*/
public void inquiryCompleted(int discType) {
synchronized(lock){
lock.notify();
}
switch (discType) {
case DiscoveryListener.INQUIRY_COMPLETED :
System.out.println("INQUIRY_COMPLETED");
break;
case DiscoveryListener.INQUIRY_TERMINATED :
System.out.println("INQUIRY_TERMINATED");
break;
case DiscoveryListener.INQUIRY_ERROR :
System.out.println("INQUIRY_ERROR");
break;
default :
System.out.println("Unknown Response Code");
break;
}
}
示例2: inquiryCompleted
public void inquiryCompleted(int discType) {
if (discType == DiscoveryListener.INQUIRY_COMPLETED) {
if (log.isInfoEnabled()) {
log.info("inquiry completed");
}
}
if (discType == DiscoveryListener.INQUIRY_TERMINATED) {
if (log.isInfoEnabled()) {
log.info("inquiry terminated");
}
}
if (discType == DiscoveryListener.INQUIRY_ERROR) {
if (log.isInfoEnabled()) {
log.info("inquiry error");
}
}
}
示例3: inquiryResponseCodeToString
private static String inquiryResponseCodeToString(int code) {
if (code == DiscoveryListener.INQUIRY_COMPLETED) {
return "INQUIRY_COMPLETED";
} else if (code == DiscoveryListener.INQUIRY_ERROR) {
return "INQUIRY_ERROR";
} else if (code == DiscoveryListener.INQUIRY_TERMINATED) {
return "INQUIRY_TERMINATED";
} else {
return "Unknown";
}
}
示例4: inquiryCompleted
/**
*
* This method is called by the javax.bluetooth.DiscoveryAgent (agent) when the discovery process is completed
*
* @param discType The type of request that was completed; either INQUIRY_COMPLETED, INQUIRY_TERMINATED, or INQUIRY_ERROR
*
*/
public void inquiryCompleted(int discType) {
switch (discType) {
case DiscoveryListener.INQUIRY_COMPLETED:
if(devicesFound.size()==0){
log.logDebugInfo("BluetoothServiceDiscovery.inquiryCompleted()","No devices found");
// Send a message to the midlet
currentNetwork.serviceSearchCompleted();
}else{
try {
log.logDebugInfo("BluetoothServiceDiscovery.inquiryCompleted()","Found one or more devices");
// The discovery agent searches for services on the first device stored in the devicesFound Vector
agent.searchServices(attributes,uuids,(RemoteDevice)devicesFound.firstElement(),this);
devicesFound.removeElementAt(0);
} catch (BluetoothStateException bse) {
log.logException("BluetoothServiceDiscovery.serviceSearchCompleted", bse, true);
}
}
log.logDebugInfo("BluetoothServiceDiscovery.inquiryCompleted()","Device inquiry completed");
break;
case DiscoveryListener.INQUIRY_ERROR:
log.logDebugInfo("BluetoothServiceDiscovery.inquiryCompleted()","Device inquiry error");
break;
case DiscoveryListener.INQUIRY_TERMINATED:
log.logDebugInfo("BluetoothServiceDiscovery.inquiryCompleted()","Device inquiry terminated");
break;
}
}
示例5: onInquiryComplete
void onInquiryComplete(boolean success) {
if (discListener == null) {
return;
}
stopPolling();
discListener = null;
inquiryHistory.removeAllElements();
int type = success ? DiscoveryListener.INQUIRY_COMPLETED :
DiscoveryListener.INQUIRY_ERROR;
DiscoveryAgentImpl.getInstance().inquiryCompleted(type);
}