r3290 - in trunk/src/host/qemu-neo1973: . hw openmoko phonesim

andrew at sita.openmoko.org andrew at sita.openmoko.org
Fri Oct 26 21:26:11 CEST 2007


Author: andrew
Date: 2007-10-26 21:26:08 +0200 (Fri, 26 Oct 2007)
New Revision: 3290

Modified:
   trunk/src/host/qemu-neo1973/Makefile
   trunk/src/host/qemu-neo1973/configure
   trunk/src/host/qemu-neo1973/hw/neo1973.c
   trunk/src/host/qemu-neo1973/openmoko/flash.sh
   trunk/src/host/qemu-neo1973/openmoko/neo1973.xml
   trunk/src/host/qemu-neo1973/phonesim/Makefile
Log:
Sanitise AT+COPS output, implement AT+CSCB.
Hook up phonesim to qemu's configure & Makefile, add a usage note.


Modified: trunk/src/host/qemu-neo1973/Makefile
===================================================================
--- trunk/src/host/qemu-neo1973/Makefile	2007-10-26 18:31:06 UTC (rev 3289)
+++ trunk/src/host/qemu-neo1973/Makefile	2007-10-26 19:26:08 UTC (rev 3290)
@@ -26,7 +26,7 @@
 
 LIBS+=$(AIOLIBS)
 
-all: $(TOOLS) $(DOCS) recurse-all
+all: $(TOOLS) $(DOCS) recurse-all $(MODEM)
 
 subdir-%: dyngen$(EXESUF)
 	$(MAKE) -C $(subst subdir-,,$@) all
@@ -36,6 +36,10 @@
 qemu-img$(EXESUF): qemu-img.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c block-parallels.c
 	$(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
 
+phonesim: phonesim/phonesim
+phonesim/phonesim:
+	$(MAKE) -C phonesim
+
 dyngen$(EXESUF): dyngen.c
 	$(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^
 

Modified: trunk/src/host/qemu-neo1973/configure
===================================================================
--- trunk/src/host/qemu-neo1973/configure	2007-10-26 18:31:06 UTC (rev 3289)
+++ trunk/src/host/qemu-neo1973/configure	2007-10-26 19:26:08 UTC (rev 3290)
@@ -103,6 +103,7 @@
 build_docs="no"
 gadgetfs="no"
 uname_release=""
+phonesim="no"
 
 # OS specific
 targetos=`uname -s`
@@ -304,6 +305,8 @@
         *)     echo "undefined SPARC architecture. Exiting";exit 1;;
       esac
   ;;
+  --enable-phonesim) phonesim="yes"
+  ;;
   esac
 done
 
@@ -956,6 +959,14 @@
   echo "#define CONFIG_GADGETFS 1" >> $config_h
 fi
 
+if test "$phonesim" = "yes" ; then
+  echo "MODEM=phonesim" >> $config_mak
+  echo "#undef INTERNAL_MODEM" >> $config_h
+else
+  echo "MODEM=" >> $config_mak
+  echo "#define INTERNAL_MODEM \"gnokiigsm\"" >> $config_h
+fi
+
 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
 
 for target in $target_list; do

Modified: trunk/src/host/qemu-neo1973/hw/neo1973.c
===================================================================
--- trunk/src/host/qemu-neo1973/hw/neo1973.c	2007-10-26 18:31:06 UTC (rev 3289)
+++ trunk/src/host/qemu-neo1973/hw/neo1973.c	2007-10-26 19:26:08 UTC (rev 3290)
@@ -103,11 +103,13 @@
         neo_printf("Modem reset.\n");
 }
 
+#ifdef INTERNAL_MODEM
 static void neo_modem_switch_tick(void *opaque)
 {
     struct neo_board_s *s = (struct neo_board_s *) opaque;
     modem_enable(s->modem, 1);
 }
+#endif
 
 static void neo_modem_switch(void *opaque, int line, int level)
 {
@@ -380,10 +382,12 @@
 
 static void neo_gsm_setup(struct neo_board_s *s)
 {
+#ifdef INTERNAL_MODEM
     s->modem = modem_init();
     s->modem_timer = qemu_new_timer(vm_clock, neo_modem_switch_tick, s);
 
     s3c_uart_attach(s->cpu->uart[0], s->modem);
+#endif
 }
 
 static void neo_reset(void *opaque)

Modified: trunk/src/host/qemu-neo1973/openmoko/flash.sh
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/flash.sh	2007-10-26 18:31:06 UTC (rev 3289)
+++ trunk/src/host/qemu-neo1973/openmoko/flash.sh	2007-10-26 19:26:08 UTC (rev 3290)
@@ -142,4 +142,11 @@
 echo "    "time emulation starts in the original unmodified state.
 echo "    "Use [Enter] for AUX button, [Space] for POWER.
 echo "    "Append \'-usbdevice keyboard\' to attach a standard keyboard.
+echo "    "
+echo "    "If you\'ve configured qemu with --enable-phonesim \(requieres Qt4 and
+echo "    "a C++ toolchain\), use the following commandline to run phonesim:
+echo \ \$ \(cd phonesim\; LD_LIBRARY_PATH=lib ./phonesim -gui ../openmoko/neo1973.xml\)\&
+echo "    "The GUI is optional.  When phonesim is running, append
+echo "    "\'-serial tcp:localhost:12345\' to qemu invocation.  Security
+echo "    "note a la GLSA: phonesim listens on 0.0.0.0.
 echo

