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 Aug 28 20:19:08 2014 +0000
Revision:
13:2561e3855a81
Parent:
8:fefcecb66463
Child:
19:341ce6a43a84
updates and redesign of key classes

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 13:2561e3855a81 19 // StatusReporter
ansond 13:2561e3855a81 20 #include "StatusReporter.h"
ansond 0:df2aa79c64f2 21
ansond 0:df2aa79c64f2 22 // our LCD Panel
ansond 0:df2aa79c64f2 23 #include "C12832_lcd.h"
ansond 0:df2aa79c64f2 24 C12832_LCD lcd;
ansond 0:df2aa79c64f2 25
ansond 0:df2aa79c64f2 26 // our Serial port
ansond 0:df2aa79c64f2 27 #include "Serial.h"
ansond 0:df2aa79c64f2 28 Serial pc(USBTX, USBRX);
ansond 0:df2aa79c64f2 29
ansond 3:03108e424931 30 // Ethernet
ansond 3:03108e424931 31 #include "EthernetInterface.h"
ansond 3:03108e424931 32 EthernetInterface ethernet;
ansond 3:03108e424931 33
ansond 6:427c387b10e7 34 // HARD RESET
ansond 6:427c387b10e7 35 extern "C" void HardFault_Handler() { NVIC_SystemReset(); }
ansond 6:427c387b10e7 36
ansond 0:df2aa79c64f2 37 // Main Entry...
ansond 0:df2aa79c64f2 38 int main() {
ansond 0:df2aa79c64f2 39 // create our object instances
ansond 13:2561e3855a81 40 ErrorHandler logger(&pc,&lcd);
ansond 0:df2aa79c64f2 41
ansond 0:df2aa79c64f2 42 // announce
ansond 13:2561e3855a81 43 logger.log("ARM/DreamForce 2014 mbed Status Reporter v%s",APP_VERSION);
ansond 0:df2aa79c64f2 44
ansond 3:03108e424931 45 // initialize Ethernet
ansond 3:03108e424931 46 logger.log("Initializing Ethernet...");
ansond 3:03108e424931 47 ethernet.init();
ansond 0:df2aa79c64f2 48
ansond 3:03108e424931 49 // get a DHCP address and bring the network interface up
ansond 3:03108e424931 50 logger.log("Getting IP Address...");
ansond 3:03108e424931 51 if (ethernet.connect() == 0) {
ansond 3:03108e424931 52 // log our IP address (DHCP)
ansond 3:03108e424931 53 logger.log("IP Address: %s",ethernet.getIPAddress());
ansond 3:03108e424931 54
ansond 13:2561e3855a81 55 // create the StatusReporter
ansond 13:2561e3855a81 56 StatusReporter status_reporter(&logger);
ansond 3:03108e424931 57
ansond 8:fefcecb66463 58 // entering main loop
ansond 8:fefcecb66463 59 logger.log("Entering Main Loop...\r\nScanning...");
ansond 8:fefcecb66463 60
ansond 3:03108e424931 61 // Enter the main loop
ansond 3:03108e424931 62 while(true) {
ansond 13:2561e3855a81 63 // check and report on status updates
ansond 13:2561e3855a81 64 status_reporter.checkAndReportOnStatus();
ansond 3:03108e424931 65
ansond 3:03108e424931 66 // wait a bit and look again
ansond 3:03108e424931 67 wait_ms(WAIT_TIME_MS);
ansond 3:03108e424931 68 }
ansond 3:03108e424931 69 }
ansond 3:03108e424931 70 else {
ansond 3:03108e424931 71 logger.log("No Network... Exiting...");
ansond 6:427c387b10e7 72 exit(1);
ansond 3:03108e424931 73 }
ansond 3:03108e424931 74
ansond 3:03108e424931 75 // disconnect
ansond 4:46459ed734f3 76 logger.log("Disconnecting...");
ansond 3:03108e424931 77 ethernet.disconnect();
ansond 4:46459ed734f3 78
ansond 4:46459ed734f3 79 // Exit
ansond 6:427c387b10e7 80 logger.log("Exiting...");
ansond 6:427c387b10e7 81 exit(1);
ansond 0:df2aa79c64f2 82 }