Commit 74607bbd authored by Zachary Seguin's avatar Zachary Seguin
Browse files

Initial commit

parents
{
"uuid": "b6206a52-7eef-40a2-a225-e5797785b2b2",
"shortName": "Zachary Seguin",
"longName": "Zachary Seguin - Watchface",
"companyName": "Zachary Seguin",
"versionCode": 1,
"versionLabel": "1.0.0",
"watchapp": {
"watchface": true
},
"appKeys": {
"weather_icon": 0,
"weather_conditions": 1,
"temperature": 2,
"information": 3
},
"capabilities" : [ "location" ],
"resources": {
"media": [
{
"type" : "font",
"name" : "ICONS_12",
"file" : "fonts/icomoon.ttf"
},
{
"type" : "font",
"name" : "ICONS_18",
"file" : "fonts/icomoon.ttf"
}
]
}
}
all:
pebble build
build:
pebble build
install:
pebble install --phone 10.0.1.6 --logs
#pebble logs --phone 10.0.1.6
clean:
pebble clean
\ No newline at end of file
File added
/*
COPYRIGHT © 2013 - Zachary Seguin
All Rights Reserved.
www.zacharyseguin.ca
contact@zacharyseguin.ca
*/
#include <pebble.h>
#include "utilities.h"
#include "display.h"
#include "icons.h"
/* GUI POSITIONS & SIZES */
// TITLE_ZACHARY
#define TITLE_ZACHARY_SIZE_WIDTH 52
#define TITLE_ZACHARY_SIZE_HEIGHT 25
#define TITLE_ZACHARY_SIZE TITLE_ZACHARY_SIZE_WIDTH, TITLE_ZACHARY_SIZE_HEIGHT
#define TITLE_ZACHARY_POSITION_X bounds.size.w / 2 - 15
#define TITLE_ZACHARY_POSITION_Y 2
#define TITLE_ZACHARY_POSITION TITLE_ZACHARY_POSITION_X, TITLE_ZACHARY_POSITION_Y
#define TITLE_ZACHARY_FONT fonts_get_system_font(FONT_KEY_GOTHIC_14_BOLD)
#define TITLE_ZACHARY_ALIGNMENT GTextAlignmentRight
#define TITLE_ZACHARY_BACKGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define TITLE_ZACHARY_FOREGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define TITLE_ZACHARY_TEXT "Zachary"
// BATTERY_ICON
#define BATTERY_ICON_SIZE_WIDTH 20
#define BATTERY_ICON_SIZE_HEIGHT 25
#define BATTERY_ICON_SIZE BATTERY_ICON_SIZE_WIDTH, BATTERY_ICON_SIZE_HEIGHT
#define BATTERY_ICON_POSITION_X 0
#define BATTERY_ICON_POSITION_Y 4
#define BATTERY_ICON_POSITION BATTERY_ICON_POSITION_X, BATTERY_ICON_POSITION_Y
#define BATTERY_ICON_FONT icons12
#define BATTERY_ICON_ALIGNMENT GTextAlignmentCenter
#define BATTERY_ICON_BACKGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define BATTERY_ICON_FOREGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define BATTERY_ICON_TEXT ICON_SWITCH
// BATTERY
#define BATTERY_SIZE_WIDTH 35
#define BATTERY_SIZE_HEIGHT 25
#define BATTERY_SIZE BATTERY_SIZE_WIDTH, BATTERY_SIZE_HEIGHT
#define BATTERY_POSITION_X BATTERY_ICON_SIZE_WIDTH
#define BATTERY_POSITION_Y 2
#define BATTERY_POSITION BATTERY_POSITION_X, BATTERY_POSITION_Y
#define BATTERY_FONT fonts_get_system_font(FONT_KEY_GOTHIC_14)
#define BATTERY_ALIGNMENT GTextAlignmentLeft
#define BATTERY_BACKGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define BATTERY_FOREGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define BATTERY_TEXT "---%"
// BLUETOOTH
#define BLUETOOTH_SIZE_WIDTH 23
#define BLUETOOTH_SIZE_HEIGHT 25
#define BLUETOOTH_SIZE BLUETOOTH_SIZE_WIDTH, BLUETOOTH_SIZE_HEIGHT
#define BLUETOOTH_POSITION_X bounds.size.w - BLUETOOTH_SIZE_WIDTH
#define BLUETOOTH_POSITION_Y 4
#define BLUETOOTH_POSITION BLUETOOTH_POSITION_X, BLUETOOTH_POSITION_Y
#define BLUETOOTH_FONT icons12
#define BLUETOOTH_ALIGNMENT GTextAlignmentCenter
#define BLUETOOTH_BACKGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define BLUETOOTH_FOREGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define BLUETOOTH_TEXT ICON_PHONE_HANG_UP
// DATE
#define DATE_SIZE_WIDTH bounds.size.w
#define DATE_SIZE_HEIGHT 35
#define DATE_SIZE DATE_SIZE_WIDTH, DATE_SIZE_HEIGHT
#define DATE_POSITION_X 0
#define DATE_POSITION_Y 70
#define DATE_POSITION DATE_POSITION_X, DATE_POSITION_Y
#define DATE_FONT fonts_get_system_font(FONT_KEY_GOTHIC_24)
#define DATE_ALIGNMENT GTextAlignmentCenter
#define DATE_BACKGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define DATE_FOREGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define DATE_TEXT CLOCK_DATE_PLACEHOLDER
// TIME
#define TIME_SIZE_WIDTH bounds.size.w
#define TIME_SIZE_HEIGHT 50
#define TIME_SIZE TIME_SIZE_WIDTH, TIME_SIZE_HEIGHT
#define TIME_POSITION_X 0
#define TIME_POSITION_Y 25
#define TIME_POSITION TIME_POSITION_X, TIME_POSITION_Y
#define TIME_FONT fonts_get_system_font(FONT_KEY_BITHAM_42_MEDIUM_NUMBERS)
#define TIME_ALIGNMENT GTextAlignmentCenter
#define TIME_BACKGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define TIME_FOREGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define TIME_TEXT CLOCK_TIME_PLACEHOLDER
// SEPERATOR
#define SEPERATOR_SIZE_WIDTH bounds.size.w
#define SEPERATOR_SIZE_HEIGHT 1
#define SEPERATOR_SIZE SEPERATOR_SIZE_WIDTH, SEPERATOR_SIZE_HEIGHT
#define SEPERATOR_POSITION_X 0
#define SEPERATOR_POSITION_Y 138
#define SEPERATOR_POSITION SEPERATOR_POSITION_X, SEPERATOR_POSITION_Y
#define SEPERATOR_FONT fonts_get_system_font(FONT_KEY_GOTHIC_14)
#define SEPERATOR_ALIGNMENT GTextAlignmentCenter
#define SEPERATOR_BACKGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define SEPERATOR_FOREGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define SEPERATOR_TEXT ""
// WEATHER_ICON
#define WEATHER_ICON_SIZE_WIDTH 30
#define WEATHER_ICON_SIZE_HEIGHT 40
#define WEATHER_ICON_SIZE WEATHER_ICON_SIZE_WIDTH, WEATHER_ICON_SIZE_HEIGHT
#define WEATHER_ICON_POSITION_X 0
#define WEATHER_ICON_POSITION_Y 116
#define WEATHER_ICON_POSITION WEATHER_ICON_POSITION_X, WEATHER_ICON_POSITION_Y
#define WEATHER_ICON_FONT icons18
#define WEATHER_ICON_ALIGNMENT GTextAlignmentCenter
#define WEATHER_ICON_BACKGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define WEATHER_ICON_FOREGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define WEATHER_ICON_TEXT ICON_CANCEL_CIRCLE
// WEATHER
#define WEATHER_SIZE_WIDTH bounds.size.w - WEATHER_ICON_SIZE_WIDTH - 4
#define WEATHER_SIZE_HEIGHT 25
#define WEATHER_SIZE WEATHER_SIZE_WIDTH, WEATHER_SIZE_HEIGHT
#define WEATHER_POSITION_X WEATHER_ICON_SIZE_WIDTH
#define WEATHER_POSITION_Y 113
#define WEATHER_POSITION WEATHER_POSITION_X, WEATHER_POSITION_Y
#define WEATHER_FONT fonts_get_system_font(FONT_KEY_GOTHIC_18)
#define WEATHER_ALIGNMENT GTextAlignmentLeft
#define WEATHER_BACKGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define WEATHER_FOREGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define WEATHER_TEXT "Weather Unavailable"
// INFORMATION
#define INFORMATION_SIZE_WIDTH bounds.size.w - 8
#define INFORMATION_SIZE_HEIGHT 25
#define INFORMATION_SIZE INFORMATION_SIZE_WIDTH, INFORMATION_SIZE_HEIGHT
#define INFORMATION_POSITION_X 4
#define INFORMATION_POSITION_Y 135
#define INFORMATION_POSITION INFORMATION_POSITION_X, INFORMATION_POSITION_Y
#define INFORMATION_FONT fonts_get_system_font(FONT_KEY_GOTHIC_18)
#define INFORMATION_ALIGNMENT GTextAlignmentLeft
#define INFORMATION_BACKGROUND_COLOUR ZS_DEFAULT_BACKGROUND_COLOUR
#define INFORMATION_FOREGROUND_COLOUR ZS_DEFAULT_FOREGROUND_COLOUR
#define INFORMATION_TEXT "Information Unavailable"
/* MESSAGE KEYS */
enum
{
KEY_WEATHER_ICON,
KEY_WEATHER_CONDITIONS,
KEY_TEMPERATURE,
KEY_INFORMATION
};
/* GUI OBJECTS */
Window *window;
TextLayer *battery_icon_layer;
TextLayer *battery_layer;
TextLayer *bluetooth_layer;
TextLayer *title_zachary_layer;
TextLayer *time_layer;
TextLayer *date_layer;
TextLayer *seperator_layer;
TextLayer *weather_icon_layer;
TextLayer *weather_layer;
TextLayer *information_layer;
GFont icons12;
GFont icons18;
void get_weather_and_information()
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Sending request to update weather and information...");
DictionaryIterator *iter;
app_message_outbox_begin(&iter);
Tuplet value = TupletCString(0, "update");
dict_write_tuplet(iter, &value);
app_message_outbox_send();
}// End of get_weather_and_information method
/**
* handle_tick(struct tm *tick_time, TimeUnits units_change)
* Handles the timer tick event (time changed).
*/
static void handle_tick(struct tm *tick_time, TimeUnits units_changed)
{
display_clock(tick_time, units_changed, time_layer, date_layer);
// If the time is at the 10 minute marker, update weather and other information
if (tick_time->tm_min % 10 == 0)
{
get_weather_and_information();
}// End of if
}// End of handle_tick method
/**
* handle_battery_charge_state(struct tm *tick_time, TimeUnits units_change)
* Handles the battery charge state changed.
*/
static void handle_battery_state(BatteryChargeState battery)
{
display_battery(battery, battery_icon_layer, battery_layer);
}// End of handle_battery_charge_state method
/**
* handle_bluetooth_connection(bool connected)
* Handles the bluetooth status changed.
*/
static void handle_bluetooth_connection(bool connected)
{
display_bluetooth(connected, bluetooth_layer);
}// End of handle_bluetooth_connection
void handle_message_dropped(AppMessageResult reason, void *context)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "A message was dropped: %d", reason);
}
/**
* handle_message_received(DictionaryIterator *received, void *context)
* Handles when the app receives a message.
*/
void handle_message_received(DictionaryIterator *received, void *context)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Message received.");
Tuple *weather_icon_tuple = dict_find(received, KEY_WEATHER_ICON);
Tuple *conditions_tuple = dict_find(received, KEY_WEATHER_CONDITIONS);
Tuple *temperature_tuple = dict_find(received, KEY_TEMPERATURE);
Tuple *information_tuple = dict_find(received, KEY_INFORMATION);
// Handle weather updates
if (weather_icon_tuple && conditions_tuple && temperature_tuple)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Received weather icon: %d", weather_icon_tuple->value->int16);
APP_LOG(APP_LOG_LEVEL_DEBUG, "Received weather conditions: %s", conditions_tuple->value->cstring);
APP_LOG(APP_LOG_LEVEL_DEBUG, "Received temperature: %d\370", temperature_tuple->value->int16);
display_weather(weather_icon_tuple->value->int16, conditions_tuple->value->cstring, temperature_tuple->value->int16, weather_icon_layer, weather_layer);
}// End of if
// Handle information
if (information_tuple)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Received information: %s", information_tuple->value->cstring);
display_information(information_tuple->value->cstring, information_layer);
}// End of if
}// End of message_received method
/**
* handle_failed_send(DictionaryIterator *failed, AppMessageResult reason, void *context)
* Handles when a message failed to send.
*/
void handle_failed_send(DictionaryIterator *failed, AppMessageResult reason, void *context)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Failed to send message!");
}// End of handle_failed_send method
/**
* init()
* Initialize the watchapp
*/
static void init(void)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Initialize watchapp...");
// Initialize global variables
window = window_create();
// Declare and initialize local variables
Layer *window_layer = window_get_root_layer(window);
// Setup the window
window_set_background_color(window, ZS_DEFAULT_BACKGROUND_COLOUR);
window_set_fullscreen(window, true);
// Setup the text layers
GRect bounds = layer_get_frame(window_layer);
/* STATUS BAR LAYERS */
battery_icon_layer = zs_create_text_layer((GRect) { .origin = { BATTERY_ICON_POSITION }, .size = { BATTERY_ICON_SIZE } },
BATTERY_ICON_TEXT,
BATTERY_ICON_FONT, BATTERY_ICON_ALIGNMENT,
BATTERY_ICON_BACKGROUND_COLOUR, BATTERY_ICON_FOREGROUND_COLOUR,
window_layer);
battery_layer = zs_create_text_layer((GRect) { .origin = { BATTERY_POSITION }, .size = { BATTERY_SIZE } },
BATTERY_TEXT,
BATTERY_FONT, BATTERY_ALIGNMENT,
BATTERY_BACKGROUND_COLOUR, BATTERY_FOREGROUND_COLOUR,
window_layer);
bluetooth_layer = zs_create_text_layer((GRect) { .origin = { BLUETOOTH_POSITION }, .size = { BLUETOOTH_SIZE } },
BLUETOOTH_TEXT,
BLUETOOTH_FONT, BLUETOOTH_ALIGNMENT,
BLUETOOTH_BACKGROUND_COLOUR, BLUETOOTH_FOREGROUND_COLOUR,
window_layer);
/* VARIOUS TEXT */
title_zachary_layer = zs_create_text_layer((GRect) { .origin = { TITLE_ZACHARY_POSITION }, .size = { TITLE_ZACHARY_SIZE } },
TITLE_ZACHARY_TEXT,
TITLE_ZACHARY_FONT, TITLE_ZACHARY_ALIGNMENT,
TITLE_ZACHARY_BACKGROUND_COLOUR, TITLE_ZACHARY_FOREGROUND_COLOUR,
window_layer);
/* CLOCK */
date_layer = zs_create_text_layer((GRect) { .origin = { DATE_POSITION }, .size = { DATE_SIZE } },
DATE_TEXT,
DATE_FONT, DATE_ALIGNMENT,
DATE_BACKGROUND_COLOUR, DATE_FOREGROUND_COLOUR,
window_layer);
time_layer = zs_create_text_layer((GRect) { .origin = { TIME_POSITION }, .size = { TIME_SIZE } },
TIME_TEXT,
TIME_FONT, TIME_ALIGNMENT,
TIME_BACKGROUND_COLOUR, TIME_FOREGROUND_COLOUR,
window_layer);
/* WEATHER */
weather_icon_layer = zs_create_text_layer((GRect) { .origin = { WEATHER_ICON_POSITION }, .size = { WEATHER_ICON_SIZE } },
WEATHER_ICON_TEXT,
WEATHER_ICON_FONT, WEATHER_ICON_ALIGNMENT,
WEATHER_ICON_BACKGROUND_COLOUR, WEATHER_ICON_FOREGROUND_COLOUR,
window_layer);
weather_layer = zs_create_text_layer((GRect) { .origin = { WEATHER_POSITION }, .size = { WEATHER_SIZE } },
WEATHER_TEXT,
WEATHER_FONT, WEATHER_ALIGNMENT,
WEATHER_BACKGROUND_COLOUR, WEATHER_FOREGROUND_COLOUR,
window_layer);
text_layer_set_overflow_mode(weather_layer, GTextOverflowModeTrailingEllipsis);
/* INFORMATION */
information_layer = zs_create_text_layer((GRect) { .origin = { INFORMATION_POSITION }, .size = { INFORMATION_SIZE } },
INFORMATION_TEXT,
INFORMATION_FONT, INFORMATION_ALIGNMENT,
INFORMATION_BACKGROUND_COLOUR, INFORMATION_FOREGROUND_COLOUR,
window_layer);
text_layer_set_overflow_mode(information_layer, GTextOverflowModeTrailingEllipsis);
/* SEPERATOR LAYERS */
seperator_layer = zs_create_text_layer((GRect) { .origin = { SEPERATOR_POSITION }, .size = { SEPERATOR_SIZE } },
SEPERATOR_TEXT,
SEPERATOR_FONT, SEPERATOR_ALIGNMENT,
SEPERATOR_BACKGROUND_COLOUR, SEPERATOR_FOREGROUND_COLOUR,
window_layer);
// Show the window
APP_LOG(APP_LOG_LEVEL_DEBUG, "Pushing window onto the screen...");
window_stack_push(window, true);
APP_LOG(APP_LOG_LEVEL_DEBUG, "Done initializing");
}// End of init method
/**
* deinit()
* De-initialize the watchapp
*/
static void deinit(void)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "De-initialize watchapp...");
tick_timer_service_unsubscribe();
battery_state_service_unsubscribe();
bluetooth_connection_service_unsubscribe();
window_destroy(window);
text_layer_destroy(battery_icon_layer);
text_layer_destroy(battery_layer);
text_layer_destroy(bluetooth_layer);
text_layer_destroy(title_zachary_layer);
text_layer_destroy(time_layer);
text_layer_destroy(date_layer);
text_layer_destroy(seperator_layer);
text_layer_destroy(weather_icon_layer);
text_layer_destroy(weather_layer);
text_layer_destroy(information_layer);
fonts_unload_custom_font(icons12);
fonts_unload_custom_font(icons18);
APP_LOG(APP_LOG_LEVEL_DEBUG, "Done de-initializing");
}// End of deinit method
/**
* main()
* De-initialize everything.
*/
int main(void)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Launching watchface...");
// Load Font Awesome
icons12 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_ICONS_12));
icons18 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_ICONS_18));
init();
// Subsribe to the timers
tick_timer_service_subscribe(MINUTE_UNIT, handle_tick);
battery_state_service_subscribe(handle_battery_state);
bluetooth_connection_service_subscribe(handle_bluetooth_connection);
// Setup message handlers
app_message_register_inbox_received(handle_message_received);
app_message_register_inbox_dropped(handle_message_dropped);
app_message_register_outbox_failed(handle_failed_send);
const uint32_t inbound_size = 100;
const uint32_t outbound_size = 64;
app_message_open(inbound_size, outbound_size);
// Avoids a blank screen on watch start.
time_t now = time(NULL);
struct tm *tick_time = localtime(&now);
display_clock(tick_time, SECOND_UNIT | MINUTE_UNIT | HOUR_UNIT | DAY_UNIT | MONTH_UNIT | YEAR_UNIT, time_layer, date_layer);
display_battery(battery_state_service_peek(), battery_icon_layer, battery_layer);
display_bluetooth(bluetooth_connection_service_peek(), bluetooth_layer);
app_event_loop();
deinit();
APP_LOG(APP_LOG_LEVEL_DEBUG, "Watchface Closed");
}// End of main method
\ No newline at end of file
/*
COPYRIGHT © 2013 - Zachary Seguin
All Rights Reserved.
www.zacharyseguin.ca
contact@zacharyseguin.c
*/
#include "display.h"
/*
COPYRIGHT © 2013 - Zachary Seguin
All Rights Reserved.
www.zacharyseguin.ca
contact@zacharyseguin.c
*/
#include <pebble.h>
#include "icons.h"
#define CLOCK_TIME_PLACEHOLDER "00:00"
#define CLOCK_DATE_PLACEHOLDER "Xxx., Xxx. ##, ####"
#define CLOCK_TIME_FORMAT_24HR "%R"
#define CLOCK_TIME_FORMAT_12HR "%I:%M"
#define CLOCK_DATE_FORMAT "%a., %b. %e, %Y"
static void display_clock(struct tm *tick_time, TimeUnits units_changed, TextLayer *time_layer, TextLayer *date_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Displaying time...");
// Minute changed
// NOTE: This will also handle the hour changing
if (units_changed & MINUTE_UNIT)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Minute units have changed");
// Declare variables
static char time_text[] = CLOCK_TIME_PLACEHOLDER;
char *time_format;
// Format the time
if (clock_is_24h_style())
time_format = CLOCK_TIME_FORMAT_24HR;
else
time_format = CLOCK_TIME_FORMAT_12HR;
strftime(time_text, sizeof(time_text), time_format, tick_time);
// Shift everything over if there is a 0 as the leading digit
if (!clock_is_24h_style() && (time_text[0] == '0'))
memmove(time_text, &time_text[1], sizeof(time_text) - 1);
text_layer_set_text(time_layer, time_text);
}// End of if
// Date changed
// NOTE: This will also handle the hour changing
if (units_changed & DAY_UNIT)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Date units have changed");
// Declare variables
static char date_text[] = CLOCK_DATE_PLACEHOLDER;
strftime(date_text, sizeof(date_text), CLOCK_DATE_FORMAT, tick_time);
text_layer_set_text(date_layer, date_text);
}// End of if
APP_LOG(APP_LOG_LEVEL_DEBUG, "Done displaying time");
}// End of display_time method
static void display_battery(BatteryChargeState battery, TextLayer *battery_icon_layer, TextLayer *battery_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating battery state...");
static char battery_icon_string[] = ICON_SWITCH;
snprintf(battery_icon_string, sizeof(battery_icon_string), (battery.is_charging) ? ICON_POWER_CORD : ICON_SWITCH);
static char battery_string[4];
snprintf(battery_string, sizeof(battery_string), "%d%%", battery.charge_percent);
text_layer_set_text(battery_icon_layer, battery_icon_string);
text_layer_set_text(battery_layer, battery_string);
}// End of display_battery method
static void display_bluetooth(bool connected, TextLayer *bluetooth_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating bluetooth connection state...");
static char bluetooth_string[] = ICON_PHONE_HANG_UP;
snprintf(bluetooth_string, sizeof(bluetooth_string), (connected) ? ICON_PHONE : ICON_PHONE_HANG_UP);
text_layer_set_text(bluetooth_layer, bluetooth_string);
}// End of display_bluetooth method
static void display_weather(const int icon, const char *conditions, const int temperature, TextLayer *weather_icon_layer, TextLayer *weather_layer)
{
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating weather...");
static char weather_icon[] = ICON_CANCEL_CIRCLE;
switch(icon)
{
case 1:
snprintf(weather_icon, sizeof(weather_icon), WEATHER_ICON_SUNNY);
break;