card10.rst 5.07 KB
Newer Older
1
Bluetooth Card10 Service
Rahix's avatar
Rahix committed
2
========================
3
4
5
6
7
8
9
10
11
12
13
14
15

.. warning::
    The specification is still work in progress

The Card10 Service implemented a direct Hardware access of the card10.

BLE Service
-----------

The current draft uses following service specification:

- Service

genofire's avatar
genofire committed
16
  UUID: ``42230200-2342-2342-2342-234223422342``
17

18
- Time update characteristic:
19

20
  UUID: ``42230201-2342-2342-2342-234223422342``
genofire's avatar
genofire committed
21
  read and write no response
22
23
24

- Vibra characteristic:

genofire's avatar
genofire committed
25
  UUID: ``4223020f-2342-2342-2342-234223422342``
genofire's avatar
genofire committed
26
  write no response
27
28
29

- Rockets characteristic:

genofire's avatar
genofire committed
30
  UUID: ``42230210-2342-2342-2342-234223422342``
31
  read and write no response
32

genofire's avatar
genofire committed
33
34
35
- Background LED Bottom Left characteristic:

  UUID: ``42230211-2342-2342-2342-234223422342``
36
  read and write no response
genofire's avatar
genofire committed
37
38
39
40

- Background LED Bottom Right characteristic:

  UUID: ``42230212-2342-2342-2342-234223422342``
41
  read and write no response
genofire's avatar
genofire committed
42
43
44
45

- Background LED Top Right characteristic:

  UUID: ``42230213-2342-2342-2342-234223422342``
46
  read and write no response
genofire's avatar
genofire committed
47
48
49
50

- Background LED Top Left characteristic:

  UUID: ``42230214-2342-2342-2342-234223422342``
51
  read and write no reponse
genofire's avatar
genofire committed
52

genofire's avatar
genofire committed
53
54
55
- LEDS dim bottom characteristic:

  UUID: ``42230215-2342-2342-2342-234223422342``
genofire's avatar
genofire committed
56
  write with response
genofire's avatar
genofire committed
57
58
59
60

- LEDs dim top characteristic:

  UUID: ``42230216-2342-2342-2342-234223422342``
genofire's avatar
genofire committed
61
  write with response
genofire's avatar
genofire committed
62

63
- LEDs powersafe characteristic:
genofire's avatar
genofire committed
64

65
  UUID: ``42230217-2342-2342-2342-234223422342``
genofire's avatar
genofire committed
66
  write no response
67

genofire's avatar
genofire committed
68
- Flashlight characteristic:
69
70

  UUID: ``42230218-2342-2342-2342-234223422342``
genofire's avatar
genofire committed
71
  write no response
genofire's avatar
genofire committed
72

73
74
75
76
77
- Personal State characteristic:

  UUID: ``42230219-2342-2342-2342-234223422342``
  read and write with response

78
- LEDs above characteristic:
79

80
  UUID: ``42230220-2342-2342-2342-234223422342``
81
  read and write no reponse
82

83
- Light sensor characteristic:
84

85
  UUID: ``422302f0-2342-2342-2342-234223422342``
genofire's avatar
genofire committed
86
  read no response
87

88
Time update characteristic
89
90
---------------------------------

genofire's avatar
genofire committed
91
The time update characteristic makes it possible to set and get the current time given in milliseconds after 1.1.1970 in the UTC timezone. The value is represented as a big endian ``uint64``
92

93
- Thu Aug 15 19:40:45 UTC 2019 : ``0x0 0x0 0x1 0x6c 0x96 0xcb 0xf8 0xcc``
94

95
Vibra characteristic
96
97
98
99
100
101
102
103
104
105
106
---------------------------------

The vibra characteristic makes it possible to let the card10 for given millisecound in a ``uint16`` vibrate.

- One secound: ``0xe803``

Rockets characteristic
---------------------------------

The Rockets characteristic makes it possible to address every three rockets.
Just write there three byte array, one for evey rocket.
107
On read you get the current value of all three rockets.
108
Range is between 0 and 31 (``0x1f``) if send higher value it will set to max of 31.
109

110
111
112
113
114
115

Dataformat:

======= ======= =======
   0       1       2
------- ------- -------
genofire's avatar
genofire committed
116
Rocket0 Rocket1 Rocket2
117
118
======= ======= =======

119
120
- Enable only Rocket0:  ``0x1f0000``
- Enable all rockets with 50% brightness: ``0x0f0f0f``
121

genofire's avatar
genofire committed
122
Background LED <Position> characteristic
Rahix's avatar
Rahix committed
123
----------------------------------------
genofire's avatar
genofire committed
124

genofire's avatar
genofire committed
125
The Background LEDs <Position> characteristic makes it possible to address the bottom LEDs by position.
126
Just write there three ``uint8`` for the rgb color or read the current value.
genofire's avatar
genofire committed
127
128
129
130
131
132
133
134
135
136
137
138

Dataformat:

===== ======= =======
  0      1       2
----- ------- -------
 red   green   blue
===== ======= =======

- set led blue: ``0x0000ff``
- disabled:  ``0x000000``

genofire's avatar
genofire committed
139
LEDs dim <Position> characteristic
Rahix's avatar
Rahix committed
140
----------------------------------
genofire's avatar
genofire committed
141
142
143
144

The LEDs dim <Position> characteristic makes it possible to dim LEDs by position.
Just write a ``uint8`` between ``1`` and ``8``.

145
LEDs powersafe characteristic
genofire's avatar
genofire committed
146
147
---------------------------------

148
149
150
151
This characteristic makes it possible to set the LEDs in powersafe mode.
Even when set to zero, the RGB LEDs still individually consume ~1mA.
Powersave intelligently switches the supply power in groups.
This introduces delays in the magnitude of ~10µs, so it can be disabled for high speed applications such as POV
152

153
154
- enabled:   ``0x01``
- disabled:  ``0x00``
155

156
157
Flashlight characteristic
---------------------------------
158

159
This characteristic makes it possible to activate the flashlight.
160

161
162
163
- enabled:   ``0x01``
- disabled:  ``0x00``

164
165
166
167
168
169
170
Personal state characteristic
---------------------------------
This characteristic makes it possible to read and write the personal state.
It writes always as persistant and it gives feedback if the value is in range and your firmware support it.

- No State ``0x0000``
- No Contact ``0x0100``
171
- Chaos ``0x0200``
172
173
- ...

174
175
LEDs above characteristic
---------------------------------
176
This characteristic set or read the current value of every 11 leds on the top module at once.
genofire's avatar
genofire committed
177
178
179
By defining 11x rgb from left to right. You need also to set exchange a bigger MTU to use this feature.

- set a rainbow beginnig with red on the right edge: ``0xff0000ff8b00e8ff005dff0000ff2e00ffb900b9ff002eff5d00ffe800ffff008b``
180

181
Light sensor characteristic
182
183
---------------------------------

184
185
The light sensor characteristic makes it possible to read the current value of the light sensor by receiving a ``uint16``.
The range of this sensor is between 0 (``0x0``) and 400 (``0x9001``).
186

187
- reading of ``0x0e00`` means **14**