星期三, 05. 九月 2018 02:03上午 – beautifulzzzz

Daydream

home88一必发 1

android.bluttooth

1、前言

上风度翩翩篇讲了什么编写翻译安吹牛lueZ-5,本篇首要在于玩BlueZ,用命令行去操作BLE设备:

  • [BlueZ] 1、Download install and use the BlueZ and hcitool on PI
    3B+

home88一必发 2

Virtual
Reality High
Performance

提供管理蓝牙5.0作用的类,例如对设备的围观,连接装置,和管理设施之间的传输数据。蓝牙5.0API帮衬优良Bluetooth和低功耗蓝牙5.0。

2、gatttool —— 老工具趟坑

刚起头跟着 Get Started with Bluetooth Low Energy on
Linux
操作gatttool,开掘坑太多(主因是工具老了):

采用sudo gatttool -b 4D:69:98:0E:91:5E -I去连接
发觉会报错:Error: connect error: Connection refused (111)
最终参照他事他说加以侦察LINK-11开掘必要加random选项([#1](https://stackoverflow.com/questions/32947807/cannot-connect-to-ble-device-on-raspberry-pi))

➜  ~  sudo gatttool -b 4D:69:98:0E:91:5E -I
[4D:69:98:0E:91:5E][LE]> connect
Attempting to connect to 4D:69:98:0E:91:5E
Error: connect error: Connection refused (111)
[4D:69:98:0E:91:5E][LE]> exit
➜  ~  sudo gatttool  -t random  -b 4D:69:98:0E:91:5E -I
[4D:69:98:0E:91:5E][LE]> connect
Attempting to connect to 4D:69:98:0E:91:5E
Connection successful
[4D:69:98:0E:91:5E][LE]> 
(gatttool:3104): GLib-WARNING **: Invalid file descriptor.

过三回会10S活动断开,互连网说那些工具岁数大了,不提出用了([#2](https://www.spinics.net/lists/linux-bluetooth/msg67617.html)):

There are new tools to use with GATT, bluetoothctl/bluetoothd is the preferred since with that you have GAP, etc, 
but if want to use a stand alone tool then I suggest you use btgatt-client.

home88一必发 3

googlevr

Provides classes that manage Bluetooth functionality, such as scanning
for devices, connecting with devices, and managing data transfer between
devices. The Bluetooth API supports both “Classic Bluetooth” and
Bluetooth Low Energy.

3、bluetoothctl——NB的新工具

指令行步向bluetoothctl操作情形([#6](https://mcuoneclipse.com/2016/12/19/tutorial-ble-pairing-the-raspberry-pi-3-model-b-with-hexiwear/))

bluetoothctl

自家在小叔子大上用lightblue模拟一个BLE设备ty_prod,之后对其service举行退换,调用scan
on实行检索依旧老的,
最后开掘要先用remove移除以前的器具,之后再scan就能够冒出[NEW] Device 72:3B:E1:81:4E:4F ty_prod设备
注: 用lightblue模拟的装置的MAC不是定点的
注:
笔者发觉在lightblue中不管怎么模拟BLE设备,风流倜傥旦被连上寻找到的service都以IPone的

[bluetooth]# devices
Device 28:ED:6A:A0:26:B7 ty_prod
Device 58:71:33:00:00:24 Bluetooth Keyboard
Device 00:1A:7D:DA:71:0A SHEN-PC
Device 94:87:E0:B3:AC:6F Mi Phone
[bluetooth]# remove 28:ED:6A:A0:26:B7 
...
[bluetooth]# scan on
Discovery started
[NEW] Device 72:3B:E1:81:4E:4F ty_prod
[bluetooth]# scan off
...
Discovery stopped
[bluetooth]# connect 72:3B:E1:81:4E:4F
Attempting to connect to 72:3B:E1:81:4E:4F
[CHG] Device 72:3B:E1:81:4E:4F Connected: yes
Connection successful
[ty_prod]

干脆就用IPhone自带的劳务做测量检验了~

[ty_prod]# info
Device 28:ED:6A:A0:26:B7 (public)
    Name: tuya_mdev_test
    Alias: tuya_mdev_test
    Appearance: 0x0040
    Icon: phone
    Paired: yes
    Trusted: no
    Blocked: no
    Connected: yes
    LegacyPairing: no
    UUID: Fax                       (00001111-0000-1000-8000-00805f9b34fb)
    UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
    UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
    UUID: Current Time Service      (00001805-0000-1000-8000-00805f9b34fb)
    UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
    UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
    UUID: Vendor specific           (7905f431-b5ce-4e99-a40f-4b1e122d00d0)
    UUID: Vendor specific           (89d3502b-0f36-433a-8ef4-c502ad55f8dc)
    UUID: Vendor specific           (9fa480e0-4967-4542-9390-d343dc5d04ae)
    UUID: Vendor specific           (d0611e78-bbb4-4591-a5f8-487910ae4366)
[CHG] Device 28:ED:6A:A0:26:B7 ServicesResolved: no
[CHG] Device 28:ED:6A:A0:26:B7 Connected: no

我们用Current Time Service,列出具备attributes操作如下:

[tuya_mdev_test]# menu gatt
[tuya_mdev_test]# list-attributes 28:ED:6A:A0:26:B7
...
Primary Service
    /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0041
    00001805-0000-1000-8000-00805f9b34fb
    Current Time Service
Characteristic
    /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0041/char0045
    00002a0f-0000-1000-8000-00805f9b34fb
    Local Time Information
Characteristic
    /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0041/char0042
    00002a2b-0000-1000-8000-00805f9b34fb
    Current Time
Descriptor
    /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0041/char0042/desc0044
    00002902-0000-1000-8000-00805f9b34fb
    Client Characteristic Configuration
...

上面Current Time Service对应的服务如下图:

home88一必发 4

大家选用Current Time举办操作UUID:0x2A2B

[ty_prod]# select-attribute /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0041/char0042
[tuya_mdev_test:/service0041/char0042]# read
Attempting to read /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0041/char0042
[CHG] Attribute /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0041/char0042 Value:
  e2 07 09 05 01 24 11 03 f1 02                    .....$....      
  e2 07 09 05 01 24 11 03 f1 02                    .....$.... 
[tuya_mdev_test:/service0041/char0042]# attribute-info
Characteristic - Current Time
    UUID: 00002a2b-0000-1000-8000-00805f9b34fb
    Service: /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0041
    Value:
  e2 07 09 05 01 2e 01 03 f5 02                    ..........      
    Notifying: yes
    Flags: read
    Flags: notify

读出结果大概意思应该是:2018-9/5-1:36:17 周三

读取一下0x180A的Device Information:

[tuya_mdev_test:/service0006/char0007]# select-attribute /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0047/char004a
[tuya_mdev_test:/service0047/char004a]# attribute-info
Characteristic - Model Number String
    UUID: 00002a24-0000-1000-8000-00805f9b34fb
    Service: /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0047
    Flags: read
[tuya_mdev_test:/service0047/char004a]# read
Attempting to read /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0047/char004a
[CHG] Attribute /org/bluez/hci0/dev_47_B1_26_C1_81_18/service0047/char004a Value:
  69 50 68 6f 6e 65 36 2c 32                       iPhone6,2       
  69 50 68 6f 6e 65 36 2c 32                       iPhone6,2    

本来写、使能notify也超级轻易,看help就可以。最终断开连接、并退出!!!

[tuya_mdev_test:/service0047/char004a]# disconnect 28:ED:6A:A0:26:B7
Attempting to disconnect from 28:ED:6A:A0:26:B7
[CHG] Device 28:ED:6A:A0:26:B7 ServicesResolved: no
Successful disconnected
[CHG] Device 28:ED:6A:A0:26:B7 Connected: no
[bluetooth]# quit

home88一必发 5

Google
VR for Android

至于非常多任何的精湛蓝牙5.0音信。能够看蓝牙5.0指南。有关非常多别的的低功耗蓝牙5.0的音信,能够看BLE指南。

LINKS

[1].Cannot connect to BLE device on Raspberry
Pi
[2].Invalid file descriptor gatttool of bluez
5.32
[3].Get Started with Bluetooth Low Energy on
Linux
[4].Reverse Engineering a Bluetooth Low Energy Light
Bulb
[5].Doing Bluetooth Low Energy on
Linux
[6].Tutorial: BLE Pairing the Raspberry Pi 3 Model B with
Hexiwear

home88一必发 6

@beautifulzzzz
智能硬件、物联网,热爱技术,关注产品
博客:http://blog.beautifulzzzz.com
园友交流群:414948975

GVR SDK
and NDK Release
Notes

For more information about Classic Bluetooth, see
the Bluetooth guide.
For more information about Bluetooth Low Energy, see the Bluetooth Low
Energy (BLE)
guide.

http://www.apkmirror.com/apk/google-inc

Bluetooth APIs 能够使得应用具有下边效能:

com.google.vr.vrcore

1.对此此外的蓝牙5.0设备的扫描(包蕴BLE设备卡塔尔(قطر‎

com.google.android.vr.home

2.为配没有错蓝牙( Bluetooth® 卡塔尔国设备查询本地蓝牙5.0适配器

Google
Inc. Daydream
(Daydream)

3.建立RFCOMM channels/sockets.

Google
Inc. Google VR Services
(Daydream)

4.老是在任何装备上点名的sockets

What is
Google
Daydream

5.与其他设备之间数据传输

Daydream Performance
HUD

6.与BLE设备沟通。举例相似传感器,心率监视器,健身设备,等等

Daydream
Controller手柄数据的解析

7.作为GATTclient或GATT服务端

How do I
fix my Daydream
controller

行使那一个APIs来终止Bluetooth之间的调换,二个应用程序必须注脚BLUETOOTH权力。对于一些非常的效果。如诉求设备发掘,也必得BLUETOOTH_ADMIN权限。

Google
Daydream Controller
Teardown

唤醒:不是整整的Android设备都提供了蓝牙( Bluetooth® 卡塔尔(英语:State of Qatar)( Bluetooth® 卡塔尔国功用。

Daydream
controller : Comprehensive
guide

The Bluetooth APIs let applications:

Use the
Daydream View controller and
headset

  • Scan for other Bluetooth devices (including BLE devices).
  • Query the local Bluetooth adapter for paired Bluetooth devices.
  • Establish RFCOMM channels/sockets.
  • Connect to specified sockets on other devices.
  • Transfer data to and from other devices.
  • Communicate with BLE devices, such as proximity sensors, heart rate
    monitors, fitness devices, and so on.
  • Act as a GATT client or a GATT server (BLE).

谷歌Daydream
VXC90平台应用供给:怎样统筹V奔驰M级应用

To perform Bluetooth communication using these APIs, an application must
declare the BLUETOOTH permission. Some additional functionality, such
as requesting device discovery, also requires
the BLUETOOTH_ADMIN permission.

 

Note: Not all Android-powered devices provide Bluetooth
functionality.

Algorithm

接口:

BluetoothAdapter.LeScanCallback
:用来提供LE扫描结果的回调接口

BluetoothProfile:Bluetooth
Profiles的公共APIs

BluetoothProfile.ServiceListener:Bluetooth( Bluetooth® 卡塔尔(قطر‎Profile
IPC client与service的连接和断开时的三个布告接口

Conversion
Quaternion to
Euler

Interfaces


BluetoothAdapter.LeScanCallback Callback interface used to deliver LE scan results. 
BluetoothProfile Public APIs for the Bluetooth Profiles. 
BluetoothProfile.ServiceListener An interface for notifying BluetoothProfile IPC clients when they have been connected or disconnected to the service. 

Conversion
Euler to
Quaternion

类:

BluetoothA2dp:那么些类提供调节蓝牙5.0( Bluetooth® 卡塔尔A2DP profile的公共APIs

BluetoothAdapter:代表本地设备的蓝牙5.0( Bluetooth® 卡塔尔adapter.
BluetoothAssignedNumbers:Bluetooth分配号码

BluetoothClass:代表叁个蓝牙( Bluetooth® 卡塔尔(英语:State of Qatar)类。它形容陈说了配备的貌似特征(characteristics卡塔尔(英语:State of Qatar)和才具(capabilities卡塔尔(قطر‎

BluetoothClass.Device:定义全体器材类的常量

BluetoothClass.Device.Major:定义全体第意气风发设施类的常量

BluetoothClass.Service:定义全体服务类的常量

BluetoothDevice:代表四个远程Bluetooth设备

=============================================================================================

BluetoothGatt:蓝牙GATT
Profile的公共APIs

BluetoothGattCallback:这么些抽象类用于落到实处蓝牙( Bluetooth® 卡塔尔Gatt回调

BluetoothGattCharacteristic:代表多个蓝牙5.0GATT Characteristic.

                                              一个GATT
Characteristic是用来构造二个GATT
service,BluetoothGattService的着力数据成分

BluetoothGattDescriptor:代表多少个蓝牙( Bluetooth® 卡塔尔国GATT Descriptor.

                                           GATT Descriptor包涵一个GATT
characteristic,BluetoothGattCharacteristic的额外新闻和属性.

Classes


BluetoothA2dp This class provides the public APIs to control the Bluetooth A2DP profile. 
BluetoothAdapter Represents the local device Bluetooth adapter. 
BluetoothAssignedNumbers Bluetooth Assigned Numbers. 
BluetoothClass Represents a Bluetooth class, which describes general characteristics and capabilities of a device. 
BluetoothClass.Device Defines all device class constants. 
BluetoothClass.Device.Major Defines all major device class constants. 
BluetoothClass.Service Defines all service class constants. 
BluetoothDevice Represents a remote Bluetooth device. 
BluetoothGatt Public API for the Bluetooth GATT Profile. 
BluetoothGattCallback This abstract class is used to implement BluetoothGatt callbacks. 
BluetoothGattCharacteristic Represents a Bluetooth GATT Characteristic

A GATT characteristic is a basic data element used to construct a GATT service,BluetoothGattService

BluetoothGattDescriptor Represents a Bluetooth GATT Descriptor

GATT Descriptors contain additional information and attributes of a GATT characteristic,BluetoothGattCharacteristic

BluetoothGattServer Public API for the Bluetooth GATT Profile server role. 
BluetoothGattServerCallback This abstract class is used to implement BluetoothGattServer callbacks. 
BluetoothGattService Represents a Bluetooth GATT Service

Gatt Service contains a collection of BluetoothGattCharacteristic, as well as referenced services. 

BluetoothHeadset Public API for controlling the Bluetooth Headset Service. 
BluetoothHealth Public API for Bluetooth Health Profile. 
BluetoothHealthAppConfiguration The Bluetooth Health Application Configuration that is used in conjunction with the BluetoothHealthclass. 
BluetoothHealthCallback This abstract class is used to implement BluetoothHealth callbacks. 
BluetoothManager High level manager used to obtain an instance of an BluetoothAdapter and to conduct overall Bluetooth Management. 
BluetoothServerSocket A listening Bluetooth socket. 
BluetoothSocket A connected or connecting Bluetooth socket. 

BluetoothGattServer:蓝牙5.0( Bluetooth® 卡塔尔GATT Profileserver剧中人物的公共APIs.

BluetoothGattServerCallback:那些抽象类用于落到实处BluetoothGattServer回调.

BluetoothGattService:代表多少个蓝牙5.0( Bluetooth® 卡塔尔GATT Service.

================================================================================

BluetoothHeadset:调节Bluetooth动铁耳机(Headset卡塔尔服务的公共API.

BluetoothHealth:蓝牙Health
Profile的公共API.

BluetoothHealthAppConfiguration:The
Bluetooth Health Application
Configuration(配置)用来与BluetoothHealth类结合.

BluetoothHealthCallback:用于落到实处BluetoothHealth回调的抽象类

BluetoothManager:用来得到BluetoothAdapter的实例的首长,实行周全的蓝牙5.0管理

BluetoothServerSocket:二个监听蓝牙( Bluetooth® 卡塔尔(قطر‎的socket

BluetoothSocket:二个已接连或正在连接的蓝牙5.0socket.

 

ATW

Timewarp

Asynchronous
timewarp

How Does
Time Warping Work

Difference_between_ATW_ASW_and_Reprojection 

 

Bluetooth

Bluetooth Core
Specification

HID-over-GATT

NordicSemiconductor

Dialog-semiconductor

SmartBond™
DA14681

Android
Bluetooth Low
Energy

Nordic SDK and
Documentation

Calculate
throughput for a BLE
link

Introduction to
Bluetooth Low
Energy

Android
Lollipop: Bluetooth LE
Matures

Bluetooth Low
Energy vs. Classic
Bluetooth

Getting
Started with Bluetooth Low
Energy

Maximizing BLE
Throughput on iOS and
Android

How
different BLE packet types influence
throughput

Analysis
of Latency Performance of Bluetooth Low Energy (BLE)
Networks

FTS4BT™
Bluetooth® Protocol Analyzer and Packet
Sniffer

CPAS-11(Frontline_16.10.12321.12610)

 

Latency

Front
Buffer
Rendering

Reducing
latency in mobile VR by using single buffered strip
rendering

The
importance of fine-grained GPU preemption support for
VR

 

Tools

dotPeek

 

Touch

IQS525-B000

 

Unity

Unity
Editor and Android Runtime for
Daydream

Unity
Download

GVR-Unity-SDK

Unity3d
Quaternion

Unity优化技术

四元数(Quaternion)和旋转

 

Qualcomm

依附骁龙
VTucson SDK的V途达图形优化

 

EGL

EGL10

Tracer
for OpenGL
ES

相关文章