struct ControlWindowMsg{
unsigned char buf1;
unsigned char buf2;
unsigned char buf3;
unsigned char buf4;
};
char buf[4] = {0};
buf[0] = 1 & 0xff;
buf[1] = 0 & 0xff;
buf[2] = 3 & 0xff;
buf[3] = 104 &0xff;
struct ControlWindowMsg windowMsg;
memset(&windowMsg, 0, sizeof(windowMsg)); //结构体赋值为0
memcpy(&windowMsg, buf, sizeof(windowMsg)); //结构体赋值
NSTimeInterval timeInerval = [[NSDate date] timeIntervalSince1970];
int taskId = [[NSString stringWithFormat:@"%f",timeInerval] intValue];
buf[2] = taskId & 0xff;
buf[3] = (taskId >> 8) & 0xff;
buf[4] = (taskId >> 16) & 0xff;
buf[5] = (taskId >> 24) & 0xff;