# C

## Embedded C Client Library - Introduction

> Embedded C client for interacting with the IBM Watson Internet of Things Platform.

```bash
root@board:~# git clone https://github.com/ibm-messaging/iotf-embeddedc.git
Cloning into 'iotf-embeddedc'...
remote: Counting objects: 124, done.
remote: Total 124 (delta 0), reused 0 (delta 0), pack-reused 124
Receiving objects: 100% (124/124), 71.47 KiB | 0 bytes/s, done.
Resolving deltas: 100% (59/59), done.
Checking connectivity... done.
root@board:~# cd iotf-embeddedc/
root@board:~/iotf-embeddedc# ls
LICENSE          gatewayclient.c  iotfclient.h
README.md        gatewayclient.h  lib
buildlib.sh      iotfclient.c     samples
root@board:~/iotf-embeddedc# ./buildlib.sh
Compiling source files ...
Linking libiotf.so libwiotdevice.so
Removing temporary files...
Build complete
root@board:~/iotf-embeddedc# cd samples/
root@board:~/iotf-embeddedc/samples# ls
Makefile         build.sh         gateway.cfg      sampleDevice.c
README.md        device.cfg       helloWorld.c     sampleGateway.c
root@board:~/iotf-embeddedc/samples# make          
cc sampleDevice.c -I ./../ -I ./../lib ./../iotfclient.c ./../lib/MQTTClient.c ./../lib/MQTTLinux.c ./../libe
strip sampleDevice            
cc helloWorld.c -I ./../ -I ./../lib ./../iotfclient.c ./../lib/MQTTClient.c ./../lib/MQTTLinux.c ./../lib/Md
strip helloWorld
cc sampleGateway.c -I ./../ -I ./../lib ./../gatewayclient.c ./../lib/MQTTClient.c ./../lib/MQTTLinux.c ./..y
strip sampleGateway
root@board:~/iotf-embeddedc/samples# ./helloWorld 
Usage: helloWorld deviceId
where,                                                                           deviceId is a 12 digit hex                                                       root@board:~/iotf-embeddedc/samples# ./helloWorld 123456789123                   Connection Successful. Press Ctrl+C to quit                                       View the visualization at https://quickstart.internetofthings.ibmcloud.com/#/device/123456789123                 Publishing the event stat with rc  0                                             Publishing the event stat with rc  0
...
[Open your web browser and go the address specified above]
...
Publishing the event stat with rc  0
Publishing the event stat with rc  0
^ CSigINT received.
Quitting!!                                                                       root@board:~/iotf-embeddedc/samples#
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://theiotlearninginitiative.gitbook.io/ibminternetofthings/watson/clients/c.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
