Dreamforce 2014 Workshop Exercise - RFID Case Generator

Dependencies:   BufferedSerial C12832 EndpointMain-rfid EthernetInterface Logger StatusReporter-df2014 mbed-rtos mbed

Fork of df-2014-workshop-rfid-case-generator-k64f by Doug Anson

Overview

This code demonstrates how to use the mbed platform with a ID-12LA RFID reader and a Freescale K64F to get data into the SalesForce cloud.
This project was generated as a workshop for DreamForce 2014..

Details

The 2014 DreamForce workshop centers around an example scenario where you, as a street light technician, will "check in" to a given street light to service it. The street lights in this example are intelligent - they are connected, have knowledge about who/what they are, and in this example, contain an RFID sensor to allow technicians to "check in" during a service event.

The purpose of the workshop exercise is to provide exposure to new developers that the mbed IDE and development environment/ecosystem is very simple and easy to setup and use. Additionally, the workshop highlights that mbed devices can directly interact with SalesForce. The slides for the workshop can be found here.

For more information about the mbed SalesForce Interface API and its use, please see: http://developer.mbed.org/teams/MBED_DEMOS/code/SalesforceInterface/

Pretty Pictures

For the workshop the mbed team designed breakout boards to connect the ID12LA to the Freescale K64F for ease of use. Pictures of the boards can be found below. If you are interested in the breakout board you can order one from the OSHPark project page or use the eagle or gerber files as you see fit.

The ID-12LA sockets onto the RFID Brekout Board which then is put onto the Freescale K64F.

/media/uploads/mbedAustin/rfidboard_-8-.small.jpg

/media/uploads/mbedAustin/rfidboard_-9-.small.jpg

