Receiving data via TINA

  • 1
  • 2
  • 3
  • Page 1 of 3
nwrightson
Benutzer
Avatar
Gender:
Location: Newcastle
Age: 62
Homepage: nweha.homeserver.c…
Posts: 362
Registered: 08 / 2003
Subject:

Receiving data via TINA

 · 
Posted: 30.07.2007 - 07:50  ·  #1
Hi,

The Doc's in this area do not say anything and the examples do not show actual reception of data.
I have tried looking at the Wiznet Server examples and these make sense to me but do not apply to the TINA.

1) How do I receive data in via the TINA interface.

2) What is the difference between TinaRxStat and TinaPacketReceived

3) How do I check to find the status of the connection state?
I tried "ErrorState" but do not get valid status reported back.


I can transmit data to the PC and have actually received it :)
But it would be nice to know that I have actually established a connection to a PC.

Slightly different question. Why use a different Port for Tx then Receive? Why not the same port in & out?
FvMP
 
Avatar
 
Subject:

Re: Receiving data via TINA

 · 
Posted: 30.07.2007 - 08:47  ·  #2
Hello Neil,

regarding "connection status": A status doesn't exist for the connectionsless UDP protocol. The E-LAB proprietary xUDP-protocol should set STimeOutErr if the peer isn't responding.

Regards,

Frank
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Receiving data via TINA

 · 
Posted: 30.07.2007 - 12:02  ·  #3
Hello Frank,
Hello Neil,

yes, UDP has no connection state like TCP/IP. As Frank said, with xUDP you
can find out that the recepient is not reachable. With standard UDP this is not
possible. It is the job of the application to establish a "connection".

TinaRxStat and TinaPacketReceived are similar. The first doesn't change anything
in the Tina Stack. The second one changes the state of the stack.

The first one should be used for polling. The second one is the first to be used
when receiving a packet.

rolf
nwrightson
Benutzer
Avatar
Gender:
Location: Newcastle
Age: 62
Homepage: nweha.homeserver.c…
Posts: 362
Registered: 08 / 2003
Subject:

Re: Receiving data via TINA

 · 
Posted: 30.07.2007 - 12:14  ·  #4
Hi Rolf,
Thanks for the reply.

What state are you talking about? How is it changed?
Is it like SerStat?

I still don't understand how to get the data.
In the Wiznet a loop is performed to read the data one byte at a time from the wiznet chip into the AVRco buffer and then the buffer is copied out based on the number of bytes copied from the wiznet buffer to our buffer.

How does the TINA work?

Could you give an example of populating a target string from the buffer?

How do we know how big the string is to copy?

Any thoughts on the socket number question?
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Receiving data via TINA

 · 
Posted: 30.07.2007 - 12:24  ·  #5
Hello Neil,

with PacketReceived an internal state is set that (when true) the next access
will be the data read operation. The TinaRxStat doesn't disable interrupts, the
packetreceived does.

The TINA automatically transfers the received data to you buffer in the app
when ResumeReceive was previously executed. Your data then is in your
RxBuffer.

rolf
nwrightson
Benutzer
Avatar
Gender:
Location: Newcastle
Age: 62
Homepage: nweha.homeserver.c…
Posts: 362
Registered: 08 / 2003
Subject:

Re: Receiving data via TINA

 · 
Posted: 30.07.2007 - 12:34  ·  #6
Ah,

Starting to make sense now :)
Nothing like Wiznet, much simpler :)

Is the data transferred before or after the ResumeReceive?
Before I would presume.

I will give this a go at work in the morning.

Thanks Rolf.
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Receiving data via TINA

 · 
Posted: 30.07.2007 - 13:03  ·  #7
Hello Neil,

"ResumeReceive" tells the TINA that the present data in the buffer is processed
now and can be overwritten by a new packet. It means "the application is ready
to receive a new packet now".

Then polling the TinaRxStat returns the info if there is a new packet in the
buffer.

rolf
nwrightson
Benutzer
Avatar
Gender:
Location: Newcastle
Age: 62
Homepage: nweha.homeserver.c…
Posts: 362
Registered: 08 / 2003
Subject:

Re: Receiving data via TINA

 · 
Posted: 31.07.2007 - 01:52  ·  #8
Hi Rolf,

Couple more questions
1) How do I determine the size of the message that has been received?
2) How do I determine what IP address the message came from in order to reply to this connection.
  • 1
  • 2
  • 3
  • Page 1 of 3
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   121   135 · Page-Gen-Time: 0.026688s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI