xmodem transfer

This is more of a programming question.

I am writing an application that attempts to upload a file  to a remote server using xmodem  and am having
difficulty getting the receiving site to return anything but
nak messages.

The question is does anyone have a detailed explanation
of the xmodem protocol detailing everything from the
packet structure to how the checksum is computed. Apparently what I have is completely wrong and I have no clue what to do at this point.

Thanks

Brett
mcelloAsked:
Who is Participating?
 
joopvConnect With a Mentor Commented:
0
 
mcelloAuthor Commented:
Edited text of question
0
 
mcelloAuthor Commented:
Thanks for the reference. The information you supplied was
what I had previously but I still havent been able to make it work. The test code in question is in VB. Maybe this is an obvious mistake but here it is with a couple extra comments.
The destination server responds repeatedly with naks.

Function buildPacket() As String

Dim PktString As String
Dim TXTMSG As String

'TXTMSG is a constant 127 character string used as a test

TXTMSG = "@H            1998031300000019980316000000COMMON EFT/DISB ROSE001PMOHELA                          82886300      OEMPORIA STATE "

'chr$(26) is the end of file character to make 128 total
TXTMSG = TXTMSG & Chr$(26)

'PktString is the actual packet string

'SOH header
PktString = Chr$(1)

'packet number
PktString = PktString & Chr$(1)
'packet number complement
PktString = PktString & Chr$(254)

'add data block (128 characters)
PktString = PktString & TXTMSG

'getCheckSum returns a 1 byte checksum integer
PktString = PktString & Chr$(getCheckSum(TXTMSG))
buildPacket = PktString

End Function
0
SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

 
joopvCommented:
Seems to comply with the spec for the first packet, providing the getCheckSum function only returns 1 byte of information..  Can you check that ?  If is is the sum including carry, AND it with 255.

0
 
joopvCommented:
hmm upon reading somewhat better i guess the chr$() function should only return the checksum MOD 255 if it would be greater.
Test the checksum function yourself, by hand.  I would'nt trust any VB function i had'nt written myself :-)
 
0
 
joopvCommented:
Mcello,

No progress yet ?  If you want i could try to make a serial datatrace from a xmodem transfer session.

For debugging serial data communications i use a dedicated laptop with 2 serial ports and the d'scope program.  It is a very old DOS application.  If you have a spare system i could send you the program.


0
 
mcelloAuthor Commented:
Sorry it took me awhile to get back. Ive been away for the last
5 days or so.

Im still having some problems. I took a close look at what I was
getting back from the host (compuserve) and they repeatedly
are sending the 'C' character. According to what Ive read
this should only happen once but they seem to insist on using
CRC mode.

So I read up and wrote a CRC checksum routine.

It still doesnt work. I guess my question then has changed from
how to implement a packet using standard checksums to one using CRC.

The only thing I can think of is to post the code which I know
you would have to wade through. So heres the deal

I can
award you 100 points for the effort of putting me on track and
be done with it

or
If you can find the problem in what Im doing I will be more than
happy to award you my entire point bank of around 1000 points.

Let me know if you want to go that way and I can post the code.


0
 
joopvCommented:
i'd love to dig in to your problem further but i don't have much time left before i go on a long trip.  Besides, i'm not a very experienced VB programmer anyway.

I'll take your first offer and can only offer you some more tips like searching the web for other xmodem source code (although it usually will be C code) and the old source code archives, i'm pretty sure there will be more pascal and maybe even basic xmodem sources just waiting to be downloaded.

a quick search at http://ftpsearch.ntnu.no/ on xmodem already gives 15 hits, including a possible interesting document on
ftp://kyuss.artis.uni-oldenburg.de/pub/infopool/documents/specifications/dfue/XMODEM/xmodem.doc.


0
All Courses

From novice to tech pro — start learning today.