Datasheet

byteToStr(remoteHost[3], tmp) ' second
dyna[12] = tmp[0]
dyna[13] = tmp[1]
dyna[14] = tmp[2]
dyna[15] = ":" ' add separator
' then remote host port number
WordToStr(remotePort, tmp)
dyna[16] = tmp[0]
dyna[17] = tmp[1]
dyna[18] = tmp[2]
dyna[19] = tmp[3]
dyna[20] = tmp[4]
dyna[21] = " "
dyna[22] = "["
WordToStr(destPort, tmp)
dyna[23] = tmp[0]
dyna[24] = tmp[1]
dyna[25] = tmp[2]
dyna[26] = tmp[3]
dyna[27] = tmp[4]
dyna[28] = "]"
dyna[29] = " "
dyna[30] = 0
' the total length of the request is the length of the dynamic
string plus the text of the request
len_ = 30 + reqLength
' puts the dynamic string into the transmit buffer
ptr = @dyna
while (ptr^ <> 0)
SPI_Ethernet_putByte(ptr^)
ptr = ptr + 1
wend
' then puts the request string converted into upper char into
the transmit buffer
while(reqLength <> 0)
SPI_Ethernet_putByte(SPI_Ethernet_getByte())
reqLength = reqLength - 1
wend
result = len_ ' back to the library with the length
of the UDP reply
end sub
end.
388
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6