Hexxeh/libpebble — pull request #15 by zulak (2013-04-12 17:50:26+00:00)
Title: Adds Watchface SDK support to libpebble

* Adds improved support for new PebbleProtocol messages used by the Pebble Watchface SDK
* Includes experimental support for Bluetooth communication via lightblue on OS X and Linux.

Squashed commit of the following:

commit c6be3b3c5d933acb92495f74f493d85c28cdfc75
Merge: ed215bb 80a371a
Author: Paul McInnis
Date: Thu Apr 11 12:36:42 2013 -0700

Merge pull request #7 from pebble/launch-on-install

User-side Improvements

commit 80a371a5308f4d8d89d2b19b5474bf4447005118
Author: Paul McInnis
Date: Thu Apr 11 11:52:55 2013 -0700

Give ping a default value as 0 doesn't get returned from LightBluePebble

commit ed215bbe0c782eba0e69e8a9becde23e50906b74
Author: Paul McInnis
Date: Wed Apr 10 19:39:53 2013 -0700

Update README.md

commit 5ce56b83858745cca9c52eb70e21dcd59cf739e3
Author: Paul McInnis
Date: Wed Apr 10 19:12:55 2013 -0700

Make launching on install an option in the arg parser

commit 74f983a7fbee124d7e69e53626450dcdd673957e
Author: Paul McInnis
Date: Wed Apr 10 19:00:15 2013 -0700

Added the launch on install feature and made the uuid usage more consistant

commit 0469d8fc861423df000bb5645215f204dc53fa8b
Author: Paul McInnis
Date: Wed Apr 10 16:54:08 2013 -0700

Update README.md

commit 09f43a4e0ca5c68c300d3d901ef1c3a295c418c3
Author: follower
Date: Wed Apr 10 17:55:39 2013 +1200

Fix typo.

commit 5f5bb0c49bba8f3f9858073fe39b10aa35d5f03a
Author: follower
Date: Wed Apr 10 17:54:26 2013 +1200

Fix typo.

commit 6b66262dbb4d4de9202e8420d74bc6bce195dd6b
Author: Martijn The
Date: Tue Apr 9 15:41:11 2013 -0700

Update README.md

Typo

commit 119633198e75c7350fd708dc222caacbada7c839
Merge: 662d199 939061e
Author: Paul McInnis
Date: Mon Apr 8 11:57:52 2013 -0700

Merge pull request #5 from pebble/feature-launch-by-uuid

Added missing endpoints for Application messages and Launcher messages

commit 939061e44aa50d895747f404a91d2e2072e2da73
Author: Paul McInnis
Date: Fri Apr 5 16:34:50 2013 -0700

User itertools to flatten the tuple of tuples
Use run_key correctly
Other PR commentary

commit 662d199f327bba336305d09f6231719bc7bf2b8a
Author: Paul McInnis
Date: Wed Apr 3 19:20:10 2013 -0700

Update README.md

commit 1b262869d3ce6725d2c525d32de9ea324ebb0348
Author: Paul McInnis
Date: Wed Apr 3 17:41:57 2013 -0700

Update README.md

commit 3eeb043460629363215c9909169853482fe04ce1
Merge: e6a63e0 2428e8a
Author: Paul McInnis
Date: Wed Apr 3 12:59:01 2013 -0700

Merge pull request #4 from pebble/feature-remove-app-by-uuid

added app reinstallation with uuid feature

commit 2428e8a88f75789aa533f3c9d0b127cd5b0bfb4f
Author: Paul McInnis
Date: Wed Apr 3 12:58:29 2013 -0700

Fixed segfault issue by overriding SIGINT to close the connection before exit(0)

commit 9937072b0c13fc5affa9e0b6f76871d6bd88d6ad
Author: Paul McInnis
Date: Wed Apr 3 12:18:05 2013 -0700

Moved the tools to build an app message into their own class.

