contiki:minimal-net-linux
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| contiki:minimal-net-linux [2016/11/25 06:25] – [Schritt 1: Füge die project-conf.h Datei zum Makefile hinzu] admin | contiki:minimal-net-linux [2017/01/24 18:49] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== Contiki als Linux Prozess ====== | ====== Contiki als Linux Prozess ====== | ||
| - | |||
| - | ===== Project Configuration File===== | ||
| ===== Verwendung einer projektspezifischen Grundkonfiguration in Contiki ===== | ===== Verwendung einer projektspezifischen Grundkonfiguration in Contiki ===== | ||
| - | The sequence of the definitions that are taken into account while compiling is: | + | Die Reihenfolge mit der die Definitionen bei der Compilierung eingebunden werden ist die folgende: |
| - Definitionen in '' | - Definitionen in '' | ||
| Zeile 21: | Zeile 19: | ||
| ==== Schritt 1: Füge die project-conf.h Datei zum Makefile hinzu ==== | ==== Schritt 1: Füge die project-conf.h Datei zum Makefile hinzu ==== | ||
| - | Dazu muss die folgende Zeile zum Makefile des Projekts hinzugefügt werden: | + | Dazu muss die folgende Zeile zum '' |
| - | CFLAGS | + | <code make> |
| + | | ||
| + | </ | ||
| - | Zum Beispiel so: | + | Weiterhin ist es sinnvoll im '' |
| - | < | + | |
| + | < | ||
| + | # Project specific config file - start | ||
| + | DEFINES+=PROJECT_CONF_H=\" | ||
| + | # Project specific config file - end | ||
| + | |||
| + | all: udp-server udp-client | ||
| + | |||
| + | # Project specific compile target - start | ||
| ifndef TARGET | ifndef TARGET | ||
| TARGET = minimal-net | TARGET = minimal-net | ||
| + | CFLAGS += -DPROJECT_TARGET=" | ||
| endif | endif | ||
| + | # Project specific compile target - end | ||
| CONTIKI = ../.. | CONTIKI = ../.. | ||
| - | CFLAGS += -DPROJECT_CONF_H=\" | + | CONTIKI_WITH_IPV6 |
| + | include $(CONTIKI)/ | ||
| </ | </ | ||
| - | ==== Schritt 2: Mache die project-conf.h | + | ==== Schritt 2: Integriere |
| + | |||
| + | Die Datei | ||
| + | '' | ||
| + | In den meisten Plattformen werden projektspezifische Einstellungen gar nicht, oder erst am Ende | ||
| + | der Plattformkonfiguration geladen. Diese müssen aber bereits am Anfang bekannt sein, damit | ||
| + | die Abhängigkeiten korrekt aufgelöst werden. | ||
| - | contiki/ | ||
| <code c> | <code c> | ||
| Zeile 43: | Zeile 59: | ||
| #define CONTIKI_CONF_H | #define CONTIKI_CONF_H | ||
| - | /* include the project config */ | + | /*---------------------------------------------------------------------------*/ |
| + | /* Include | ||
| /* PROJECT_CONF_H might be defined in the project Makefile */ | /* PROJECT_CONF_H might be defined in the project Makefile */ | ||
| #ifdef PROJECT_CONF_H | #ifdef PROJECT_CONF_H | ||
| #include PROJECT_CONF_H | #include PROJECT_CONF_H | ||
| #endif /* PROJECT_CONF_H */ | #endif /* PROJECT_CONF_H */ | ||
| + | / | ||
| </ | </ | ||
| - | + | ==== Schritt 3: Anpassen der Datei project-conf.h ==== | |
| - | ==== Schritt 3: Passe die Datei project-conf.h | + | |
| '' | '' | ||
| <code c> | <code c> | ||
| - | # | + | /* |
| - | # | + | * My project-conf.h file |
| + | * for TARGET=minimal-net | ||
| + | */ | ||
| + | |||
| + | # | ||
| + | # | ||
| #ifdef UIP_CONF_IPV6_RPL | #ifdef UIP_CONF_IPV6_RPL | ||
| Zeile 68: | Zeile 90: | ||
| #endif / | #endif / | ||
| - | #endif /* PROJECT_H_ | + | UIP_CONF_BUFFER_SIZE 1300 |
| + | |||
| + | #endif /* PROJECT_CONF_H_ | ||
| </ | </ | ||
| ==== Schritt 4: Recompile ==== | ==== Schritt 4: Recompile ==== | ||
| + | <code bash> | ||
| make clean | make clean | ||
| - | make TARGET=xyz | + | make <TARGET=xyz> |
| + | </ | ||
| + | |||
| + | ===== Erkunden und Dokumentieren der Grundfähigkeiten des Systems ===== | ||
| + | |||
| + | Da Contiki Programme meistens nicht interaktiv erkundet werden können, ist es ratsam wichtige Einstellungen | ||
| + | direkt anzeigen zu lassen um Vergleiche zwischen verschiedenen Versionen von Binärprogrammen zu ermöglichen. | ||
| + | Dazu wird der folgende Code an einer passenden Stelle im Programm eingefügt: | ||
| + | |||
| + | <code c> | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | #if PROJECT_TARGET != minimal-net | ||
| + | |||
| + | printf(" | ||
| + | printf(" | ||
| + | printf(" | ||
| + | printf(" | ||
| + | printf(" | ||
| + | printf(" | ||
| + | printf(" | ||
| + | |||
| + | #endif /* PROJECT_TARGET */ | ||
| + | |||
| + | |||
| + | </ | ||
contiki/minimal-net-linux.1480055105.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
