/* auto baud sequence */
+ printf("auto baud sequence ...\n");
write(tts_fd,"?",1);
len=0;
txrx(tts_fd,buf,&len,info);
}
/* tell bl that we are synchronized (it's allready in buf) */
+
+ printf("sync sequence ...\n");
len=14;
txrx(tts_fd,buf,&len,info);
if(strncmp(buf,"OK\r\n",4)) {
}
/* tell bl the crystal frequency */
+
+ printf("frequency setting sequence ...\n");
len=strlen(cfreq)+2;
strncpy(buf,cfreq,BUFSIZE);
buf[len-2]='\r';
return -1;
}
+ /* read part id */
+ printf("read part id ...\n");
+ len=3;
+ memcpy(buf,"J\r\n",3);
+ txrx(tts_fd,buf,&len,info);
+ buf[len]='\0';
+ printf("part id: %d (0x%x)\n",atoi(buf),atoi(buf+3));
+
+ /* read boot code version */
+ printf("read boot code version ...\n");
+ len=3;
+ memcpy(buf,"K\r\n",3);
+ txrx(tts_fd,buf,&len,info);
+ buf[len]='\0';
+ printf("boot code version: %c %c\n",(buf),atoi(buf));
+
+
+
// to be continued ... (parsing fw file and poking it to ram)