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


Java DiscoveryListener.INQUIRY_ERROR属性代码示例

本文整理汇总了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;
	}
}
 
开发者ID:rhamnett,项目名称:dazzl,代码行数:27,代码来源:BluetoothDeviceDiscovery.java

示例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");
		}
	}
}
 
开发者ID:iSchluff,项目名称:Wii-Gesture,代码行数:19,代码来源:MoteFinder.java

示例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";
    }
}
 
开发者ID:Blaubot,项目名称:Blaubot,代码行数:11,代码来源:BlaubotJsr82BluetoothConnector.java

示例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;
}
  }
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:40,代码来源:BluetoothServiceDiscovery.java

示例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);
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:11,代码来源:BluetoothStack.java


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