Я бегу приложение BluetoothChat с изменения, внесенные следующим образом:Android-BluetoothChat OBD-II нет ответа от устройства
BluetoothChatService
// Unique UUID for this application
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
BluetoothChatService
// The action listener for the EditText widget, to listen for the return key
private TextView.OnEditorActionListener mWriteListener =
new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
// If the action is a key-up event on the return key, send the message
if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
String message = view.getText().toString();
sendMessage(message+ "\r");//My CHANGE
}
if(D) Log.i(TAG, "END onEditorAction");
return true;
}
};
The подключение к устройству OBD идеально, но я не получаю y от устройства при отправке «ATI» или «010C» и т. д.
Я запускаю приложение в Android 4.4.2 (Kit Kat), и приложение основано на примере приложения BluetoothChat в Android 2.2
Я думаю, что вы хотели назвать второй кусок кода «** BluetoothChatFragment **», а не «** BluetoothChatService **» – Jon
Какое устройство obd-II вы используете? – Jon