Új hozzászólás Aktív témák
-
shinodas
tag
Köszi a válaszokat!
Azt hiszem megoldottam, már csak egy apróság
(ELnézést a tényleg primitív kérdéseimért, de tényleg abszolút kezdő vagyok)
Szóval a logcat azt mondja, h kapcsolódni próbál az eszköz de nem tudja azt befejezni, először azt írja, hogy kapcsolódva, majd 2 sorral lejjebb már ugyan ez az állapot false.import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.UUID;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.Context;
import android.os.Handler;
import android.util.Log;
public class BluetoothConnection extends Thread {
private BluetoothAdapter bluetooth = null;
private BluetoothSocket socket = null;
private InputStream inputStream = null;
private OutputStream outputStream = null;
private static final UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
static final int BL_NOT_AVAILABLE = 1;
static final int BL_SOCKET_FAILED = 2;
protected static final int BL_INCORRECT_ADDRESS = 3;
private Handler mHandler = null;
public BluetoothConnection(Context context, Handler handler){
bluetooth = BluetoothAdapter.getDefaultAdapter();
mHandler = handler;
if(bluetooth == null){
mHandler.sendEmptyMessage(BL_NOT_AVAILABLE);
return;
}
}
public void BT_Connect(String Address){
Log.d("CONNECTION", "...On Resume...");
String address = Address;
if(!BluetoothAdapter.checkBluetoothAddress(address)){
return;
}else{
BluetoothDevice device = bluetooth.getRemoteDevice(address);
try{
socket = device.createRfcommSocketToServiceRecord(uuid);
}catch(IOException e){
Log.d("RFCOMM", "socket create fail" + e.getMessage());
mHandler.sendEmptyMessage(BL_SOCKET_FAILED);
return;
}
bluetooth.cancelDiscovery();
[B]Log.d("BLUETOOTH", "-----CONNECTING---"); //idáig jut[/B]
try{
socket.connect();
Log.d("BLUETOOTH", "Connecting is ok");
}catch(IOException e){
try{
socket.close();
}catch(IOException e2){
Log.d("BLUETOOTH", "In onResume() and unable to close socket during connection failure" + e2.getMessage());
mHandler.sendEmptyMessage(BL_SOCKET_FAILED);
return;
}
}
}
}
}LOGCAT:
06-07 12:48:35.200: I/ActivityManager(231): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.hxxpd/.MainActivity } from pid 11341
06-07 12:48:35.270: D/CONNECTION(11934): ...On Resume...
06-07 12:48:35.280: E/BluetoothService.cpp(231): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
06-07 12:48:35.280: D/BLUETOOTH(11934): -----CONNECTING---
06-07 12:48:35.740: E/BluetoothEventLoop.cpp(231): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/10666/hci0/dev_CC_AF_78_B4_F7_6A
06-07 12:48:35.740: D/BluetoothService(231): setRemoteDeviceProperty addr = CC:AF:78:B4:F7:6A name = Connected value = true
06-07 12:48:37.090: D/BluetoothService(231): updateDeviceServiceChannelCache(CC:AF:78:B4:F7:6A)
06-07 12:48:37.110: D/BluetoothService(231): uuid(system): 0000111e-0000-1000-8000-00805f9b34fb 3
06-07 12:48:37.120: D/BluetoothService(231): uuid(system): 00001105-0000-1000-8000-00805f9b34fb 10
06-07 12:48:37.140: V/BluetoothEventRedirector(11975): Received android.bleutooth.device.action.UUID
06-07 12:48:37.140: D/BluetoothService(231): Cleaning up failed UUID channel lookup: CC:AF:78:B4:F7:6A 00001101-0000-1000-8000-00805f9b34fb
06-07 12:48:37.330: E/CachedBluetoothDevice(11975): updating profiles for JABBA
06-07 12:48:37.330: V/CachedBluetoothDevice(11975): Class: 7e010c
06-07 12:48:37.330: V/CachedBluetoothDevice(11975): UUID:
06-07 12:48:37.360: V/CachedBluetoothDevice(11975): 00001000-0000-1000-8000-00805f9b34fb
06-07 12:48:37.390: V/CachedBluetoothDevice(11975): 00001104-0000-1000-8000-00805f9b34fb
06-07 12:48:37.390: V/CachedBluetoothDevice(11975): 00001105-0000-1000-8000-00805f9b34fb
06-07 12:48:37.390: V/CachedBluetoothDevice(11975): 00001106-0000-1000-8000-00805f9b34fb
06-07 12:48:37.410: V/CachedBluetoothDevice(11975): 0000110a-0000-1000-8000-00805f9b34fb
06-07 12:48:37.420: V/CachedBluetoothDevice(11975): 0000110b-0000-1000-8000-00805f9b34fb
06-07 12:48:37.420: V/CachedBluetoothDevice(11975): 0000110c-0000-1000-8000-00805f9b34fb
06-07 12:48:37.420: V/CachedBluetoothDevice(11975): 0000110e-0000-1000-8000-00805f9b34fb
06-07 12:48:37.420: V/CachedBluetoothDevice(11975): 00001112-0000-1000-8000-00805f9b34fb
06-07 12:48:37.440: V/CachedBluetoothDevice(11975): 00001115-0000-1000-8000-00805f9b34fb
06-07 12:48:37.440: V/CachedBluetoothDevice(11975): 0000111b-0000-1000-8000-00805f9b34fb
06-07 12:48:37.470: V/CachedBluetoothDevice(11975): 0000111e-0000-1000-8000-00805f9b34fb
06-07 12:48:37.470: V/CachedBluetoothDevice(11975): 0000111f-0000-1000-8000-00805f9b34fb
06-07 12:48:37.470: V/CachedBluetoothDevice(11975): 00001123-0000-1000-8000-00805f9b34fb
06-07 12:48:37.470: V/CachedBluetoothDevice(11975): 0350278f-3dca-4e62-831d-a41165ff906c
06-07 12:48:37.470: E/CachedBluetoothDevice(11975): onUuidChanged: Time since last connect67267896
06-07 12:48:41.100: E/BluetoothEventLoop.cpp(231): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/10666/hci0/dev_CC_AF_78_B4_F7_6A
06-07 12:48:41.100: D/BluetoothService(231): setRemoteDeviceProperty addr = CC:AF:78:B4:F7:6A name = Connected value = false
06-07 12:48:41.330: V/BluetoothEventRedirector(11975): Received android.bleutooth.device.action.UUID
06-07 12:48:41.350: E/CachedBluetoothDevice(11975): updating profiles for JABBA
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): Class: 7e010c
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): UUID:
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001000-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001104-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001105-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001106-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 0000110a-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 0000110b-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 0000110c-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 0000110e-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001112-0000-1000-8000-00805f9b34fb
06-07 12:48:41.350: V/CachedBluetoothDevice(11975): 00001115-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 0000111b-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 0000111e-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 0000111f-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 00001123-0000-1000-8000-00805f9b34fb
06-07 12:48:41.359: V/CachedBluetoothDevice(11975): 0350278f-3dca-4e62-831d-a41165ff906c
06-07 12:48:41.359: E/CachedBluetoothDevice(11975): onUuidChanged: Time since last connect67271789
Új hozzászólás Aktív témák
- Asus TUF F16 FX607JU 16" QHD+ IPS i7-13650HX RTX 4050 16GB 512GB NVMe magyar vbill gar
- Apple Macbook Air 13,6 M4 10C CPU/8C GPU/16GB/256GB - Ezüst - HUN - mw0w3mg/a - 3 Ciklus 2+ év gari
- Vivo V50 Lite 8/256 5G Black Dual SIM + 90W charger - Új, bontatlan, független - 3 év garancia!
- EliteBook 8 G1i 14 AI 14" FHD+ IPS Ultra 5 235U 16GB 256GB NVMe ujjlolv IR kam gar
- SK Hynix 8GB DDR5 RAM modulok több darab is van // Számla // Garancia //
- Apple iPhone 17 Pro 512GB Bontatlan Független Összes Szín / 27% áfás ár INGYENES SZÁLLÍTÁS
- 216 - Lenovo Legion Slim 7 (16IRH8) - Intel Core i7-13700H, RTX 4060 (ELKELT)
- ÁRGARANCIA!Épített KomPhone Ryzen 7 7800X3D 32/64GB RAM RTX 5070 12GB GAMER PC termékbeszámítással
- Samsung Galaxy S22 / 8/128GB / Kártyafüggetlen / 12Hó Garancia
- Xbox Series S 512 GB + kontroller 6 hó garancia, számlával!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Azt hiszem megoldottam, már csak egy apróság
