Sample-codes

From DATAGNSS Wiki
Revision as of 18:13, 12 October 2024 by Rinex20 (talk | contribs) (Created page with "=== gen_fixed_ecef === <pre> extern void gen_cfg_fixedecef_hex(double *xyz,unsigned char *buff) { unsigned char *q=buff; //cfg-fixedecef F1 D9 06 14 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 26 34 //F1 D9 06 14 0C 00 2F 5C F7 EE D5 15 C7 1B E2 B2 84 13 8D 85 //-2857788.974 4660320.857 3274636.501 // *q++=ALLSYNC1; *q++=ALLSYNC2; *q++=ALLCFG; *q++=0x14; //cfg_fixedecef *q++=0x0C; //payload length,2 bytes *q++=0x00; int i4; for(int i=0;i<3;i++...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

gen_fixed_ecef

extern void gen_cfg_fixedecef_hex(double *xyz,unsigned char *buff)
{
	unsigned char *q=buff;

	//cfg-fixedecef F1 D9 06 14 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 26 34
    //F1 D9 06 14 0C 00 2F 5C F7 EE D5 15 C7 1B E2 B2 84 13 8D 85
    //-2857788.974 4660320.857 3274636.501
    //
	
	*q++=ALLSYNC1;
	*q++=ALLSYNC2;
	*q++=ALLCFG;
	*q++=0x14; //cfg_fixedecef
	*q++=0x0C; //payload length,2 bytes
	*q++=0x00;

    int i4;

	for(int i=0;i<3;i++){
	    i4=(int)round(xyz[i]*100);
	    tracet(3,"float xyz(cm):%d\n",i4);
	    setS4(q,i4);
	    q+=4;
	}

	setcs(buff,20);

    traceb(3,buff,20);

    return;
}