int main()
{
int uart_freq_fd;
char buf_test[40] = {0xB5 ,0x62 ,0x06 ,0x31 ,0x20 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x32 ,0x00 ,0x00 ,0x00 ,0x64 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00
,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x80 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x8B ,0x00 ,0x00 ,0x00 ,0xF9 ,0x63};
uart_freq_fd = open("/dev/ttyPS1",O_RDWR);
if(uart_freq_fd<0)
{
printf("uart_config_fd:[error] can't open device.\n");
return;
}
for( i = 0;i < 40;i++){
{
count = write(uart_freq_fd,&buf_test[i],1);
}
}
这样就能够通过嵌入式linux系统的ttyps1来配置gps模块的timepluse,配置其他的参数也都类似,只需通过u-counter工具来获得配置的16进制数即可。
阅读(3022) | 评论(0) | 转发(0) |