In our last post we took a tour of the Pebble hardware platform. In addition to the hardware, there’s the Pebble operating system and run-time environment. I haven’t found a lot of details yet in my wanderings through the Pebble documentation on the internals of what is being referred to as “PebbleOS”, but judging from what is exposed through the developer documentation it would appear to be a fairly traditional small footprint embedded O/S, bootloader and associated communications manager. If I were a betting man I’d be wagering that all this was based on a customized port of the ARM version of the Linux kernel, but I’ve yet to find any evidence of that one way or the other.
What we can conclude is that PebbleOS includes a library of functions that are made available to developers as a set of APIs (Application Programming Interfaces) that are capable of performing a wide range of tasks. As you’ll see shortly, the dev tools include header files that allow you to hook into individual routines from the APIs that will be linked at runtime when your App is loaded and run. This allows individual programs to be much smaller, as they can make use of shared code libraries that are already stored on the watch in persistent memory.
The Pebble developer documentation includes details on the current set of APIs that are made available to your programs. These include a range of graphical and user interface components, a set of what Pebbles calls “Foundation” APIs (which provide access to things like the clock timer, help with packaging and transporting data between the Pebble and your smart mobile platforms and logging functionality for monitoring and debugging your App from your smart mobile environment). There is also an implementation of the Standard C library, which provides such tools as math, memory management and string formatting routines. There’s even a set of routines that allow you to display bitmap images, text and perform simple animation.
Here’s one cautionary note – if you’re already an experienced embedded systems programmer or someone familiar with the Standard C Library you shouldn’t be surprised to find a few things missing or incomplete at this point and to be fair the Pebble folks have been pretty clear that the SDK is going to be evolving over time.
A couple of specific things I’ve noted as missing so far include not having access to all of the underlying hardware functionality and the lack of any way to save data to persistent memory to allow you to store state across shutdowns or restarts of your App. This can be a pain if users have to reenter settings each time you start the App, but it’s theoretically possible to send messages back and forth to a companion smart phone/tablet App on startup that would allow you to get around this limitation. Of course, longer term, the correct way to do this is to allow local data storage, and calls for this echo daily across the developer forum.
You’re going to want to spend some time reading through all the API docs, although it’s certainly going to be easier if you do this in parallel with checking out some of the sample programs for specific examples of each class of functions. We’re also going to be walking through a couple of specific examples later in this series, using them to show you how to set up a program and make some simple modifications to help get you started, as well.
Next up, Implementing a Pebble Program (to come…)