Rev | Line | |
---|
[1311] | 1 | function replyPkt = warplab_pktSend(udpSock, pktData) |
---|
| 2 | replyPkt = 0; |
---|
| 3 | try |
---|
| 4 | %Write the packet to the write buffer and then send |
---|
| 5 | pnet(udpSock, 'write', int32(pktData)); |
---|
| 6 | pnet(udpSock, 'writepacket'); |
---|
| 7 | |
---|
| 8 | %Wait to receive reply from the board |
---|
| 9 | len = 0; |
---|
| 10 | timeout = 0; |
---|
| 11 | while (len <= 0), |
---|
| 12 | len = pnet(udpSock, 'readpacket'); |
---|
| 13 | timeout = timeout + 1; |
---|
| 14 | if (timeout == 10), |
---|
[1814] | 15 | fprintf('No ACK received - Connection has timed out.\n'); |
---|
[1804] | 16 | %pnet('closeall'); |
---|
[1311] | 17 | returnStatus = 1; |
---|
| 18 | return; |
---|
| 19 | end |
---|
| 20 | end |
---|
| 21 | |
---|
| 22 | replyPkt = pnet(udpSock, 'read', len, 'uint32'); |
---|
| 23 | end |
---|
| 24 | |
---|
Note: See
TracBrowser
for help on using the repository browser.