douwem / pebblewatch Goto Github PK
View Code? Open in Web Editor NEWA Ruby library for communicating with your Pebble smartwatch.
License: MIT License
A Ruby library for communicating with your Pebble smartwatch.
License: MIT License
Running following code should show me my installed apps:
require "pebblewatch"
require 'pp'
watch = Pebble::Watch.new("4F92", "/dev/rfcomm0")
watch.connect
pp watch.get_installed_apps
watch.disconnect
prints:
{:banks_count=>8,
:apps=>
[{:id=>12,
:index=>0,
:name=>"Counter",
:author=>"Ps0ke",
:flags=>0,
:version=>3956},
{:id=>13,
:index=>1,
:name=>"MtG Life Points",
:author=>"Ps0ke",
:flags=>0,
:version=>8392},
{:id=>14,
:index=>2,
:name=>"Dotz",
:author=>"Zalew",
:flags=>1,
:version=>42359},
{:id=>15,
:index=>3,
:name=>"Noms",
:author=>"Fuzzie",
:flags=>1,
:version=>3224},
{:id=>16,
:index=>4,
:name=>"Nyan Watch",
:author=>"Jeff Pitchell",
:flags=>1,
:version=>41153},
{:id=>0,
:index=>1347,
:name=>
"alendar\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00W",
:author=>"illiam Heaton",
:flags=>162,
:version=>11776},
{:id=>4608,
:index=>1607,
:name=>
"low\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00d",
:author=>"otar",
:flags=>258,
:version=>21504},
{:id=>0,
:index=>478821,
:name=>
"olog\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Ps",
:author=>"0ke",
:flags=>nil,
:version=>1}]}
The first ones work well, but starting at ID 0
The Strings get all messed up. The app with ID 0
has the name Calendar
, but the first char got lost somewhere. Instead the first char of the author
field got at the end of the name
field (William). As a result, the nullbytes did not get stripped. My guess is, that the offsets got wrong as you still read 32 byte.
Just for the record: ID 4608
's name
should be "Glow", the author
"dotar" I guess. ID 0
(two identical IDs? Maybe something went wrong here, too?) should have the name
"Neolog", and the author
is me, "Ps0ke". We're two bytes off by now.
I am getting no feedback on the media key events. Updating media metadata works just fine, but apart from that I was only able to receive the "Bluetooth discoverable" system message. I am using
% ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
on a Gentoo Linux and an rfcomm device.
My Pebble runs Firmware v1.12.1
and is a V2R2
Hardware. Any suggestions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.