<br><font size=2 face="sans-serif">Hi all,</font>
<br>
<br><font size=2 face="sans-serif">I got some problems with the network
configuration when using C++. </font>
<br>
<br><font size=2 face="sans-serif">In the main.cpp source code I include:</font>
<br>
<br><font size=2 face="sans-serif">#include <rtems.h></font>
<br><font size=2 face="sans-serif">#include <bsp.h></font>
<br><font size=2 face="sans-serif">#include "../rtems/rtems_config.h"</font>
<br>
<br><font size=2 face="sans-serif">extern "C"</font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif"> #include
<rtems/rtems_bsdnet.h></font>
<br><font size=2 face="sans-serif">}</font>
<br><font size=2 face="sans-serif">#include "../rtems/rtems-network.h"</font>
<br>
<br><font size=2 face="sans-serif">#include <rtems/rtems_bsdnet.h>
is include within the extern statement because otherwise i cannot use the
rtems_bsdnet_initialize_network() method. The rtems-network.h is the network
configuration file (pretty similar to the one provided with the RTEMS examples)
and also is working perfectly with previous C projects.</font>
<br><font size=2 face="sans-serif">The problem is that when I try to compile
the application i get the next error:</font>
<br>
<br><font size=2 face="sans-serif">/home/aitor/workspace/OBSFramework/src/rtems/rtems-network.h:97:
invalid </font>
<br><font size=2 face="sans-serif"> conversion from `int (*)(rtems_bsdnet_ifconfig*)'
to `int </font>
<br><font size=2 face="sans-serif"> (*)(rtems_bsdnet_ifconfig*,
int)'</font>
<br>
<br>
<br><font size=2 face="sans-serif">where the line referenced in the error
is the next one</font>
<br>
<br><font size=2 face="sans-serif">static struct rtems_bsdnet_ifconfig
netdriver_config = {</font>
<br><font size=2 face="sans-serif"> RTEMS_BSP_NETWORK_DRIVER_NAME,
/*
name */</font>
<br><font size=2 face="sans-serif"> RTEMS_BSP_NETWORK_DRIVER_ATTACH,
/* attach function */</font>
<br>
<br><font size=2 face="sans-serif">#ifdef RTEMS_USE_LOOPBACK </font>
<br><font size=2 face="sans-serif"> &loopback_config,
/*
link to next interface */</font>
<br><font size=2 face="sans-serif">#else</font>
<br><font size=2 face="sans-serif"> NULL,
/*
No more interfaces */</font>
<br><font size=2 face="sans-serif">#endif</font>
<br>
<br><font size=2 face="sans-serif">#if (defined (RTEMS_USE_BOOTP))</font>
<br><font size=2 face="sans-serif"> NULL,
/*
BOOTP supplies IP address */</font>
<br><font size=2 face="sans-serif"> NULL,
/*
BOOTP supplies IP net mask */</font>
<br><font size=2 face="sans-serif">#else</font>
<br><font size=2 face="sans-serif"> "192.168.1.29",
/*
IP address */</font>
<br><font size=2 face="sans-serif"> "255.255.255.0",
/*
IP net mask */</font>
<br><font size=2 face="sans-serif">#endif /* !RTEMS_USE_BOOTP */</font>
<br>
<br><font size=2 face="sans-serif">#if (defined (RTEMS_SET_ETHERNET_ADDRESS))</font>
<br><font size=2 face="sans-serif"> ethernet_address,
/* Ethernet hardware address
*/</font>
<br><font size=2 face="sans-serif">#else</font>
<br><font size=2 face="sans-serif"> NULL,
/* Driver supplies hardware address */</font>
<br><font size=2 face="sans-serif">#endif</font>
<br><font size=2 face="sans-serif"> 0
/*
Use default driver parameters */</font>
<br><font size=2 face="sans-serif">};</font>
<br>
<br><font size=2 face="sans-serif">I don't know why this is happening.
Can anyone give a clue?</font>
<br>
<br><font size=2 face="sans-serif">Thanks in advance,</font>
<br>
<br><font size=2 face="sans-serif">Aitor</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Joel Sherrill <joel.sherrill@oarcorp.com></b>
</font>
<br><font size=1 face="sans-serif">Sent by: rtems-users-bounces+aitor.viana.sanchez=esa.int@rtems.org</font>
<p><font size=1 face="sans-serif">05/11/2007 15:18</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Leon Pollak <leonp@plris.com></font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">RTEMS Users <rtems-users@rtems.org></font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: TOD differences</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br><font size=2><tt>Leon Pollak wrote:<br>
> On Monday 05 November 2007 14:24, Joel Sherrill wrote:<br>
><br>
>> Leon Pollak wrote:<br>
>><br>
>>> Hello, all.<br>
>>> The question seems to be very simple, but I did not find any
answer in<br>
>>> docs, wiki...<br>
>>><br>
>>> I have two rtems_time_of_day structures containing two times.
How can I<br>
>>> calculate the difference (in seconds) between them?<br>
>>><br>
>> Not in the public API. With the movement in 4.8 to struct
timespec<br>
>> in the super core, there are a lot of timespec math routines.
There<br>
>> has always been some TOD to XXX routines.<br>
>><br>
>> I have considered making the existing set of time math routines<br>
>> available via the public API. It isn't especially hard to
do but<br>
>> would require documentation. If this is of interest to the<br>
>> community, I will move it from my idea list to my someday we might<br>
>> do this list.<br>
>><br>
> Thanks, Joel.<br>
> I definitely do not represent the community :-), but I vote "pro"!<br>
> Meanwhile, can you be so kind to "disclose" where I can
find any<br>
> internal "TOD_to_XXX" routine?<br>
><br>
Depends on the version. For 4.7 and older, the routine<br>
you want is _TOD_To_seconds() from the SuperCore.<br>
</tt></font>
<br><font size=2><tt>For 4.8 and newer, it has the same name but is part<br>
of the RTEMS Classic API since the SuperCore doesn't<br>
know the Classic API TOD structure any more.<br>
</tt></font>
<br><font size=2><tt>libbsp/shared/tod.c has an example of using it.<br>
</tt></font>
<br><font size=2><tt>In 4.8 and newer, there is also a set of timespec
math<br>
routines prototyped in score/include/rtems/score/timespec.h<br>
</tt></font>
<br><font size=2><tt>--joel<br>
> Again, thanks.<br>
><br>
</tt></font>
<br><font size=2><tt>_______________________________________________<br>
rtems-users mailing list<br>
rtems-users@rtems.com<br>
http://rtems.rtems.org/mailman/listinfo/rtems-users</tt></font>
<br>