You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/ble/gap.c
+40-48Lines changed: 40 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,13 @@
13
13
#include"ssd1306.h"
14
14
#include"button.h"
15
15
16
+
/**
17
+
* The callback to associate with this advertising procedure. If advertising ends, the event is reported through this callback. If advertising results in a connection, the connection inherits this callback as its event-reporting mechanism.
//The callback to associate with this advertising procedure. If advertising ends, the event is reported through this callback. If advertising results in a connection, the connection inherits this callback as its event-reporting mechanism.
//itvl: These determine how often the devices will "ping-pong" each other and also when they will send any data required. So if you set the value to something like 20, that would mean packets are sent every 25ms, which will obviously consume more power than say a value of 80 (100ms). The reason for the min max values is so the devices can negotiate a compromise for the best possible communication, you can set these to the same value if you prefer.
120
-
.itvl_min= (int)(11.25/1.25), //1.25ms units; laut apple 11.25 minimum fuer hid
121
-
.itvl_max= (int)(20/1.25), //minimum ist laut apple eigentlich 15ms deswegen etwas höher setzen
110
+
.itvl_min= (int)(11.25/1.25), //1.25ms units; according to apple 11.25 minimum for HID
111
+
.itvl_max= (int)(20/1.25), //minimum according to apple actually 15ms therefore slightly higher
122
112
//latency: This is how many "ping-pong" (connection interval) events the slave(server) device is allowed to skip without the client device considering the connection terminated. So if you had a 25ms connection interval and you wanted to sleep for 1 second you could set this value to 40 and the client would consider the connection active for up to 40 skipped intervals.
123
113
.latency=30, //up to 30 connection intervals
124
114
//timeout: This is the absolute (disconnection) timeout, if no packets are received by either device within this time the connection is considered terminated.
125
-
.supervision_timeout=1860/10//10ms units, laut apple größer als itvl_max * (latency + 1) * 3
115
+
.supervision_timeout=1860/10//10ms units, according to apple greater than itvl_max * (latency + 1) * 3
126
116
};
127
117
128
118
//Update connection parameters are not allowed during iPhone HID encryption, slave turns off the ability to automatically update connection parameters during encryption.
// info about BLE pairing: https://community.nxp.com/t5/Wireless-Connectivity-Knowledge/KW36-Enabling-Out-Of-Band-Pairing-on-a-Bluetooth-LE-Central-and/tac-p/1238698
218
207
ESP_LOGI(tag_GAP, "PASSKEY_ACTION_EVENT started \n");
-Unter iOS kann die App [LightBlue](https://punchthrough.com/lightblue/)verwendet werden. Zu beachten ist das Apple bei einigen Diensten nicht die rohen Daten an 3rd party Apps weitergeben [S. 197](https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf). Dadurch können manche Daten nicht gedebugged werden. Ein Service ist beispielsweise HID.
3
-
-Eine weitere Möglichkeit für das Debugging für iOS ist mit einem Macbook auf dem XCode läuft. Dafür gibt es [PacketLogger](https://developer.apple.com/bluetooth/)womit Bluetooth-Pakete live gelogged werden können. Zusätzlich muss auf dem iOS-Gerät ein Logging-Profil heruntergeladen werden und installiert werden.
2
+
-On iOS, the [LightBlue](https://punchthrough.com/lightblue/)app can be used. Note that Apple does not pass the raw data to 3rd party apps for some services [S. 197](https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf). This means that some data cannot be debugged. One service, for example, is HID.
3
+
-Another possibility for debugging for iOS is with a Mac running XCode. For this there is [PacketLogger](https://developer.apple.com/bluetooth/)which can log Bluetooth packets live. Additionally, a logging profile must be downloaded and installed on the iOS device.
4
4
5
5
# Android
6
-
-Unter Android können die Apps [LightBlue](https://punchthrough.com/lightblue/)und[nRF Connect](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=en&gl=US)verwendet werden. Dort können mehr Daten / Dienste wie unter iOS ausgelesen werden.
7
-
- In den Entwickleroptionen kann "Bluetooth HCI-Snoop-Protokoll aktiviert" werden und die Daten gelogged werden und später mittels Wirekshark ausgelesen werden.
6
+
-For Android, the apps [LightBlue](https://punchthrough.com/lightblue/)and[nRF Connect](https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=en&gl=US)can be used. There you can read more data / services as on iOS.
7
+
- In the developer options "Bluetooth HCI snoop protocol can be enabled" and the data can be logged and later inspected using Wirekshark.
@@ -18,52 +18,52 @@ Then Bluetooth daemon won't grab input or hog devices and won't create system in
18
18
19
19
## hcitool
20
20
21
-
### Verfügbares Bluetoothgerät am Linuxrechner
21
+
### Available Bluetooth device at the Linux computer
22
22
`hcitool dev`
23
23
24
24
### Scan for BLE-Devices
25
25
`sudo hcitool lescan`
26
26
27
27
## gatttool
28
28
29
-
### Verbindung aufbauen
29
+
### Establish connection
30
30
1.`sudo gatttool [-t random] -b <BLE ADDRESS> -I`
31
31
2.`connect`
32
32
33
-
### Liste aller vorhandenen Dienste aufzeigen
33
+
### Show list of all existing services
34
34
`primary`
35
35
36
-
### Liste aller vorhandenen Handles
37
-
Jeder Handle ist ein Verbindungspunkt, wo Daten gelesen oder geschrieben werden können.
36
+
### List of all existing handles
37
+
Each handle is a connection point where data can be read or written.
38
38
39
39
`char-desc`
40
40
41
-
### Ein Handle auslesen
41
+
### Read a handle
42
42
`char-read-hnd <handle>`
43
43
44
-
### Schreiben eines Werts in ein Handle
44
+
### Write a value to the handle
45
45
`char-write-req <handle> <data>`
46
46
47
47
## bluetoothctl
48
48
`sudo bluetoothctl`
49
49
50
-
### Geräte suchen
50
+
### Search devices
51
51
`scan le`
52
52
53
-
### Gerät verbinden
53
+
### Connect device
54
54
`connect <BLE ADDRESS>`
55
55
56
-
### Info des Geräts
56
+
### Device info
57
57
`info`
58
58
59
-
### Menü wechseln, damit mit GATT gearbeitet werden kann
59
+
### Change menu to work with GATT
60
60
`menu gatt`
61
61
62
-
#### Attributliste
62
+
#### list all attributes
63
63
`list-attributes`
64
64
65
-
#### Attribut auslesen
66
-
-`select-attribute <Pfad>`
65
+
#### read attribute
66
+
-`select-attribute <path>`
67
67
-`read`
68
68
69
69
## hidraw-dump
@@ -74,11 +74,11 @@ Jeder Handle ist ein Verbindungspunkt, wo Daten gelesen oder geschrieben werden
74
74
-`cd hidraw-dump`
75
75
-`make`
76
76
77
-
### Auslesen aller HID-Deskriptoren
77
+
### GET all HID descriptors
78
78
`sudo ./hidraw-dump`
79
79
80
-
### HID Deskriptor menschen lesbar machen
81
-
Auf dieser [Website](https://eleccelerator.com/usbdescreqparser/) umwandeln.
80
+
### Make HID descriptor human readable
81
+
Use the [website](https://eleccelerator.com/usbdescreqparser/).
82
82
83
83
## Bluepy
84
84
@@ -88,16 +88,16 @@ Auf dieser [Website](https://eleccelerator.com/usbdescreqparser/) umwandeln.
88
88
3.`cd bluepy/bluepy`
89
89
4.`make`
90
90
91
-
### Verwendung
91
+
### Usage
92
92
93
-
#### Starten
93
+
#### start
94
94
`./bluepy-helper`
95
95
96
-
#### Verbinden
96
+
#### connect
97
97
`conn <BT ADDRESS>`
98
98
99
-
#### Liste von Diensten
99
+
#### List of services
100
100
`svcs`
101
101
102
-
## Hinweis:
103
-
- Debugging des XBox controllers hat nur verbunden, wenn man ihn nicht in den Bluetooth-Einstellungen verbunden hatte und wenn mann ihn erst connecting modus bringt wenn man gatttools offen hat und danach connect aufruft. Beim gatttool darf auch nicht die Option random aktiviert sein.
102
+
## Note:
103
+
- Debugging the XBox controller only worked if it was not connected in the Bluetooth settings and if the XBox controller was only switched to connecting mode when gatttools was open and `connect` was called. The option random shouldn't be activated in the gatttool.
0 commit comments