This "Getting Started" document shows you how to build and run the simplesample_amqp application on a desktop Linux platform.
These instructions assume that you have done the following:
Before you begin you will need to create and configure an IoT hub to connect to.
- Set up your IoT Hub.
- With your IoT hub configured and running in Azure, follow the instructions in Connecting your device to an IoT hub.
- Make note of the Connection String for your device from the previous step.
Note: You can skip this step if you just want to build the sample application without running it.
-
Open the file c/serializer/samples/simplesample_amqp/simplesample_amqp.c in a text editor.
-
Locate the following code in the file:
static const char* connectionString = "[device connection string]";
-
Replace "[device connection string]" with the device connection string you noted earlier. Save the changes.
-
The section "Send events" in the document How to use Device Explorer describes how to prepare the DeviceExplorer tool to receive device-to-cloud messages from the sample application.
-
Save your changes and build the samples. To build your sample you can run the the build.sh script in the c/build_all/linux directory.
-
Run the ~/cmake/serializer/samples/simplesample_amqp/simplesample_amqp sample application.
-
Use the DeviceExplorer utility to observe the messages IoT Hub receives from the simplesample_amqp application.
-
See "Send cloud-to-device messages" in the document How to use Device Explorer for IoT Hub devices for instructions on sending messages with the DeviceExplorer utility.