Commit Graph

276 Commits (a8d864144299c95d4ba760a7d1b2bdab37edb298)

Author SHA1 Message Date
Peter Hutterer f293ef6e14 dbus: use the logging class too 2018-01-15 16:14:11 +10:00
Peter Hutterer febde33f0a ble: wrap the DBus properties into property functions 2018-01-15 16:14:11 +10:00
Peter Hutterer 6de262d2e9 ble: more documentation 2018-01-15 16:14:11 +10:00
Peter Hutterer 35e75b4aa7 ble: match the disconnected signal with 'connect'
No need to pass self as argument, it's the first argument to the signal
handler anyway
2018-01-15 16:14:11 +10:00
Peter Hutterer 20b78b89b7 wacom: remove superfluous time.sleep()
Leftover from an earlier debugging process
2018-01-15 16:14:11 +10:00
Peter Hutterer f3a39ee57c ble: remove leftover wacom-specific code 2018-01-15 16:14:11 +10:00
Peter Hutterer 4ec3069f78 ble: add two FIXMEs, we need to handle ServicesResolved
Connected can be True when ServicesResolved is False but without the latter we
can't do anything.
2018-01-15 11:59:57 +10:00
Peter Hutterer e29c201756 ble: remove obsolete comment
Filtering is done a layer above now
2018-01-15 11:50:52 +10:00
Peter Hutterer 5336f02df1 wacom: use int.from_bytes to convert from signed char to int 2018-01-15 11:34:46 +10:00
Peter Hutterer 1527fae191 wacom: replace the list2le/be helpers with int.from_bytes 2018-01-15 11:34:46 +10:00
Peter Hutterer c64446b48c ble: drop unused objectpath variable 2018-01-15 11:34:46 +10:00
Peter Hutterer c4b0807c3c dbusserver: emit the bus-name-owned when we have the bus
And rename from 'owned' to 'acquired', that's better english
2018-01-15 09:14:29 +10:00
Benjamin Tissoires 0d88d9d0e7 ble: fix flake8 warnings
./tuhi/ble.py:14:1: F401 'sys' imported but unused
./tuhi/ble.py:15:1: F401 'enum.Enum' imported but unused
./tuhi/ble.py:16:1: F401 'gi.repository.GLib' imported but unused
./tuhi/ble.py:26:1: E302 expected 2 blank lines, found 1
./tuhi/ble.py:81:1: W293 blank line contains whitespace
./tuhi/ble.py:84:13: E126 continuation line over-indented for hanging indent
./tuhi/ble.py:85:17: E131 continuation line unaligned for hanging indent
./tuhi/ble.py:203:39: F821 undefined name 'WACOM_CHRC_LIVE_PEN_DATA_UUID'
./tuhi/ble.py:204:38: E128 continuation line under-indented for visual indent
./tuhi/ble.py:205:39: F821 undefined name 'WACOM_OFFLINE_CHRC_PEN_DATA_UUID'
./tuhi/ble.py:206:38: E128 continuation line under-indented for visual indent
./tuhi/ble.py:207:39: F821 undefined name 'NORDIC_UART_CHRC_RX_UUID'
./tuhi/ble.py:208:38: E128 continuation line under-indented for visual indent
./tuhi/ble.py:232:1: E302 expected 2 blank lines, found 1
./tuhi/ble.py:240:13: E126 continuation line over-indented for hanging indent
./tuhi/ble.py:241:17: E131 continuation line unaligned for hanging indent
./tuhi/ble.py:250:21: E126 continuation line over-indented for hanging indent
./tuhi/ble.py:263:43: W291 trailing whitespace
./tuhi/ble.py:272:72: W291 trailing whitespace
./tuhi/ble.py:310:1: W391 blank line at end of file

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-01-12 20:23:47 +01:00
Benjamin Tissoires af42bc1b27 dbusserver.py: fix flake8 warnings
./tuhi/dbusserver.py:55:1: E302 expected 2 blank lines, found 1
./tuhi/dbusserver.py:75:17: E126 continuation line over-indented for hanging indent
./tuhi/dbusserver.py:77:29: E203 whitespace before ':'
./tuhi/dbusserver.py:155:13: E126 continuation line over-indented for hanging indent
./tuhi/dbusserver.py:156:17: E131 continuation line unaligned for hanging indent

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-01-12 20:23:47 +01:00
Benjamin Tissoires 3491ff68e4 wacom: fix flake8 warnings
tuhi/wacom.py:18:1: F401 'sys' imported but unused
tuhi/wacom.py:22:1: F401 'tuhi.dbusserver.TuhiDBusServer' imported but unused
tuhi/wacom.py:23:1: F401 'tuhi.ble.BlueZDeviceManager' imported but unused
tuhi/wacom.py:52:1: E302 expected 2 blank lines, found 1
tuhi/wacom.py:140:13: E126 continuation line over-indented for hanging indent
tuhi/wacom.py:141:17: E131 continuation line unaligned for hanging indent
tuhi/wacom.py:592:1: W391 blank line at end of file

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-01-12 20:23:47 +01:00
Benjamin Tissoires 79a95bbe18 Handle tablet orientation
It didn't make quite sense to have y before x, and with some inverted
x value. The sensors are designed in the landscape mode, and the rotation
needs to be determined in the software.
Implement an orientation parameter to WacomDevice so we always have
normal X and Y

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-01-12 20:23:47 +01:00
Benjamin Tissoires bbeca669e2 wacom: turn back the log lines to be greater than 79 chars
It's better to have a full log on one line. However, flake8 now complains.
I am not that happy with this situation, we should figure out a way
to selectively disable the length check for logger messages only.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-01-12 20:23:47 +01:00
Benjamin Tissoires 7437cb6f93 wacom: opcode 0xeeff is the time since boot
This is an actual timestamp

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-01-12 20:23:47 +01:00
Benjamin Tissoires b49225c890 wacom: add helpers for big/little endian conversions
There is for sure some standard ones, but this will fit in the meantime.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-01-12 19:50:23 +01:00
Benjamin Tissoires bbded4f558 wacom: fix slate logging
leftover from a conversion

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2018-01-12 19:42:55 +01:00
Peter Hutterer 4aca12b6e7 Add the signals to expose the device over Tuhi's DBus interface
bus_own_name is asynchronous, so we first need to send a signal back and then
we can start connecting to the devices. Otherwise we'll have to implement a
queue which would be a lot harder than just waiting.
2018-01-12 20:32:09 +10:00
Peter Hutterer 8e907ba81a wacom: notify via signal when a drawing is available 2018-01-12 16:18:40 +10:00
Peter Hutterer 723282eb56 wacom: make the stroke object more generic, less SVG 2018-01-12 16:18:20 +10:00
Peter Hutterer d214778a1c Add the wacom nordic communication bits
Mostly copy/paste from an earlier project. Needs some more cleanup for
integration with Tuhi
2018-01-12 16:11:00 +10:00
Peter Hutterer bf2c000b57 Add a BLE abstraction layer 2018-01-12 16:00:24 +10:00
Peter Hutterer 89cf8ef67d Add the basic DBus server implementation 2018-01-12 07:46:06 +10:00