Re: tini1.12 bug?

Shawn Silverman <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.tini
Message-ID <[email protected]>
Could it be that it is returning a 16-byte array with the last four bytes
containing what you need?

Try this (to catch 4- and 16-byte cases, although TINI may always only
return one):
	int len = ip.length;
	ip[len - 4], ip[len - 3], ip[len - 2], ip[len - 1]

instead of:
	ip[0], ip[1], ip[2], ip[3]

	-Shawn

On Thu, 11 Mar 2004, Wes Stupar wrote:

> I am running TINI OS 1.12 with the following code:
>
>    InetAddress hisIA = sock.getInetAddress();
>    String rawIP = hisIA.toString();
>    String hisSt = rawIP.substring(0, rawIP.indexOf('/'));
> /**/System.out.println("Connect address = " + hisSt);
>    hisIP = TININet.stringToIP(new String(hisSt));
> /**/System.out.println("Connect IP = " + IPstring(hisIP) +
> ", Ctl 0 = " + IPstring(Conf.Ctl0IP) + ", Ctl 1 = " +
> IPstring(Conf.Ctl1IP));
>
> I am trying to get the byte[4] version of the IPv4 address from the
> socket (sock). I tried
>    hisIP = sock.getInetAddress().getAddress();
> and that returned all zeros. So I tried the above and I still get all zeros:
>
> Connect address = 192.9.200.103
> Connect IP = 0.0.0.0, Ctl 0 = 192.9.100.125, Ctl 1 = 0.0.0.0
>
> Is this a bug in tini1.12?
>
> Wes Stupar
>
> _______________________________________________
> TINI mailing list
> TINI-6tN4nzCoH/[email protected]
> To UNSUBSCRIBE, edit your profile, or see list archives:
> http://lists.dalsemi.com/mailman/listinfo/tini
>
>

--
Neil laughed when the boomerang he threw returned to him, baffling his dog
who was trying to fetch it.
_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.