Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Μ
µnit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Teckids
Projekt Hack-n-Fun
Libs
µnit
Compare revisions
4af99c08128202ee6541cf65fa8047aa8b8f73f7 to fdb38a7b2b776b9b0286fb7a59abcb2e031765a5
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
Teckids/hacknfun/libs/mynit
Select target project
No results found
fdb38a7b2b776b9b0286fb7a59abcb2e031765a5
Select Git revision
Branches
bleak
master
Swap
Target
Teckids/hacknfun/libs/mynit
Select target project
Teckids/hacknfun/libs/mynit
schubisu/esp-init
2 results
4af99c08128202ee6541cf65fa8047aa8b8f73f7
Select Git revision
Branches
bleak
master
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Add FIXME note for retries
· 2912cdd1
Nik | Klampfradler
authored
3 years ago
Verified
2912cdd1
Implement handling of remote data
· fdb38a7b
Nik | Klampfradler
authored
3 years ago
Verified
fdb38a7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
companion/app.py
+3
-0
3 additions, 0 deletions
companion/app.py
companion/bluetooth.py
+7
-0
7 additions, 0 deletions
companion/bluetooth.py
with
10 additions
and
0 deletions
companion/app.py
View file @
fdb38a7b
...
@@ -61,6 +61,9 @@ class MynitCompanionApp(App):
...
@@ -61,6 +61,9 @@ class MynitCompanionApp(App):
self
.
widget
.
update_device_buttons
(
buttons_map
)
self
.
widget
.
update_device_buttons
(
buttons_map
)
def
handle_data
(
self
,
data
):
Logger
.
info
(
"
Handling received data: %s
"
%
data
)
def
build
(
self
):
def
build
(
self
):
self
.
widget
=
DeviceListWidget
()
self
.
widget
=
DeviceListWidget
()
return
self
.
widget
return
self
.
widget
This diff is collapsed.
Click to expand it.
companion/bluetooth.py
View file @
fdb38a7b
...
@@ -38,6 +38,7 @@ class MynitBluetooth(BluetoothDispatcher):
...
@@ -38,6 +38,7 @@ class MynitBluetooth(BluetoothDispatcher):
def
on_scan_completed
(
self
):
def
on_scan_completed
(
self
):
if
self
.
_device
:
if
self
.
_device
:
# FIXME Add retries
self
.
connect_gatt
(
self
.
_device
)
self
.
connect_gatt
(
self
.
_device
)
def
on_connection_state_change
(
self
,
status
,
state
):
def
on_connection_state_change
(
self
,
status
,
state
):
...
@@ -56,3 +57,9 @@ class MynitBluetooth(BluetoothDispatcher):
...
@@ -56,3 +57,9 @@ class MynitBluetooth(BluetoothDispatcher):
def
on_services
(
self
,
status
,
services
):
def
on_services
(
self
,
status
,
services
):
Logger
.
info
(
"
Services discovered
"
)
Logger
.
info
(
"
Services discovered
"
)
self
.
_characteristics
=
(
services
.
search
(
_UART_SERVICE_TX_UUID
),
services
.
search
(
_UART_SERVICE_RX_UUID
))
self
.
_characteristics
=
(
services
.
search
(
_UART_SERVICE_TX_UUID
),
services
.
search
(
_UART_SERVICE_RX_UUID
))
self
.
enable_notifications
(
self
.
_characteristics
[
1
])
def
on_characteristic_changed
(
self
,
characteristic
):
Logger
.
info
(
"
Data received
"
)
data
=
characteristic
.
getStringValue
(
0
)
self
.
_app
.
handle_data
(
data
)
This diff is collapsed.
Click to expand it.