我喜欢使用Android应用程序控制Wahoo Kickr Core自行车运动鞋。从网站上下载的API不太清楚,但是我设法在调试期间连接并找到了您期望的值。
我要解决的问题是,发现设备后mySensorConnection会得到一个值,并且不为null。但是询问mySensorConnection.isConnected()是否继续给出否定的答复。怎么了?
mcp = ConnectionParams.fromString(s);
if (mcp != null) sts.setText(mcp.getName());
mhwcs = new HardwareConnectorService(ctxt);
mhc = mhwcs.getHardwareConnector();
msc = mhwcs.connectSensor(mcp);
if (msc != null) {
Log.i(TAG, "MSC not null!");
while (!msc.isConnected())
Log.i(TAG, "MSC NOT really connected!");
Log.i(TAG, "MSC REALLY CONNECTED");
}