commit 53c48494ab23d99f27b56994eed2f0c0f2984d2a
Author: Paul McInnis
Date: Tue Apr 2 20:43:19 2013 -0700

Moved all message building into methods for use in building app_messages that may have more than one tuple.

commit 37008f5a61b9c51480dd824cba7e7bd2e6c6faed
Author: Paul McInnis
Date: Tue Apr 2 18:09:48 2013 -0700

uuid_to_remove is string: --> uuid_is_string

commit 229f86a5badfb3b15553dd265be65598abc3dcfe
Author: Paul McInnis
Date: Tue Apr 2 18:07:21 2013 -0700

uuid --> app_uuid

commit e420d91572800995805eb770c61cc23164167a46
Author: Paul McInnis
Date: Tue Apr 2 18:04:26 2013 -0700

improve uuid handling

commit 87c429c39417d3e486cfa785d19d98bf3424950f
Author: Paul McInnis
Date: Tue Apr 2 17:37:13 2013 -0700

Added missing endpoints for Application messages and Launcher messages
Added endpoint handler
Added ability to launch an application over bluetooth
* NEXT: make a put-bytes style client to parse messages to and from the application.

commit 2302f391c93d444b527637b2a03822247140d48c
Author: Paul McInnis
Date: Fri Mar 29 17:10:08 2013 -0700

Added an endpoint for App_Manager so that app installation/reinstallation can be Asynchronous
Improve uninstall behaviour
Address matt's PR responses

commit 946f55cca8c681be215179263997ca3e52857a83
Merge: a63325c e6a63e0
Author: Martijn The
Date: Fri Mar 29 16:55:09 2013 -0700

Merge branch 'lightblue' into feature-remove-app-by-uuid

commit a63325c7f9fb3add4ab2a180653203a2b626e9aa
Author: Paul McInnis
Date: Fri Mar 29 11:44:16 2013 -0700

added app reinstallation with uuid feature

commit e6a63e05107afb99331ffa9a19049ce435616f28
Merge: 7dfb73e 5fff3b5
Author: Paul McInnis
Date: Thu Mar 28 17:32:50 2013 -0700

Merge pull request #3 from pebble/lightblue-pebble-improval

This is the working libpebble with lightblue

commit 5fff3b5d28c24c681aef2973196c7a5598d9580a
Author: Paul McInnis
Date: Thu Mar 28 16:21:55 2013 -0700

Needed to remove the LightBlueSerial.py

commit f712434411d1193129fce800c12b4f44345cf50b
Author: Paul McInnis
Date: Thu Mar 28 16:16:15 2013 -0700

This is the working libpebble with lighblue which does not product a generic LightBlueSerial object in the style of PySerial, but instead has LightBluePebble which is designed to allow for pebble communications.

in p.py
- made p.py disconnect when it is done running the script
- made p.py print "no apps" instead of throwing a non-scriptable TypeError when no apps are installed

in LightBlueSerial a.k.a LightBluePebble:
- simplified the IPC with a blocking call to read the rec_queue
- renamed to LightBluePebble because the tool is not generic enough to be used for other LightBlue tasks
- improved shutdown behaviour and debug behaviour

in repl.py
- added flags to support lightblue and to allow users to use PySerial instead

in pebble.py
- general cleaning up
- handle the _ser.recv when lightblue is being used such that debugging prompts in the main process are still displayed nicely.

commit 7dfb73e4a0cdc109011e3380ac0daf1859f34f46
Merge: 3caec95 5a59afd
Author: Paul McInnis
Date: Wed Mar 27 13:14:15 2013 -0700

Merge pull request #2 from pebble/improval-readability

Improved readability and interface timeout. Fixed a buggy log in pebble.py read function.

commit 5a59afd12a2963764ba0c6f6908e825f69bc2612
Author: Paul McInnis
Date: Tue Mar 26 23:15:25 2013 -0700

