Alright. It's me again.
I am trying to port the HTTP Server to my platform (AVR32/UC3). I got already pretty far and accept works as expected. Yet, I do not receive any data. It appears that my controller hangs during the following code section:
int simple_link_recv(long sd, void *buf, long len, long flags, sockaddr *from, socklen_t *fromlen, long opcode) { unsigned char *ptr, *args; tBsdReadReturnParams tSocketReadEvent; ptr = tSLInformation.pucTxCommandBuffer; args = (ptr + HEADERS_SIZE_CMD); // Fill in HCI packet structure args = UINT32_TO_STREAM(args, sd); args = UINT32_TO_STREAM(args, len); args = UINT32_TO_STREAM(args, flags); // Generate the read command, and wait for the hci_command_send(opcode, ptr, SOCKET_RECV_FROM_PARAMS_LEN); // Since we are in blocking state - wait for event complete SimpleLinkWaitEvent(opcode, &tSocketReadEvent); // In case the number of bytes is more then zero - read data if (tSocketReadEvent.iNumberOfBytes > 0) { // Wait for the data in a synchronous way. Here we assume that the bug is // big enough to store also parameters of receive from too.... SimpleLinkWaitData(buf, (unsigned char *)from, (unsigned char *)fromlen); } errno = tSocketReadEvent.iNumberOfBytes; return(tSocketReadEvent.iNumberOfBytes); }
To be more exact, it's the SimpleLinkWaitData call that never finishes. So I get the event, iNumberOfBytes is 347 (Wireshark shows 347 for the length of the TCP part so this seems ok) but SimpleLinkWaitData then never returns. What is supposed to happen here? Do I get all data at once or how does the module device how much data to send?
Any thing I could try to get this working?