Committer:
ansond
Date:
Thu Oct 09 04:31:54 2014 +0000
Revision:
58:dcc6657570ef
Parent:
57:06a1779b73b9
reset for exercise

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 0:df2aa79c64f2 1 /* Copyright C2014 ARM, MIT License
ansond 0:df2aa79c64f2 2 *
ansond 0:df2aa79c64f2 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ansond 0:df2aa79c64f2 4 * and associated documentation files the "Software", to deal in the Software without restriction,
ansond 0:df2aa79c64f2 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ansond 0:df2aa79c64f2 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ansond 0:df2aa79c64f2 7 * furnished to do so, subject to the following conditions:
ansond 0:df2aa79c64f2 8 *
ansond 0:df2aa79c64f2 9 * The above copyright notice and this permission notice shall be included in all copies or
ansond 0:df2aa79c64f2 10 * substantial portions of the Software.
ansond 0:df2aa79c64f2 11 *
ansond 0:df2aa79c64f2 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ansond 0:df2aa79c64f2 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ansond 0:df2aa79c64f2 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ansond 0:df2aa79c64f2 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ansond 0:df2aa79c64f2 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ansond 0:df2aa79c64f2 17 */
ansond 0:df2aa79c64f2 18
ansond 0:df2aa79c64f2 19 #ifndef _DEFINITIONS_H_
ansond 0:df2aa79c64f2 20 #define _DEFINITIONS_H_
ansond 0:df2aa79c64f2 21
ansond 1:5c7d6b24a773 22 // ----------------- WORKSHOP TUNABLES -----------------
ansond 57:06a1779b73b9 23
ansond 57:06a1779b73b9 24 // SUPPORT PERSON #1 (this will be dispatched as a Case if the first RFID tag is swiped)
ansond 58:dcc6657570ef 25 #define FIRST_SUPPORT_PERSON_RFID 1234567
ansond 57:06a1779b73b9 26 #define FIRST_SUPPORT_PERSON_NAME "James T. Kirk"
ansond 57:06a1779b73b9 27 #define FIRST_SUPPORT_PERSON_DESCRIPTION "Federation Technician #NCC-1701"
ansond 57:06a1779b73b9 28 #define FIRST_SUPPORT_PERSON_STATUS "On site/servicing"
ansond 57:06a1779b73b9 29 #define FIRST_SUPPORT_PERSON_LATITUDE "37.404120"
ansond 57:06a1779b73b9 30 #define FIRST_SUPPORT_PERSON_LONGITUDE "-121.973195"
ansond 48:0ff25290cce3 31
ansond 57:06a1779b73b9 32 // SUPPORT PERSON #2 (this will be dispatched as a Case if the second RFID tag is swiped)
ansond 58:dcc6657570ef 33 #define SECOND_SUPPORT_PERSON_RFID 1234567
ansond 57:06a1779b73b9 34 #define SECOND_SUPPORT_PERSON_NAME "Harry Potter"
ansond 57:06a1779b73b9 35 #define SECOND_SUPPORT_PERSON_DESCRIPTION "Hogwarts Technician #WIZ-1234"
ansond 57:06a1779b73b9 36 #define SECOND_SUPPORT_PERSON_STATUS "On site/servicing"
ansond 57:06a1779b73b9 37 #define SECOND_SUPPORT_PERSON_LATITUDE "37.404120"
ansond 57:06a1779b73b9 38 #define SECOND_SUPPORT_PERSON_LONGITUDE "-121.973195"
ansond 48:0ff25290cce3 39
ansond 57:06a1779b73b9 40 // SUPPORT PERSON #3 (this will be dispatched as a Case if the third RFID tag is swiped)
ansond 58:dcc6657570ef 41 #define THIRD_SUPPORT_PERSON_RFID 1234567
ansond 57:06a1779b73b9 42 #define THIRD_SUPPORT_PERSON_NAME "Kramer"
ansond 57:06a1779b73b9 43 #define THIRD_SUPPORT_PERSON_DESCRIPTION "UNKNOWN Technician #-1"
ansond 57:06a1779b73b9 44 #define THIRD_SUPPORT_PERSON_STATUS "Off site/action unsure"
ansond 57:06a1779b73b9 45 #define THIRD_SUPPORT_PERSON_LATITUDE "37.404120"
ansond 57:06a1779b73b9 46 #define THIRD_SUPPORT_PERSON_LONGITUDE "-121.973195"
ansond 1:5c7d6b24a773 47
ansond 1:5c7d6b24a773 48 // ----------------- WORKSHOP TUNABLES -----------------
ansond 1:5c7d6b24a773 49
ansond 1:5c7d6b24a773 50 // mbed
ansond 0:df2aa79c64f2 51 #include "mbed.h"
ansond 0:df2aa79c64f2 52
ansond 0:df2aa79c64f2 53 // Our App version
ansond 57:06a1779b73b9 54 #define APP_VERSION "1.0.0"
ansond 3:03108e424931 55
ansond 3:03108e424931 56 // DF2014 CaseGenerator Relay for mbed - ties into the Salesforce APEX host for case generation
ansond 57:06a1779b73b9 57 #define DF_CASE_GEN_URL "https://df2014-arm-developer-edition.na15.force.com/services/apexrest/CaseService"
ansond 0:df2aa79c64f2 58
ansond 6:427c387b10e7 59 // Enable/Disable RFID ID12 usage
ansond 57:06a1779b73b9 60 #define ID12_ENABLE true // true - enable, false - disable
ansond 6:427c387b10e7 61
ansond 51:5cd56a48084a 62 // Enable/Disable verbose debugging
ansond 57:06a1779b73b9 63 #define ENABLE_DEBUG_LOGGING false // true - enabled, false - disabled (default)
ansond 51:5cd56a48084a 64
ansond 51:5cd56a48084a 65 // maximum memory buffer chunk
ansond 57:06a1779b73b9 66 #define MAX_BUFFER_LENGTH 2048
ansond 51:5cd56a48084a 67
ansond 51:5cd56a48084a 68 // small buffer chunk
ansond 57:06a1779b73b9 69 #define MAX_SMALL_BUFFER_LENGTH 256
ansond 51:5cd56a48084a 70
ansond 0:df2aa79c64f2 71 // What platform we are compiling on
ansond 57:06a1779b73b9 72 #define _K64F_PLATFORM true
ansond 0:df2aa79c64f2 73
ansond 27:9bb430dd6c07 74 // K64F needs to launch the task in a thread with a large stack size...
ansond 57:06a1779b73b9 75 #define STACK_SIZE 40000
ansond 51:5cd56a48084a 76
ansond 0:df2aa79c64f2 77 // Wait Time for iterations (ms)
ansond 57:06a1779b73b9 78 #define WAIT_TIME_MS 500
ansond 0:df2aa79c64f2 79
ansond 19:341ce6a43a84 80 // Blink Time
ansond 57:06a1779b73b9 81 #define BLINK_TIME 250
ansond 19:341ce6a43a84 82
ansond 57:06a1779b73b9 83 // Memory tunables for SupportPersonnelDB
ansond 57:06a1779b73b9 84 #define DB_MAX_NAME_LENGTH 64
ansond 57:06a1779b73b9 85 #define DB_MAX_DESCRIPTION_LENGTH 128
ansond 57:06a1779b73b9 86 #define DB_MAX_STATUS_LENGTH 128
ansond 57:06a1779b73b9 87 #define DB_MAX_LATLONG_LENGTH 32
ansond 57:06a1779b73b9 88 #define DB_MAX_NUM_SUPPORT_PERSONS 3
ansond 0:df2aa79c64f2 89
ansond 57:06a1779b73b9 90 // convenience definitions for SupportPersonnelDB... 3 RFID tags/workshop station
ansond 57:06a1779b73b9 91 #define FIRST_SUPPORT_PERSON 0
ansond 57:06a1779b73b9 92 #define SECOND_SUPPORT_PERSON 1
ansond 57:06a1779b73b9 93 #define THIRD_SUPPORT_PERSON 2
ansond 0:df2aa79c64f2 94
ansond 53:344e2d3de190 95 // PINS for RFID Reader Shield - ID12 RFID sensor + TMP36 temperature sensor
ansond 57:06a1779b73b9 96 #define RFID_TX_PIN D1
ansond 57:06a1779b73b9 97 #define RFID_RX_PIN D0
ansond 57:06a1779b73b9 98 #define TEMP_PIN A3
ansond 22:1b9e29933ab3 99
ansond 0:df2aa79c64f2 100 #endif // _DEFINITIONS_H_