Modified: trunk/src/host/qemu-neo1973/openmoko/neo1973.xml
===================================================================
--- trunk/src/host/qemu-neo1973/openmoko/neo1973.xml	2007-10-26 18:31:06 UTC (rev 3289)
+++ trunk/src/host/qemu-neo1973/openmoko/neo1973.xml	2007-10-26 19:26:08 UTC (rev 3290)
@@ -14,6 +14,7 @@
      and hangup after 5 seconds -->
 <!-- Note: dialing 166 will accept the incoming call and hanup up after 5
      seconds-->
+<!-- Note: dialing 155 will elicit a 'BUSY' response from the recipient-->
 
 <!-- Initialize state variables -->
 
@@ -22,16 +23,16 @@
 
     <!-- Battery Capacity
     first value
-	0-powerd by battery
+	0-powered by battery
 	1-battery connected, powered by charger
 	2-no battery.
 
     second value is percentage battery remaining.
-	0-exahsted
+	0-exhausted
 	1-99-partial charge
 	100-fully charged.
      -->
-    <set name="BC" value="1,100"/>
+    <set name="BC" value="1,88"/>
 
     <!-- Signal Quality -->
     <set name="SQ" value="32,99"/>
@@ -91,7 +92,7 @@
     <set name="OP" value="${OP1}"/>
 
     <!-- Phone operator list -->
-    <set name="OPLIST" value="(2,${OP1},OP1,111)(1,${OP2},OP2,222),(1,${OP3},OP3,333)"/>
+    <set name="OPLIST" value="(2,&quot;${OP1}&quot;,&quot;OP1&quot;,&quot;11111&quot;),(1,&quot;${OP2}&quot;,&quot;OP2&quot;,&quot;22222&quot;),(1,&quot;${OP3}&quot;,&quot;OP3&quot;,&quot;33333&quot;)"/>
 
     <!-- Calling line identification presentation flag -->
     <set name="LIP" value="0"/>
@@ -178,6 +179,11 @@
     <!-- Format of cellular result codes -->
     <set name="RING" value="RING"/>
 
+    <!-- Select Cell Broadcast Message Types -->
+    <set name="CBMODE" value="0"/>
+    <set name="CBMIDS" value="1,4,10"/>
+    <set name="CBDCSS" value="3,4"/>
+
 <!-- Broadcast a cell location -->
 
 <unsolicited delay="500">+CBM: 8807A200320111B8669A5D0641D9E1B47BDE68341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D168341A8D46A3D100</unsolicited>
@@ -785,7 +791,7 @@
 <chat>
     <!-- Query supported operators, always reports -->
     <command>AT+COPS=?</command>
-    <response delay="2000">+COPS: ${OPLIST}(0,"Maybe Forbidden Net","MFN","3")(3,Competitor Net,COMNET,4)\nOK</response>
+    <response delay="2000">+COPS: ${OPLIST},(0,"Maybe Forbidden Net","MFN","34567"),(3,"Competitor Net","COMNET","44444")\nOK</response>
 </chat>
 
 <chat>
@@ -808,7 +814,7 @@
     <response>OK</response>
     <set name="OPMODE" value="1"/>
     <set name="OP" value="${OP1}"/>
-    <set name="OPLIST" value="(2,${OP1},OP1,111)(1,${OP2},OP2,222),(1,${OP3},OP3,333)"/>
+    <set name="OPLIST" value="(2,&quot;${OP1}&quot;,&quot;OP1&quot;,&quot;11111&quot;),(1,&quot;${OP2}&quot;,&quot;OP2&quot;,&quot;22222&quot;),(1,&quot;${OP3}&quot;,&quot;OP3&quot;,&quot;33333&quot;)"/>
 </chat>
 
 <chat>
@@ -818,6 +824,7 @@
     <set name="OPMODE" value="1"/>
     <set name="OP" value="${OP2}"/>
     <set name="OPLIST" value="(1,${OP1},OP1,111)(2,${OP2},OP2,222),(1,${OP3},OP3,333)"/>
+    <set name="OPLIST" value="(2,&quot;${OP1}&quot;,&quot;OP1&quot;,&quot;11111&quot;),(1,&quot;${OP2}&quot;,&quot;OP2&quot;,&quot;22222&quot;),(1,&quot;${OP3}&quot;,&quot;OP3&quot;,&quot;33333&quot;)"/>
 </chat>
 
 <chat>
@@ -826,7 +833,7 @@
     <response>OK</response>
     <set name="OPMODE" value="1"/>
     <set name="OP" value="${OP3}"/>
