comparison rvinterf/etmsync/fsbasics.c @ 278:f77480d3dd21

fc-fsio: first ffs2ver command implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 24 Feb 2014 04:41:57 +0000
parents
children 36ad667341fc
comparison
equal deleted inserted replaced
277:e23fc1228efd 278:f77480d3dd21
1 /*
2 * Basic FFS2 operations
3 */
4
5 #include <sys/types.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include "etm.h"
9 #include "ffs.h"
10 #include "tmffs2.h"
11 #include "exitcodes.h"
12
13 extern u_char rvi_msg[];
14 extern int rvi_msg_len;
15
16 cmd_ffs2ver()
17 {
18 u_char cmdpkt[4];
19 int rc;
20
21 cmdpkt[1] = ETM_FFS2;
22 cmdpkt[2] = TMFFS_VERSION;
23 rc = etm_pkt_exch(cmdpkt, 2);
24 if (rc)
25 return(rc);
26 if (rvi_msg[3]) {
27 printf("FFS2 error %d\n", rvi_msg[3]);
28 return(ERROR_TARGET);
29 }
30 if (rvi_msg_len != 7) {
31 printf("error: FFS2 version response has wrong length\n");
32 return(ERROR_TARGET);
33 }
34 printf("FFS2 version: %02X.%02X\n", rvi_msg[5], rvi_msg[4]);
35 return(0);
36 }