Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESERT_Framework/DESERT/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ SUBDIRS = m4 \
data_link/uwtokenbus \
data_link/uwjammer \
data_link/uw-cs-burst \
data_link/uwtwr \
channel/uwem_channel \
channel/uwoptical_channel \
ranging/uwranging_tokenbus \
Expand Down
1 change: 1 addition & 0 deletions DESERT_Framework/DESERT/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ AC_CONFIG_FILES([
data_link/uwtokenbus/Makefile
data_link/uwjammer/Makefile
data_link/uw-cs-burst/Makefile
data_link/uwtwr/Makefile
channel/uwem_channel/Makefile
channel/uwoptical_channel/Makefile
ranging/uwranging_tokenbus/Makefile
Expand Down
57 changes: 57 additions & 0 deletions DESERT_Framework/DESERT/data_link/uwtwr/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the University of Padova (SIGNET lab) nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

AM_CXXFLAGS = -Wall -ggdb3

lib_LTLIBRARIES = libuwtwr.la
check_PROGRAMS =

SUBDIRS =

TESTS =

libuwtwr_la_SOURCES = initlib.cpp\
uwtwr_default.tcl\
uwtwr_AAUV.cpp\
uwtwr_NODE.cpp\
uwtwr_PAUV.cpp

libuwtwr_la_CPPFLAGS = @NS_CPPFLAGS@ @NSMIRACLE_CPPFLAGS@ @DESERT_CPPFLAGS@
libuwtwr_la_LDFLAGS = @NS_LDFLAGS@ @NSMIRACLE_LDFLAGS@ @DESERT_LDFLAGS@
libuwtwr_la_LIBADD = @NS_LIBADD@ @NSMIRACLE_LIBADD@ @DESERT_LIBADD@

nodist_libuwtwr_la_SOURCES = InitTcl.cc
BUILT_SOURCES = InitTcl.cc
CLEANFILES = InitTcl.cc

TCL_FILES = uwtwr_default.tcl

InitTcl.cc: Makefile $(TCL_FILES)
cat $(VPATH)/$(TCL_FILES) | @TCL2CPP@ uwtwr_default > InitTcl.cc

EXTRA_DIST = $(TCL_FILES)
94 changes: 94 additions & 0 deletions DESERT_Framework/DESERT/data_link/uwtwr/initlib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
//
// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the University of Padova (SIGNET lab) nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

/**
* @file uwtwr/initlib.cpp
* @author Yuehan Jiang
* @version 1.0.0
*
* @brief Provide the initialization of the uwtwr libraries
*/

#include <tclcl.h>
#include "uwtwr_AAUV.h"
#include "uwtwr_PAUV.h"
#include "uwtwr_NODE.h"
#include "uwtwr_cmn_hdr.h"
#include "sap.h"
#include "packet.h"

int hdr_POLL::offset_ = 0;
int hdr_ACK_NODE::offset_ = 0;

packet_t PT_POLL;
packet_t PT_ACK_NODE;

/**
* Class that describe the Header of POLL Packet
*/
static class PollHeaderClass : public PacketHeaderClass
{
public:
/**
* Constructor of the class
*/
PollHeaderClass()
: PacketHeaderClass("PacketHeader/POLL", sizeof(hdr_POLL))
{
this->bind();
bind_offset(&hdr_POLL::offset_);
}
} class_hdr_POLL;

/**
* Class that describe the Header of ACK sent by the node
*/
static class AckNodeHeaderClass : public PacketHeaderClass
{
public:
/**
* Constructor of the class
*/
AckNodeHeaderClass()
: PacketHeaderClass("PacketHeader/ACK_NODE", sizeof(hdr_ACK_NODE))
{
this->bind();
bind_offset(&hdr_ACK_NODE::offset_);
}
} class_hdr_ACK_NODE;

extern EmbeddedTcl uwtwr_default;

extern "C" int
Uwtwr_Init()
{
PT_POLL = p_info::addPacket("UWTWR/POLL");
PT_ACK_NODE = p_info::addPacket("UWTWR/ACK_NODE");
uwtwr_default.load();
return 0;
}
Loading