-    <set name="OPLIST" value="(1,${OP1},OP1,111)(1,${OP2},OP2,222),(2,${OP3},OP3,333)"/>
+    <set name="OPLIST" value="(2,&quot;${OP1}&quot;,&quot;OP1&quot;,&quot;11111&quot;),(1,&quot;${OP2}&quot;,&quot;OP2&quot;,&quot;22222&quot;),(1,&quot;${OP3}&quot;,&quot;OP3&quot;,&quot;33333&quot;)"/>
 </chat>
 
 <chat>
@@ -835,7 +842,7 @@
     <response>OK</response>
     <set name="OPMODE" value="1"/>
     <set name="OP" value="${OP1}"/>
-    <set name="OPLIST" value="(2,${OP1},OP1,111)(1,${OP2},OP2,222),(1,${OP3},OP3,333)"/>
+    <set name="OPLIST" value="(2,&quot;${OP1}&quot;,&quot;OP1&quot;,&quot;11111&quot;),(1,&quot;${OP2}&quot;,&quot;OP2&quot;,&quot;22222&quot;),(1,&quot;${OP3}&quot;,&quot;OP3&quot;,&quot;33333&quot;)"/>
 </chat>
 
 <chat>
@@ -844,7 +851,7 @@
     <response>OK</response>
     <set name="OPMODE" value="1"/>
     <set name="OP" value="${OP2}"/>
-    <set name="OPLIST" value="(1,${OP1},OP1,111)(2,${OP2},OP2,222),(1,${OP3},OP3,333)"/>
+    <set name="OPLIST" value="(2,&quot;${OP1}&quot;,&quot;OP1&quot;,&quot;11111&quot;),(1,&quot;${OP2}&quot;,&quot;OP2&quot;,&quot;22222&quot;),(1,&quot;${OP3}&quot;,&quot;OP3&quot;,&quot;33333&quot;)"/>
 </chat>
 
 <chat>
@@ -853,7 +860,7 @@
     <response>OK</response>
     <set name="OPMODE" value="1"/>
     <set name="OP" value="${OP3}"/>
-    <set name="OPLIST" value="(1,${OP1},OP1,111)(1,${OP2},OP2,222),(2,${OP3},OP3,333)"/>
+    <set name="OPLIST" value="(2,&quot;${OP1}&quot;,&quot;OP1&quot;,&quot;11111&quot;),(1,&quot;${OP2}&quot;,&quot;OP2&quot;,&quot;22222&quot;),(1,&quot;${OP3}&quot;,&quot;OP3&quot;,&quot;33333&quot;)"/>
 </chat>
 
 <chat>
@@ -1930,22 +1937,49 @@
     <response>OK</response>
 </chat>
 
+<!-- Call Progress Indication format -->
 <chat>
     <command>AT%CPI=?</command>
     <response>%CPI: (0-3)\nOK</response>
 </chat>
-
 <chat>
     <command>AT%CPI?</command>
     <response>%CPI: ${CPI}\nOK</response>
 </chat>
-
 <chat>
     <command>AT%CPI=*</command>
     <response>OK</response>
     <set name="CPI" value="*"/>
 </chat>
 
+<!-- Select Cell Broadcast Message Types -->
+<chat>
+    <command>AT+CSCB?</command>
+    <response>+CSCB: ${CBMODE},"${CBMIDS}","${CBDCSS}"\nOK</response>
+</chat>
+<chat>
+    <command>AT+CSCB=?</command>
+    <response>+CSCB: (0,1)\nOK</response>
+</chat>
+<chat>
+    <command>AT+CSCB=${MODE},"${MIDS}","${DCSS}"</command>
+    <response>OK</response>
+    <set name="CBMODE" value="${MODE}"/>
+    <set name="CBMIDS" value="${MIDS}"/>
+    <set name="CBDCSS" value="${DCSS}"/>
+</chat>
+<chat>
+    <command>AT+CSCB=${MODE},"${MIDS}"</command>
+    <response>OK</response>
+    <set name="CBMODE" value="${MODE}"/>
+    <set name="CBMIDS" value="${MIDS}"/>
+</chat>
+<chat>
+    <command>AT+CSCB=${MODE}</command>
+    <response>OK</response>
+    <set name="CBMODE" value="${MODE}"/>
+</chat>
+
 <!-- List of all supported commands -->
 
 <!-- All commands supported by TI Calypso -->

Modified: trunk/src/host/qemu-neo1973/phonesim/Makefile
===================================================================
--- trunk/src/host/qemu-neo1973/phonesim/Makefile	2007-10-26 18:31:06 UTC (rev 3289)
+++ trunk/src/host/qemu-neo1973/phonesim/Makefile	2007-10-26 19:26:08 UTC (rev 3290)
@@ -13,3 +13,4 @@
 clean: Makefile.phonesim lib/Makefile
 	$(MAKE) -C lib clean
 	$(MAKE) -f Makefile.phonesim clean
+	rm -f phonesim





More information about the commitlog mailing list