COOJA Contiki mote main file. More...
#include <jni.h>
#include <stdio.h>
#include <string.h>
#include "contiki.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.h"
#include "net/netstack.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 "node-id.h"
#include "dev/rs232.h"
#include "dev/slip.h"
#include "net/uip.h"
#include "net/uip-fw.h"
#include "net/uip-fw-drv.h"
#include "net/uip-over-mesh.h"
Go to the source code of this file.
Functions | |
JNIEXPORT void JNICALL | Java_se_sics_cooja_corecomm_CLASSNAME_init (JNIEnv *env, jobject obj) |
Initialize a mote by starting processes etc. | |
JNIEXPORT void JNICALL | Java_se_sics_cooja_corecomm_CLASSNAME_getMemory (JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr) |
Get a segment from the process memory. | |
JNIEXPORT void JNICALL | Java_se_sics_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. | |
JNIEXPORT void JNICALL | Java_se_sics_cooja_corecomm_CLASSNAME_tick (JNIEnv *env, jobject obj) |
Let mote execute one "block" of code (tick mote). | |
JNIEXPORT void JNICALL | Java_se_sics_cooja_corecomm_CLASSNAME_setReferenceAddress (JNIEnv *env, jobject obj, jint addr) |
Set the relative memory address of the reference variable. |
COOJA Contiki mote main file.
Definition in file contiki-cooja-main.c.
JNIEXPORT void JNICALL Java_se_sics_cooja_corecomm_CLASSNAME_getMemory | ( | JNIEnv * | env, | |
jobject | obj, | |||
jint | rel_addr, | |||
jint | length, | |||
jbyteArray | mem_arr | |||
) |
Get a segment from the process memory.
start | Start address of segment | |
length | Size of memory segment |
Fetches a memory segment from the process memory starting at (start), 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 367 of file contiki-cooja-main.c.
JNIEXPORT void JNICALL Java_se_sics_cooja_corecomm_CLASSNAME_init | ( | JNIEnv * | env, | |
jobject | obj | |||
) |
Initialize a mote by starting processes etc.
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 345 of file contiki-cooja-main.c.
JNIEXPORT void JNICALL Java_se_sics_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.
start | 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 392 of file contiki-cooja-main.c.
JNIEXPORT void JNICALL Java_se_sics_cooja_corecomm_CLASSNAME_setReferenceAddress | ( | JNIEnv * | env, | |
jobject | obj, | |||
jint | addr | |||
) |
Set the relative memory address of the reference variable.
This is a JNI function and should only be called via the responsible Java part (MoteType.java).
Definition at line 474 of file contiki-cooja-main.c.
JNIEXPORT void JNICALL Java_se_sics_cooja_corecomm_CLASSNAME_tick | ( | JNIEnv * | env, | |
jobject | obj | |||
) |
Let mote execute one "block" of code (tick mote).
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 420 of file contiki-cooja-main.c.
References etimer_next_expiration_time(), etimer_pending(), and etimer_request_poll().