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
Diff: main.cpp
- Revision:
- 1:a71236906eed
- Parent:
- 0:a298d18da239
- Child:
- 3:3a5fdfdabca3
--- 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());