Run the Sample Gateway Application

Run the iOS sample gateway application to learn how to use the client software library APIs. The gateway device samples use software to simulate temperature and humidity sensors. The class TemperatureSensor and the class HumiditySensor are used to simulate data points on a sine wave. The gateway sample applications periodically send temperature, humidity, and alert messages to Oracle Internet of Things Cloud Service. The gateway sample sets a threshold value, resets the device, and then switches the device on or off. The attributes, actions, and alerts of the sample temperature and humidity sensors are specified in device models which you upload to Oracle Internet of Things Cloud Service.

About the Sample Gateway Application

The sample application is located in the iotcs/csl/ios/samples directory and it uses a high-level, virtual device abstraction that hides details of sending and receiving data from Oracle Internet of Things Cloud Service.

  1. Upload the humidity and temperature sensor device models to Oracle Internet of Things Cloud Service. See Upload the Sample Device Models.
  2. Register the device and download the provisioning file.

    Note:

    Do not reuse the device from the Running the Sample Directly Connected Device Applications procedure. This procedure requires a device with indirect activation capability.
  3. Run the GatewayDeviceSample application:
    1. Open Xcode and then open the GatewayDeviceSample.xcodeproj file located in the iotcs/csl/ios/samples directory.
    2. Right-click the project name and select Add Files to “GatewayDeviceSample”.
    3. Browse to the location of the provisioning file and then click Add.
    4. Expand the GatewayDeviceSample folder and select the TrustStore.plist file.
    5. Click the filename field and enter the name of your provisioning file without the file extension.
    6. Click the fileextension field and enter file the extension of the provisioning file.
    7. Click the password field and enter the provisioning file password.
    8. Run the GatewayDeviceSample application. Output similar to this image appears: