Run the C POSIX Sample Applications on Mac OS X

Run the C POSIX sample applications to learn how to use the client software library APIs. 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 Fusion Cloud IoT Intelligent Applications.

  1. Set up your development environment on Mac OS X. See Set Up Your Development Environment to use Mac OS X.
  2. Build the libraries. See Build the C POSIX Client Software Libraries on Mac OS X.
  3. Build the samples. See Build the C POSIX Client Software Library Sample Applications.
  4. Open a terminal window and run these commands:
    export IOTCS_OS_NAME=OSX
    export IOTCS_OS_VERSION=10.1
  5. Change directories to the build/sample/x86/<library option> directory, where <library option> is the library used to build the sample. For example, ts_md_vs.
  6. Run this command to run the directly connected device sample application: ./directly_connected_device_sample.out <path_to_your_provisioning_file> <your_provisioning_file_password>.
  7. Confirm the device is sending humidity and temperature data to Oracle Fusion Cloud IoT Intelligent Applications:
    1. Open the Oracle Fusion Cloud IoT Intelligent Applications Management Console.

      The URL format to access the IoT management console is: <iot instance name>.<domain name>/ui

      For example: https://myiotcs.mydomain.oraclecloud.com/ui or https://myiotcs.mydomain.oracleiotcloud.com/ui.

    2. Click the Menu (Menu icon) icon adjacent to the Oracle Fusion Cloud IoT Intelligent Applications title on the Management Console.
    3. Click Devices.
    4. Click Alerts and Messages.
    5. Click the Messages tab and confirm there are incoming messages.
  8. Change directories to the iotcs/csl/posix/build/sample/x86/<library option> directory, where <library option> is the library used to build the gateway sample. For example, ts_md_vs_gw.
  9. Run this command to run the gateway sample application: ./gateway_device_sample.out <path_to_your_provisioning_file> <your_provisioning_file_password>.
  10. Repeat step 7 to confirm the gateway is sending humidity and temperature data to Oracle Fusion Cloud IoT Intelligent Applications.