Hirdetés
Ú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
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- AMD Navi Radeon™ RX 9xxx sorozat
- exHWSW - Értünk mindenhez IS
- Android alkalmazások - szoftver kibeszélő topik
- Háztartási gépek
- Torrent meghívó kunyeráló
- Milyen RAM-ot vegyek?
- Tesla topik
- Xbox Series X|S
- Anglia - élmények, tapasztalatok
- További aktív témák...
- Lenovo Thinkpad P1 Gen 6 - i9-13980HX, 32GB, 2TB SSD, 16" WQUXGA (3840 2400), RTX 4090
- 15.gen! Intel Core Ultra 9 285K +16-32GB DDR5 RAM +hűtött VRM-es Z890 lap! GAR/SZÁMLA (a Te nevedre)
- OP AudioCodes C450HD Ip Phones - Szines kijelzős - Teams/ Zoom telefon - Új dobozos
- ATEN Cat 5 KVM over IP Switch Altusen KH1508AI - Új ára 284.000Ft
- AirPort Extreme 802.11n (3rd Generation) Model A1301 -
- BESZÁMÍTÁS! Gigabyte H610M i5 12400F 32GB DDR4 1TB SSD RX 6800 16GB Zalman Z1 Plus Seasonic 750W
- Vivo V50 12/512GB,Újszerű,Adatkabel,12 hónap garanciával
- Realme 9 Pro 128GB, Kártyafüggetlen, 1 Év Garanciával
- GYÖNYÖRŰ iPhone 13 mini 128GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS4077
- ÁRGARANCIA!Épített KomPhone i7 14700KF 32/64GB RAM RTX 5070 12GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: Laptopszaki Kft.
Város: Budapest
Azt hiszem megoldottam, már csak egy apróság


