태그: App

0

Gatt Server로 부터 알림 받기

특성 값이 변경되면 Gatt 서버에 알림을 요청할 수 있습니다. 12345gatt.setCharacteristicNotification(characteristic, true);BluetoothGattDescriptor descriptor = characteristic.getDescriptor( UUID.fromString("00002902-0000-1

0

Advertising a BLE Device

Bluetooth LE Advertising을 사용하여 먼저 연결하지 않고도 데이터 패키지를 근처의 모든 장치에 브로드 캐스트 할 수 있습니다. Advertising 데이터는 31 바이트로 제한됩니다. 기기 Advertising은 다른 사용자가 나에게 연결하도록하는 첫 번째 단계입니다. 모든 장치가 Bluetooth LE Advertising을 지원하는

0

Gatt Server 사용하기

장치가 주변 장치로 작동하려면 먼저 BluetoothGattServer를 열고 하나 이상의 BluetoothGattService 및 하나의 BluetoothGattCharacteristic로 채워야합니다. 123BluetoothGattServer server=bluetoothManager.openGattServer(context, bluetoothGattS

0

Bluetooth low energy

Bluetooth low energy 개요Android 4.3 (API 레벨 18)부터 중심 역할에 BLE (Bluetooth Low Energy)에 대한 기본 제공 플랫폼 지원을 도입하고 앱이 장치를 검색하고 서비스를 쿼리하고 정보를 전송하는 데 사용할 수있는 API를 제공합니다. 클래식 Bluetooth와 달리 BLE (Bluetooth Low Ener

0

Android NDK를 사용해서 kernel드라이버 사용하기

kernel의 드라이버를 쓰기 위해서는 driver 장치 파일의 write 권한이 있어야 한다.기본적으로 장치 파일의 write 권한은 플랫폼 소스에서 부팅시 *.rc파일을 수정해서 변경 가능하다. 여기서는 앱에서 write 권한을 취득하는 것부터 시작한다. 앱이 파일의 접근 권한을 변경하기 위해서는 su권한이 있어야 한다. 12345678910111213

0

bluetooth로 받은 byte 데이터 분석하기

안드로이드의 Key 이벤트를 발생하기 위해선 INJECT_EVENTS가 필요하다. 해당 권한은 AndroidManifest.xml에 선언해 준다. 1<uses-permission android:name="android.permission.INJECT_EVENTS" /> INJECT_EVENTS 권한을 취득하기 위해선 System App 권한이

0

bluetooth로 받은 byte 데이터 분석하기

앞서 client측에서 마우스 x,y데이터를 보낼때 사용했던 프로토콜을 예로 든다. 여기서 0번째 바이트는 마우스 이동인 것을 알려주기 위해 0x02로 온다.14 바이트는 x값, 58 바이트는 y값이다. 12345678910111213141516171819BufferedInputStream in = null;in = new BufferedInputStre

0

bluetooth로 받은 byte 데이터 분석하기

bluetooth로 받은 데이터는 기본적으로 byte형태이다. String 데이터를 받았다면 String 형으로 변형이 필요하다. 12345678910111213141516BufferedInputStream in = null;in = new BufferedInputStream(socket.getInputStream());byte[] buffer = new

0

App에서 서비스 구동 방법

서비스 생성Android Studio에서 java폴더를 우클릭해 Service를 생성한다. 그 후 MainActivity에서 intent를 사용 서비스를 시작한다. 12345678@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceS

0

bluetooth 클라이언트쪽 스레드 구현

client thread 생성device 리스트에서 device가 선택되면 그 정보를 가지고 ClientThread를 시작한다. 12345678910111213141516171819202122232425262728293031323334353637383940414243444546for (BluetoothDevice device : devices) {