How to receive UPD struct data in Java sent from C program? -
this received in program written in c:
struct cliprobe_data { unsigned char apmac[6]; unsigned short int vendorid; unsigned short int reserved1; unsigned char bssid[6]; unsigned char radiotype; unsigned char channel; unsigned char associated; unsigned char messagetype; char timestamp[14]; unsigned short int reserved2; unsigned char mutype; unsigned short int reserved3; char rssi; unsigned short int reserved4; unsigned char noisefloor; unsigned short int reserved5; unsigned char datarate; unsigned char mpduflags; unsigned char mumac[6]; unsigned short int framecontrol; unsigned short int sequencecontrol; unsigned short int reserved6;
};
how send in java:
datagrampacket dpaket = (datagrampacket) msg; bytebuf bbbuf = dpaket.copy().content(); byte[] byfs = new byte[bbbuf.readablebytes()]; bbbuf.readbytes(byfs); system.out.println(new string(byfs, "utf-8"));
the receive data wrong:
i want struct
data c. suggestion?
Comments
Post a Comment