verge91
verge91

Reputation: 31

How to use external libraries and compile them along with a Contiki application

I want to be able to interface some sensors and send the sensor data to Thingspeak cloud using Contiki-OS. C libraries are available for interfacing sensors and the libthingspeak library is available for updating the feed on Thingspeak. I'm able to perform communication between two motes using the examples provided in examples/udp-ipv6 folder, setting one node as client and another as the server. How do I now include the required library code in my application and build it. What changes need to be made in the Makefile? I'm using cc2538 development kit.

Upvotes: 2

Views: 831

Answers (1)

kfx
kfx

Reputation: 8537

Use TARGET_LIBFILES variable. For example, to link with standard math library:

TARGET_LIBFILES += -lm

If necessary, add the path where the library resides to LDFLAGS:

LDFLAGS += -L/path/to/libraries

Upvotes: 1

Related Questions