refactored length to timeout, added verbose mac address to connection. https://github.com/pebble/lightblue-0.4/pull/4

commit 1769111b25db7ac74107544fe56439308f78675e
Author: Paul McInnis
Date: Tue Mar 26 19:17:45 2013 -0700

improved readability and interface. fixed buggy log in pebble.py

commit 3caec954b5a21000c95a8c2123c15f15bbd9d4b0
Merge: 1b5e04a 34e939b
Author: Paul McInnis
Date: Tue Mar 26 19:09:23 2013 -0700

Merge pull request #1 from pebble/feature-remove-app-by-uuid

Feature remove app by uuid

commit 34e939b9d2e73d5d1cd66559d828c78978c441ff
Author: Martijn The
Date: Tue Mar 26 18:41:46 2013 -0700

Added "remove_app_by_uuid" function to libpebble / p.py

commit 1b5e04aceb835b9524a52502ad80f6fa4ba56f0e
Author: Martijn The
Date: Tue Mar 26 17:25:17 2013 -0700

non-editable dependency for lightblue in requirements.txt

commit b67d59a976a5fab470afe19df6ebde6f71f0ccff
Author: Martijn The
Date: Tue Mar 26 17:24:42 2013 -0700

- Missing re import
- 20 sec timout is too short when pairing
- Fixed typo

commit 426a79a20a197da7baa1951e7eae7f9965c03fd9
Author: Martijn The
Date: Tue Mar 26 17:25:17 2013 -0700

non-editable dependency for lightblue in requirements.txt

commit 4777457a89b571f0b7aa3c109c70cb4a6863276a
Author: Martijn The
Date: Tue Mar 26 17:24:42 2013 -0700

- Missing re import
- 20 sec timout is too short when pairing
- Fixed typo

commit 87e8c3fbc9117f6dbc5edc6da5e9762eace78a4e
Author: Martijn The
Date: Tue Mar 26 15:02:31 2013 -0700

Added lightblue dependency to requirements.txt

commit 4e1b84e889a75d778f451e1d6dbc500bb9e7411b
Author: Paul McInnis
Date: Tue Mar 26 14:21:14 2013 -0700

Moved LightBlueProcess into its own file, wrapped in PySerial style read, write and close.

commit 19b5b2268d1401f3f7c77929a4f590131a93e2c1
Author: Paul McInnis
Date: Mon Mar 25 20:30:33 2013 -0700

improved the behaviour of the child process (lightblue) by making it Daemonic. Also added a timeout for waiting on the setup process.

commit 336b76b4f896d7f520bedcf39af77d42f1ad5e9d
Author: Paul McInnis
Date: Mon Mar 25 18:39:24 2013 -0700

Usability improvements and some readability improvements

commit 1381d38c03e49371440ebf2a13867efe4db7da52
Author: Paul McInnis
Date: Mon Mar 25 16:15:27 2013 -0700

general improvements to formatting and autodetection.

commit 0cd60ca36c7f4530c9b5a637e3ac35542ccdaed7
Author: Paul McInnis
Date: Mon Mar 25 11:58:10 2013 -0700

further improved autodetection. Catching correct exception thrown from _bluetoothsocket.py (socket.timeout())

commit 6719e39e10776c4df9a77a9d1156e82d7e0c3af2
Author: Paul McInnis
Date: Mon Mar 25 11:19:38 2013 -0700

bigfixes for cases within autodetect

commit 2e1769f90b1ddda3067181eda2b492d1e76c65ed
Author: Paul McInnis
Date: Mon Mar 25 10:52:31 2013 -0700

This is the initial feature commit for libpebble with lightblue.

-lightblue runs inside it's own process, there are issues with shutting it down when it's parent process dies.

-example command line call:
./p.py --pebble_id DC93 --lightblue --pair ping
--> this will pair to the mac-address obtained by searching for .*DC:93 and then will ping it. --lightblue indicates use of lightblue library