Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Companion App Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Andy B-S
Companion App Android
Commits
2e486633
Commit
2e486633
authored
Aug 23, 2019
by
Stefan Zabka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ble:card10 personal state sending the correct byte array now
parent
c2466320
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
app/src/main/java/de/ccc/events/badge/card10/Constants.kt
app/src/main/java/de/ccc/events/badge/card10/Constants.kt
+5
-6
app/src/main/java/de/ccc/events/badge/card10/time/Card10Service.kt
...ain/java/de/ccc/events/badge/card10/time/Card10Service.kt
+6
-7
No files found.
app/src/main/java/de/ccc/events/badge/card10/Constants.kt
View file @
2e486633
...
...
@@ -51,12 +51,11 @@ val FLASHLIGHT_CHARACTERISTIC_UUID = UUID.fromString("42230218-2342-2342-2342-23
val
PERSONAL_STATE_CHARACTERISTIC_UUID
=
UUID
.
fromString
(
"42230219-2342-2342-2342-234223422342"
)
enum
class
PersonalState
(
val
v
:
Int
)
{
NONE
(
0x0000
),
NO_CONTACT
(
0x0100
),
CHAOS
(
0x0200
),
COMMUNICATION
(
0x0300
),
CAMP
(
0x0400
)
NONE
(
0x0000
),
NO_CONTACT
(
0x0100
),
CHAOS
(
0x0200
),
COMMUNICATION
(
0x0300
),
CAMP
(
0x0400
)
}
val
LEDS_ABOVE_CHARACTERISTIC_UUID
=
UUID
.
fromString
(
"42230220-2342-2342-2342-234223422342"
)
...
...
app/src/main/java/de/ccc/events/badge/card10/time/Card10Service.kt
View file @
2e486633
...
...
@@ -41,7 +41,7 @@ class Card10Service(
timeCharacteristic
.
writeType
=
BluetoothGattCharacteristic
.
WRITE_TYPE_NO_RESPONSE
rocketsCharacteristic
.
writeType
=
BluetoothGattCharacteristic
.
WRITE_TYPE_NO_RESPONSE
ledsAboveCharacteristic
.
writeType
=
BluetoothGattCharacteristic
.
WRITE_TYPE_NO_RESPONSE
personalStateCharacteristic
.
writeType
=
BluetoothGattCharacteristic
.
WRITE_TYPE_
DEFAULT
personalStateCharacteristic
.
writeType
=
BluetoothGattCharacteristic
.
WRITE_TYPE_
NO_RESPONSE
}
fun
setTime
()
{
...
...
@@ -62,11 +62,10 @@ class Card10Service(
}
fun
setPersonalState
(
value
:
PersonalState
)
{
personalStateCharacteristic
.
value
=
ByteArray
(
2
)
personalStateCharacteristic
.
value
[
0
]
=
value
.
v
.
toByte
()
personalStateCharacteristic
.
value
[
1
]
=
(
value
.
v
shr
8
).
toByte
()
println
(
"=== Writing personal State array : ${personalStateCharacteristic.value[0]},${personalStateCharacteristic.value[1]} "
)
ConnectionService
.
writeCharacteristic
(
personalStateCharacteristic
)
personalStateCharacteristic
.
value
=
ByteArray
(
2
)
personalStateCharacteristic
.
value
[
0
]
=
value
.
v
.
toByte
()
personalStateCharacteristic
.
value
[
1
]
=
(
value
.
v
shr
8
).
toByte
()
println
(
"=== Writing personal State array : ${personalStateCharacteristic.value[0]},${personalStateCharacteristic.value[1]} "
)
ConnectionService
.
writeCharacteristic
(
personalStateCharacteristic
)
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment