-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Please update the rsi_socket_async to expose the source IP address of a UDP message. This was supported by legacy RS9916 documentation but not the current SAPI .
Our current work around is to call the following function in the SPI HAL for every SPI transfer.
/**
* @brief Extracts the IP address from the WLAN data response frame.
* @param frame_ Frame.
* @param numberOfBytes NumberOfBytes.
*/
void ExtractResponseFrameIPAddress(const void* const frame_, const size_t numberOfBytes) {
typedef struct {
union {
uint16_t word0;
struct {
unsigned int frameLength : 12;
unsigned int frameType : 4;
} __attribute__((__packed__));
};
union {
uint16_t word1;
struct {
union {
unsigned int commandID : 8;
unsigned int responseID : 8;
} __attribute__((__packed__));
unsigned int : 8;
};
};
uint16_t word2;
uint16_t word3;
uint16_t word4;
uint16_t word5;
union {
uint16_t word6;
uint16_t status;
};
uint16_t word7;
uint16_t ipVersion;
uint16_t socketDescriptor;
uint32_t bufferSize;
uint16_t bufferOffset;
uint16_t port;
uint32_t ipAddress;
} __attribute__((__packed__)) Frame;
// Check number of bytes
if (numberOfBytes < sizeof (Frame)) {
return;
}
const Frame * const frame = (void*) frame_;
// Check frame type
const int FrameTypeWlanData = 5;
if (frame->frameType != FrameTypeWlanData) {
return;
}
// Check response ID
const int ResponseIDDataReceived = 0x00;
if (frame->responseID != ResponseIDDataReceived) {
return;
}
// Extract IP address
responseFrameIPAddress = frame->ipAddress;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels