Converting a structs to a unsigned short-pointer ??
Posted: Mon May 11, 2009 6:30 pm
Hello!
Is it possible to convert a struct to a pointer like this:
I want to use it for wifi:
Afer sending the clients must decode it like
Please Help!!!
Is it possible to convert a struct to a pointer like this:
Code: Select all
typedef struct
{
int value_1;
int value_2;
}test_struct;
test_struct test;
int main()
{
test_struct* pointer = &test;
unsigned short* shortPtr=(unsigned short*) pointer;
}
Code: Select all
Wifi_RawTxFrame(sizeof(test_struct)+1, 0x0014, shortPtr) ;
Code: Select all
void Handler(int packetID, int readlength)
{
test_struct test2;
static int bytesRead;
bytesRead = Wifi_RxRawReadPacket(packetID, readlength, (unsigned short*)test2);
}
Please Help!!!