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.
Indeed
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?
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
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).
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.
I guess the only way to do this is making a special header for file download containing length and more info about the file.
SMDNearDark: that *is* normal HTTP practice though
I managed to fix it another way ^^
I just add the text FILDONE at the end of the data and check it while recieving
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.