#define PACK_CODE_1 253 #define PACK_CODE_2 254 //*********************************** int Pack(unsigned char *data,int size,unsigned char *out) { int p=0,count=0,count2=0,pos=0,x=0,co=0,rlll=0,batt=0,pcc=0; unsigned char old=0,ne=0; int no=0; while(pcount2) { if (out) { *out=PACK_CODE_1; out++; *out=count; out++; *out=old; out++; } p+=count; rlll+=3; } else { if (out) { *out=PACK_CODE_2; out++; *out=count2; out++; *out=pos; out++; } p+=count2; batt+=3; } } return(no+rlll+batt); } int UnPack(unsigned char *data,int size,unsigned char *out) { int p=0,count=0,pos=0,x=0,si=0; unsigned char old=0,dat=0; unsigned char *outti; while(p