DenYoNet received

Страница 7/10
1 | 2 | 3 | 4 | 5 | 6 | | 8 | 9 | 10

By konamiman

Paragon (1211)

Аватар пользователя konamiman

27-07-2011, 21:37

Of course, I was just kidding. One thing I have learned after so many years as a programmer is that nobody noticing bugs in your software means that nobody is actually using your software. Smile

By Manuel

Ascended (19678)

Аватар пользователя Manuel

27-07-2011, 22:15

Indeed Smile

By W76NearDark

Paladin (684)

Аватар пользователя W76NearDark

27-07-2011, 23:59

I don´t know if you have access if not i'll upload it to other place:
http://es.groups.yahoo.com/group/hispamsx/files/Utilidades/inlutil.zip

Indeed I have no access to this location... Could you give it another try?

By Sd-Snatcher

Hero (582)

Аватар пользователя Sd-Snatcher

28-07-2011, 17:58

By SMDNearDark

Master (136)

Аватар пользователя SMDNearDark

28-07-2011, 23:09

I'm having trouble recieving more then 1493 bytes of data from a file of 5KB using the UNAPI

What is exactly the way to approach this? Is there any example code for this loop ?

this is my current function which retrieves max &H5B2 (=1493) bytes

WaitForData:
call SET_UNAPI ; Wait for activity
ld a,TCPIP_WAIT
call CALL_UNAPI

call SET_UNAPI
ld a,(CON_NUM)
ld b,a
ld hl,0
ld a,TCPIP_TCP_STATE
call CALL_UNAPI
ld a,h ; Nr of bytes waiting for retrieval
or l
jr z,WaitForData

call Buffer.SetPage2 ; Activate buffersegment in page2

.Loop call SET_UNAPI
ld a,TCPIP_WAIT
call CALL_UNAPI

call SET_UNAPI
ld a,(CON_NUM) ; Retrieve data from buffer
ld b,a
ld de,(NTA)
ld hl,512
ld a,TCPIP_TCP_RCV
call CALL_UNAPI

ld hl,(NTA) ; Update transfer address
add hl,bc
ld (NTA),hl

ld a,b ; If BC = 0, no data left to retrieve
or c
jr nz,.Loop

.End ld hl,BUFFER
ld (NTA),hl
jp Buffer.Restore

By konamiman

Paragon (1211)

Аватар пользователя konamiman

29-07-2011, 08:31

First of all, after the call to TCPIP_TCP_STATE you should check that the connection state is still "Established". If not, it means that the remote side has closed the connection and therefore will not send more data.

Also, can you use a packet sniffer (Wireshark or the like) to check that the data is actually sent to the MSX?

If you want code examples, look at the source code of any of my networking applications on my web page (most of them are written in C, though).

By SMDNearDark

Master (136)

Аватар пользователя SMDNearDark

29-07-2011, 15:13

I just checked and all data is being sent from my server to the msx. It only seems that the msx stops checking for data too early.

I noticed in winshark that there is a flag 0x10H for an ACK packet and a flag 0x18H PSH, ACK for the last packet in the stream. This flag is not returned by the TCPIP_TCP_RCV UANPI call.

Is there some way to check for this flag.

By SMDNearDark

Master (136)

Аватар пользователя SMDNearDark

29-07-2011, 20:59

I guess the only way to do this is making a special header for file download containing length and more info about the file.

By Manuel

Ascended (19678)

Аватар пользователя Manuel

29-07-2011, 23:49

SMDNearDark: that *is* normal HTTP practice though Smile

By SMDNearDark

Master (136)

Аватар пользователя SMDNearDark

30-07-2011, 02:37

I managed to fix it another way ^^

I just add the text FILDONE at the end of the data and check it while recieving Smile

It would still be nice though if there was a possibility to read out that flag somehow, i couldnt find anything about the flag in the W5100 datasheet.

Is there any way to increase the buffer size? There seems to be a 16KB segment on the chip while only 2KB is used for rcv buffer and 1KB for the send buffer. As far as i counted less then 512 bytes is used for variabeles while 4KB is reserved for it.

Страница 7/10
1 | 2 | 3 | 4 | 5 | 6 | | 8 | 9 | 10