salesforce HeartRate monitor sample application. This application sends periodic heart rate values into salesforce.com via the mbed SalesforceInterface API.

Dependencies:   BufferedSerial C12832 EthernetInterface GroveEarbudSensor Logger SalesforceInterface mbed-rtos mbed

Fork of df-2014-salesforce-hrm-k64f by Doug Anson

Files at this revision

API Documentation at this revision

Comitter:
ansond
Date:
Wed Sep 24 21:54:21 2014 +0000
Parent:
0:a298d18da239
Child:
2:ce4056f10202
Commit message:
updates for latest HRM

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
sf_creds.h Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Sep 24 04:13:57 2014 +0000
+++ b/main.cpp	Wed Sep 24 21:54:21 2014 +0000
@@ -52,11 +52,17 @@
  // Salesforce.com Interface
  #include "SalesforceInterface.h"
  
+ // Sensor Lat/Long
+ #define SENSOR_LATITUDE     "37.404120"
+ #define SENSOR_LONGITUDE    "-121.973195"
+ 
  // Salesforce.com Configuration/Tunables
  char *hrm_object_name          = "HeartRate__c";            // custom object 
  char *hrm_bpm_field_name       = "bpm__c";                  // heartrate field
  char *hrm_user_field_name      = "Name";                    // heartrate user
  char *hrm_counter_field_name   = "count__c";                // heartrate counter
+ char *hrm_latitude             = "latitude__c";             // sensor latitude
+ char *hrm_longitude            = "longitude__c";            // sensor longitude
  char *hrm_user                 = "Doug Anson";              // whos heartrate is this?
  
  // main loop toggle
@@ -142,6 +148,8 @@
      bpm_record[hrm_bpm_field_name]     = (int)get_heartrate();
      bpm_record[hrm_user_field_name]    = hrm_user;
      bpm_record[hrm_counter_field_name] = (int)iteration_counter;
+     bpm_record[hrm_latitude]           = SENSOR_LATITUDE;
+     bpm_record[hrm_longitude]          = SENSOR_LONGITUDE;
      
      logger->log("ARM Salesforce HRM v%s\r\nCreate: new bpm record(%d): %d\r\nSending...",APP_VERSION,iteration_counter,hrmCounter);
      logger->logConsole("Initializing BPM record: %s",bpm_record.serialize().c_str());
@@ -178,7 +186,9 @@
      bpm_record[hrm_bpm_field_name]     = bpm;
      bpm_record[hrm_user_field_name]    = hrm_user;
      bpm_record[hrm_counter_field_name] = (int)iteration_counter;
-     
+     bpm_record[hrm_latitude]           = SENSOR_LATITUDE;
+     bpm_record[hrm_longitude]          = SENSOR_LONGITUDE;
+
      // DEBUG
      logger->log("ARM Salesforce HRM v%s\r\nUpdate HR(%d): %d bpm\r\nSending...",APP_VERSION,iteration_counter,bpm);
      logger->logConsole("Update: updated record: %s",bpm_record.serialize().c_str());
--- a/sf_creds.h	Wed Sep 24 04:13:57 2014 +0000
+++ b/sf_creds.h	Wed Sep 24 21:54:21 2014 +0000
@@ -1,5 +1,12 @@
- /* Tunables: Salesforce Credentials */
+ /* Tunables: Salesforce Credentials /
  char *username      = "xxx@yyy.zzz";
  char *password      = "password_goes_here";            // must be of the form: [password][security token]
  char *client_id     = "customer key goes here";
  char *client_secret = "client secret goes here";
+ */
+ 
+// Tunables: Salesforce Credentials
+ char *username      = "danson@austin.rr.com";
+ char *password      = "d8wjyKa0arYih5icg43dwg5avViCeWO5EvKDic4";
+ char *client_id     = "3MVG9A2kN3Bn17hvE16FXaPLpTK1CEPVbzU9kbsPVmCrERuOvm5LEz6qc1WLBwC_S.X_QcOgH9fmFqRvWt2Hh";
+ char *client_secret = "989796221362081717";
\ No newline at end of file