FreeCalypso > hg > freecalypso-tools
changeset 66:ee89ff178ba5
fc-tmsh: set-* commands removed, use fc-fsio instead
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 26 Oct 2016 22:50:04 +0000 |
parents | 21a79f465d6a |
children | ee04baba7b2b |
files | rvinterf/tmsh/Makefile rvinterf/tmsh/ffs2wr.c rvinterf/tmsh/usercmd.c |
diffstat | 3 files changed, 2 insertions(+), 119 deletions(-) [+] |
line wrap: on
line diff
--- a/rvinterf/tmsh/Makefile Wed Oct 26 22:46:23 2016 +0000 +++ b/rvinterf/tmsh/Makefile Wed Oct 26 22:50:04 2016 +0000 @@ -4,8 +4,8 @@ INSTBIN=/opt/freecalypso/bin LIBS= ../libasync/libasync.a -TMSH_OBJS= abb.o audiocmd.o etmbasic.o ffs2.o ffs2resp.o ffs2wr.o init.o \ - main.o misc.o omr.o pktsort.o tmcore.o usercmd.o +TMSH_OBJS= abb.o audiocmd.o etmbasic.o ffs2.o ffs2resp.o init.o main.o \ + misc.o omr.o pktsort.o tmcore.o usercmd.o all: ${PROGS}
--- a/rvinterf/tmsh/ffs2wr.c Wed Oct 26 22:46:23 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* - * In this module we are going to implement some high-level FFS write - * operations, using the TMFFS2 protocol. - */ - -#include <sys/types.h> -#include <ctype.h> -#include <stdio.h> -#include <string.h> -#include <strings.h> -#include <stdlib.h> -#include "limits.h" -#include "localtypes.h" -#include "etm.h" -#include "ffs.h" -#include "tmffs2.h" - -void -send_file_write(filename, data, size) - char *filename; - u_char *data; -{ - u_char cmdpkt[MAX_PKT_TO_TARGET], *dp; - - dp = cmdpkt + 1; - *dp++ = ETM_FFS2; - *dp++ = TMFFS_FILE_WRITE; - *dp++ = strlen(filename) + 1; - strcpy(dp, filename); - dp += strlen(filename) + 1; - *dp++ = size; /* data size in bytes */ - bcopy(data, dp, size); - dp += size; - *dp++ = FFS_O_CREATE | FFS_O_TRUNC; - send_etm_cmd(cmdpkt, dp - cmdpkt - 1); -} - -void -cmd_set_imeisv(argc, argv) - char **argv; -{ - char *filename, *cp, digits[16]; - u_char bytes[8]; - int pcm_order, i; - - if (!strcmp(argv[1], "pcm")) { - filename = "/pcm/IMEI"; - pcm_order = 1; - } else if (!strcmp(argv[1], "fc")) { - filename = "/etc/IMEISV"; - pcm_order = 0; - } else { - printf( - "error: IMEISV storage type argument must be \"pcm\" or \"fc\"\n"); - return; - } - cp = argv[2]; - if (!isdigit(*cp)) { -inv: printf("error: 2nd argument must have 16 decimal digits\n"); - return; - } - for (i = 0; i < 16; i++) { - if (ispunct(*cp)) - cp++; - if (!isdigit(*cp)) - goto inv; - digits[i] = *cp++ - '0'; - } - if (*cp) - goto inv; - for (i = 0; i < 8; i++) - bytes[i] = pcm_order ? digits[i*2+1] << 4 | digits[i*2] - : digits[i*2] << 4 | digits[i*2+1]; - printf("Writing \"%02X %02X %02X %02X %02X %02X %02X %02X\" into %s\n", - bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], - bytes[6], bytes[7], filename); - send_file_write(filename, bytes, 8); -} - -void -cmd_set_pcm_string(argc, argv) - char **argv; -{ - char filename[16]; - - if (strcmp(argv[1], "CGMI") && strcmp(argv[1], "CGMM") && - strcmp(argv[1], "CGMR") && strcmp(argv[1], "CGSN")) { - printf("error: \"%s\" is not a recognized PCM string file name\n", - argv[1]); - return; - } - sprintf(filename, "/pcm/%s", argv[1]); - if (strlen(argv[2]) > 20) { - printf("error: %s string may not exceed 20 characters\n", - filename); - return; - } - send_file_write(filename, argv[2], strlen(argv[2])); -} - -void -cmd_set_rfcap(argc, argv) - char **argv; -{ - u_char bytes[16]; - int i; - - for (i = 0; i < 16; i++) - bytes[i] = strtoul(argv[i+1], 0, 16); - send_file_write("/gsm/com/rfcap", bytes, 16); -}
--- a/rvinterf/tmsh/usercmd.c Wed Oct 26 22:46:23 2016 +0000 +++ b/rvinterf/tmsh/usercmd.c Wed Oct 26 22:50:04 2016 +0000 @@ -23,9 +23,6 @@ extern void cmd_r8(); extern void cmd_r16(); extern void cmd_r32(); -extern void cmd_set_imeisv(); -extern void cmd_set_pcm_string(); -extern void cmd_set_rfcap(); extern void cmd_tgtreset(); extern void cmd_version(); extern void cmd_w8(); @@ -59,9 +56,6 @@ {"r8", 1, 2, cmd_r8}, {"r16", 1, 2, cmd_r16}, {"r32", 1, 2, cmd_r32}, - {"set-imeisv", 2, 2, cmd_set_imeisv}, - {"set-pcm-string", 2, 2, cmd_set_pcm_string}, - {"set-rfcap", 16, 16, cmd_set_rfcap}, {"tgtreset", 0, 0, cmd_tgtreset}, {"version", 1, 1, cmd_version}, {"w8", 2, 246, cmd_w8},