|
Contiki 3.x
|
COOJA Contiki mote main file.More...
#include <jni.h>#include <stdio.h>#include <string.h>#include "contiki.h"#include "sys/cc.h"#include "sys/clock.h"#include "sys/etimer.h"#include "sys/cooja_mt.h"#include "sys/autostart.h"#include "lib/random.h"#include "lib/simEnvChange.h"#include "net/rime/rime.h"#include "net/netstack.h"#include "dev/eeprom.h"#include "dev/serial-line.h"#include "dev/cooja-radio.h"#include "dev/button-sensor.h"#include "dev/pir-sensor.h"#include "dev/vib-sensor.h"#include "sys/node-id.h"#include "dev/rs232.h"#include "dev/slip.h"#include "net/ip/uip.h"#include "net/ipv4/uip-fw.h"#include "net/uip-fw-drv.h"#include "net/ipv4/uip-over-mesh.h"#include "net/ipv6/uip-ds6.h"Go to the source code of this file.
Functions | |
| JNIEXPORT void JNICALL | Java_org_contikios_cooja_corecomm_CLASSNAME_init (JNIEnv *env, jobject obj) |
| Initialize a mote by starting processes etc. More... | |
| JNIEXPORT void JNICALL | Java_org_contikios_cooja_corecomm_CLASSNAME_getMemory (JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr) |
| Get a segment from the process memory. More... | |
| JNIEXPORT void JNICALL | Java_org_contikios_cooja_corecomm_CLASSNAME_setMemory (JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr) |
| Replace a segment of the process memory with given byte array. More... | |
| JNIEXPORT void JNICALL | Java_org_contikios_cooja_corecomm_CLASSNAME_tick (JNIEnv *env, jobject obj) |
| Let mote execute one "block" of code (tick mote). More... | |
| JNIEXPORT void JNICALL | Java_org_contikios_cooja_corecomm_CLASSNAME_setReferenceAddress (JNIEnv *env, jobject obj, jint addr) |
| Set the relative memory address of the reference variable. More... | |
COOJA Contiki mote main file.
Definition in file contiki-cooja-main.c.
| JNIEXPORT void JNICALL Java_org_contikios_cooja_corecomm_CLASSNAME_getMemory | ( | JNIEnv * | env, |
| jobject | obj, | ||
| jint | rel_addr, | ||
| jint | length, | ||
| jbyteArray | mem_arr | ||
| ) |
Get a segment from the process memory.
| env | JNI Environment interface pointer |
| obj | unused |
| rel_addr | Start address of segment |
| length | Size of memory segment |
| mem_arr | Byte array destination for the fetched memory segment |
Fetches a memory segment from the process memory starting at
(rel_addr), with size (length). This function does not perform
ANY error checking, and the process may crash if addresses are
not available/readable.
This is a JNI function and should only be called via the
responsible Java part (MoteType.java). Definition at line 397 of file contiki-cooja-main.c.
| JNIEXPORT void JNICALL Java_org_contikios_cooja_corecomm_CLASSNAME_init | ( | JNIEnv * | env, |
| jobject | obj | ||
| ) |
Initialize a mote by starting processes etc.
| env | JNI Environment interface pointer |
| obj | unused This function initializes a mote by starting certain
processes and setting up the environment.
This is a JNI function and should only be called via the
responsible Java part (MoteType.java). |
Definition at line 372 of file contiki-cooja-main.c.
References NULL.
| JNIEXPORT void JNICALL Java_org_contikios_cooja_corecomm_CLASSNAME_setMemory | ( | JNIEnv * | env, |
| jobject | obj, | ||
| jint | rel_addr, | ||
| jint | length, | ||
| jbyteArray | mem_arr | ||
| ) |
Replace a segment of the process memory with given byte array.
| env | JNI Environment interface pointer |
| obj | unused |
| rel_addr | Start address of segment |
| length | Size of memory segment |
| mem_arr | Byte array contaning new memory Replaces a process memory segment with given byte array.
This function does not perform ANY error checking, and the
process may crash if addresses are not available/writable.
This is a JNI function and should only be called via the
responsible Java part (MoteType.java). |
Definition at line 424 of file contiki-cooja-main.c.
| JNIEXPORT void JNICALL Java_org_contikios_cooja_corecomm_CLASSNAME_setReferenceAddress | ( | JNIEnv * | env, |
| jobject | obj, | ||
| jint | addr | ||
| ) |
Set the relative memory address of the reference variable.
| env | JNI Environment interface pointer |
| obj | unused |
| addr | Relative memory address This is a JNI function and should only be called via the
responsible Java part (MoteType.java). |
Definition at line 509 of file contiki-cooja-main.c.
| JNIEXPORT void JNICALL Java_org_contikios_cooja_corecomm_CLASSNAME_tick | ( | JNIEnv * | env, |
| jobject | obj | ||
| ) |
Let mote execute one "block" of code (tick mote).
| env | JNI Environment interface pointer |
| obj | unused Let mote defined by the active contiki processes and current
process memory execute some program code. This code must not block
or else this function will never return. A typical contiki
process will return when it executes PROCESS_WAIT..() statements.
Before the control is left to contiki processes, any messages
from the Java part are handled. These may for example be
incoming network data. After the contiki processes return control,
messages to the Java part are also handled (those which may need
special attention).
This is a JNI function and should only be called via the
responsible Java part (MoteType.java). |
Definition at line 453 of file contiki-cooja-main.c.
References etimer_next_expiration_time(), etimer_pending(), and etimer_request_poll().
1.8.6