帮忙解读个函数,急急!!!
typedef struct {DeviceSequenceNumber deviceSequenceNumber;
} CmdGetHwModelIn;
#define CODING_8(ptr, val) { \
unsigned char *zcitf_coding_ptr = (unsigned char *)(ptr); \
*zcitf_coding_ptr = (val) & 0xff; \
ptr++; \
}
#define CODING_32(ptr, val) { \
unsigned char *zcitf_coding_ptr = (unsigned char *)(ptr); \
*zcitf_coding_ptr++ = ((val) >> 24) & 0xff; \
*zcitf_coding_ptr++ = ((val) >> 16) & 0xff; \
*zcitf_coding_ptr++ = ((val) >> 8) & 0xff; \
*zcitf_coding_ptr = (val) & 0xff; \
ptr += 4; \
}
int CmdGetHwModelInEncode(unsigned char *buf, int size, void *p)
{
CmdGetHwModelIn *in = (CmdGetHwModelIn *)p;
CODING_8(buf, p->deviceSequenceNumber);
CODING_32(buf, p->i);
return 0;
}
帮个忙把,详细点,最好把没句号都说一下,谢谢了,