Problem in executing a basic veins example

114 views
Skip to first unread message

Ivo Calado

unread,
Apr 22, 2018, 6:43:34 PM4/22/18
to omn...@googlegroups.com
Hi fellows,
   I'm trying to execute the basic "hello world" example of Veins Framework. I followed all the instructions to build veins (http://veins.car2x.org/tutorial/). Nevertheless, it fails in the initialization step due to a cast problem, as shown below. Any tip on how to proceed?




--
Prof. Ivo Calado, D.Sc.
Instituto Federal de Alagoas - http://ifal.edu.br/
Site: http://sigaa.ifal.edu.br/sigaa/public/docente/portal.jsf?siape=1819085

Quidquid latine dictum sit, altum viditur

Ivo Calado

unread,
Apr 24, 2018, 12:22:15 AM4/24/18
to omn...@googlegroups.com
Hi fellows,
I have made a workaround in order to properly execute the
aforementioned example. I just changed the headerLenght and bitrate
from double to int as the the patch presented below. Could someone
confirm if this is the correct approach to follow?

Kind regards,
Ivo


diff --git a/src/veins/base/modules/BaseMacLayer.ned
b/src/veins/base/modules/BaseMacLayer.ned
index a639f4c..aad7caa 100644
--- a/src/veins/base/modules/BaseMacLayer.ned
+++ b/src/veins/base/modules/BaseMacLayer.ned
@@ -6,7 +6,7 @@ simple BaseMacLayer extends BaseLayer like IWirelessMac
parameters:
@class(BaseMacLayer);
bool coreDebug = default(false); // debug switch
- double headerLength @unit(bit); // length of the
MAC packet header (in bits)
+ int headerLength @unit(bit); // length of the MAC
packet header (in bits)
string address = default("auto"); // MAC address as
hex string (12 hex digits), or
// "auto". "auto"
values will be replaced by
// a generated MAC
address in init stage 1.
diff --git a/src/veins/base/modules/IWirelessMac.ned
b/src/veins/base/modules/IWirelessMac.ned
index 054c1e0..a6e6f76 100644
--- a/src/veins/base/modules/IWirelessMac.ned
+++ b/src/veins/base/modules/IWirelessMac.ned
@@ -5,7 +5,7 @@ moduleinterface IWirelessMac
{
parameters:
@class(BaseMacLayer);
- double headerLength @unit(bit); // length of the
MAC packet header (in bits)
+ int headerLength @unit(bit); // length of the MAC
packet header (in bits)
string address; // MAC address as
hex string (12 hex digits), or
// "auto". "auto"
values will be replaced by
// a generated MAC
address in init stage 1.
diff --git a/src/veins/modules/mac/ieee80211p/Mac1609_4.ned
b/src/veins/modules/mac/ieee80211p/Mac1609_4.ned
index 1200f56..2d36fc5 100755
--- a/src/veins/modules/mac/ieee80211p/Mac1609_4.ned
+++ b/src/veins/modules/mac/ieee80211p/Mac1609_4.ned
@@ -50,7 +50,7 @@ simple Mac1609_4 extends BaseMacLayer
headerLength @unit(bit) = default(0 bit);

// bit rate
- double bitrate @unit(bps) = default(6 Mbps);
+ int bitrate @unit(bps) = default(6 Mbps);

// maximum artificial asynchronization between cars to avoid
synchronization effects
double syncOffset @unit(s) = default(0.0003s);
~

On Sun, Apr 22, 2018 at 7:42 PM, Ivo Calado <ivo.c...@ifal.edu.br> wrote:
> Hi fellows,
> I'm trying to execute the basic "hello world" example of Veins Framework.
> I followed all the instructions to build veins
> (http://veins.car2x.org/tutorial/). Nevertheless, it fails in the
> initialization step due to a cast problem, as shown below. Any tip on how to
> proceed?
>
>
>
>

David Eckhoff

unread,
Apr 24, 2018, 2:53:57 AM4/24/18
to omn...@googlegroups.com, Ivo Calado
Dear Ivo,

you seem to be right
see
https://github.com/sommer/veins/commit/493f8a3f514bd8ffd7fb5d9666a952a4446ab177

you could just clone the git repo, might be easier.

- david

Ivo Calado

unread,
Apr 24, 2018, 12:08:23 PM4/24/18
to David Eckhoff, omn...@googlegroups.com
David, thank you very much for your reply!

My best regards,
Ivo
Reply all
Reply to author
Forward
0 new messages