Skip to content

Commit

Permalink
CoreComm: move to contikimote package
Browse files Browse the repository at this point in the history
This class no longer needs to be exposed
to the world.
  • Loading branch information
pjonsson committed Aug 31, 2023
1 parent 9d38cd5 commit fc8b362
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion java/org/contikios/cooja/contikimote/ContikiMoteType.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.contikios.cooja.AbstractionLevelDescription;
import org.contikios.cooja.ClassDescription;
import org.contikios.cooja.Cooja;
import org.contikios.cooja.CoreComm;
import org.contikios.cooja.Mote;
import org.contikios.cooja.MoteInterface;
import org.contikios.cooja.ProjectConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
*/

package org.contikios.cooja;
package org.contikios.cooja.contikimote;

import java.io.File;
import java.lang.foreign.FunctionDescriptor;
Expand All @@ -41,7 +41,7 @@
*/
// Do not bother end-user with warnings about internal Cooja details.
@SuppressWarnings("preview")
public class CoreComm {
class CoreComm {
private final SymbolLookup symbols;
private final MethodHandle coojaTick;
/**
Expand All @@ -50,7 +50,7 @@ public class CoreComm {
* @param scope Scope to load the library file in
* @param libFile Library file
*/
public CoreComm(SegmentScope scope, File libFile) {
CoreComm(SegmentScope scope, File libFile) {
symbols = SymbolLookup.libraryLookup(libFile.getAbsolutePath(), scope);
var linker = Linker.nativeLinker();
coojaTick = linker.downcallHandle(symbols.find("cooja_tick").get(),
Expand All @@ -68,7 +68,7 @@ public CoreComm(SegmentScope scope, File libFile) {
/**
* Ticks a mote once.
*/
public void tick() {
void tick() {
try {
coojaTick.invokeExact();
} catch (Throwable e) {
Expand All @@ -79,7 +79,7 @@ public void tick() {
/**
* Returns the absolute memory address of the reference variable.
*/
public long getReferenceAddress() {
long getReferenceAddress() {
return symbols.find("referenceVar").get().address();
}
}

0 comments on commit fc8b362

Please sign in to comment.