Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pebble-simple-health

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pebble-simple-health

Simlpe health library for Pebble

  • 1.0.4
  • beta
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

pebble-simple-health is a simple library that provides basic health info for user of Pebble smartwatch.

This is a Beta version with Diorite support, build with SDK4

Available information:

  • Step count
  • Distance walked
  • Sleep time
  • Deep Sleep Time
  • Time Active
  • Calories burned at rest
  • Calories burned while active

Every indicator has respetive "goal" value, calculated as an average from past days.

To use the package install it into your project and include pebble-simple-health/pebble-simple-health.h into code file. Note that pebble-simple-health depends on pebble-events package.

##Availale functions:

bool health_is_available() - returns true if health services are available, otherwise returns false. Available after call to health_init

void health_init(health_callback *callback_proc) - initializes health services, parameter is a callback procedure that will be called when health data is updated

int health_get_metric_sum(HealthMetric metric) - gets current daily value for requested metrics

int health_get_metric_goal(HealthMetric metric) - gets goal value for requested metric.

void health_deinit(); - deninitializes health service

##Example usage

void health_updated() {
  APP_LOG(APP_LOG_LEVEL_INFO, "Steps taken: %d", health_get_metric_sum(HealthMetricStepCount));
}

void handle_init(){
  health_init(health_updated);
  
  if (!health_is_available()) {
    APP_LOG(APP_LOG_LEVEL_DEBUG, "Health service is not available");
  }
}

void handle_deinit(){
  health_deinit();
}


int main(void) {
  handle_init();
  app_event_loop();
  handle_deinit();
}


Keywords

FAQs

Package last updated on 18 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc