[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: RE : [lwip-users] Cleaning up my code and I was wondering....
From: |
Julian Gardner [RSD] |
Subject: |
RE: RE : [lwip-users] Cleaning up my code and I was wondering.... |
Date: |
Tue, 18 Dec 2007 14:33:30 -0000 |
Found that one and I now have my code calling tcpip_callback(
netif_set_link_up, netif); and tcpip_callback( netif_set_link_down, netif);
depending on the link status from the chip.
Is this the correct way for getting the library UP, as i seem to have the
link_up working now?
netif_add( &smcif_if, &ipaddr, &netmask, &gw, NULL, smcIfinit,
tcpip_input);
netif_set_default( &smcif_if);
if( e2Prom.ethernetSettings.dhcpActive )
{
dhcp_start( &smcif_if);
}
else
{
netif_set_up( &smcif_if);
}
And now in my main tcp loop i wait for netif_is_up, and when this happens i can
start my apps?
Julian Gardner
RSD Communications Ltd
Unit 2
8 BorrowMeadow Road
Springkerse Industrial Estate
Stirling, Scotland FK7 7UW
Tel +44 [0]1786 450572 Ext 238 (Main)
Fax +44 [0]1786 474653
GSM +44 [0]7836 240907
Email address@hidden
Skype joolzg
MSN address@hidden
WWW http://www.rsd.tv http://www.rsdtv.com
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf
> Of Frédéric BERNON
> Sent: 18 December 2007 13:13
> To: Mailing list for lwIP users
> Subject: RE : [lwip-users] Cleaning up my code and I was wondering....
>
> >As the code is a bit of a mess as I have moved up from V1.0 I would
> >like to spend a little time getting this side working, any
> nice bits of
> >code to look at or anything else, looked in the WIKI and its a TODO
>
> http://lwip.scribblewiki.com/Writing_a_device_driver "Link
> change events"
>
> Is it waht you look for ?
>
>
> ====================================
> Frédéric BERNON
> HYMATOM SA
> Chef de projet informatique
> Microsoft Certified Professional
> Tél. : +33 (0)4-67-87-61-10
> Fax. : +33 (0)4-67-70-85-44
> Email : address@hidden
> Web Site : http://www.hymatom.fr
> ====================================
> P Avant d'imprimer, penser à l'environnement
>
>
>
> -----Message d'origine-----
> De : address@hidden
> [mailto:address@hidden
> rg] De la part de Julian Gardner [RSD] Envoyé : mardi 18
> décembre 2007 12:42 À : Mailing list for lwIP users Objet :
> [lwip-users] Cleaning up my code and I was wondering....
>
>
> I have a couple of projects I want to clean up and was
> looking at the contrib directory for the correct way to start
> the stack up, with dhcp and also to watch the link.
>
> What I was looking for is something that showed the correct
> way of telling the stack the link (SMSC chip) is up or down,
> and then if needed start the DHCP client and when all this is
> done (either dhcp has address of its timed out) I can start
> my routines that depend on the stack being alive, and when
> the LINK or DHCP change then again my code is either stopped
> or restarted with the new IP addresses.
>
> As the code is a bit of a mess as I have moved up from V1.0 I
> would like to spend a little time getting this side working,
> any nice bits of code to look at or anything else, looked in
> the WIKI and its a TODO
>
> So my code does the following
>
> Init HARDWARE (sms911117)
> Loop around until the smsc gives a linkup Start DHCP Loop
> around until DHCP has finished Start my ethernet dependant code
>
> Julian Gardner
>
> RSD Communications Ltd
> Unit 2
> 8 BorrowMeadow Road
> Springkerse Industrial Estate
> Stirling, Scotland FK7 7UW
>
> Tel +44 [0]1786 450572 Ext 238 (Main)
> Fax +44 [0]1786 474653
> GSM +44 [0]7836 240907
>
> Email address@hidden
> Skype joolzg
> MSN address@hidden
> WWW http://www.rsd.tv http://www.rsdtv.com
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>