changeset 287:d85305a74518

aci2 AT@SPKR command: added query operation
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 27 Aug 2017 03:27:45 +0000
parents 840113655bbf
children dd3374eac8a3
files src/aci2/aci/ati_audio.c src/aci2/aci/ati_cmd.c
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/aci2/aci/ati_audio.c	Tue Aug 08 02:50:13 2017 +0000
+++ b/src/aci2/aci/ati_audio.c	Sun Aug 27 03:27:45 2017 +0000
@@ -75,6 +75,8 @@
 {
 	int state;
 
+	TRACE_FUNCTION("atAtSPKR()");
+
 	cl = parse(cl, "D", &state);
 	if (!cl)
 		return (ATI_FAIL);
@@ -84,6 +86,21 @@
 		AI_ResetBit(1);
 	return (ATI_CMPL);
 }
+
+GLOBAL T_ATI_RSLT queatAtSPKR (char *cl, UBYTE srcId)
+{
+	char *me="@SPKR: ";
+	int state;
+
+	TRACE_FUNCTION("queatAtSPKR()");
+
+	state = AI_ReadBit(1);
+	sprintf(g_sa, "%s%d", me, state);
+
+	io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT);
+
+	return (ATI_CMPL);
+}
 #endif
 
 /* AT@SND - emit sound through Condat API */
--- a/src/aci2/aci/ati_cmd.c	Tue Aug 08 02:50:13 2017 +0000
+++ b/src/aci2/aci/ati_cmd.c	Sun Aug 27 03:27:45 2017 +0000
@@ -676,6 +676,7 @@
 /* FreeCalypso additions */
 #ifdef CONFIG_TARGET_FCDEV3B
 EXTERN T_ATI_RSLT atAtSPKR (char *cl, UBYTE srcId);
+EXTERN T_ATI_RSLT queatAtSPKR (char *cl, UBYTE srcId);
 #endif
 EXTERN T_ATI_RSLT atAtSND (char *cl, UBYTE srcId);
 EXTERN T_ATI_RSLT atAtE1 (char *cl, UBYTE srcId);
@@ -1076,7 +1077,7 @@
     {"@BAND",     AT_CMD_P_BAND,   atAtBAND,     0,       0,    0},
     /* FreeCalypso additions */
 #ifdef CONFIG_TARGET_FCDEV3B
-    {"@SPKR",	AT_CMD_AT_SPKR,  atAtSPKR,	0,	0,	0},
+    {"@SPKR",	AT_CMD_AT_SPKR,  atAtSPKR, test_gen, queatAtSPKR, "%s: (0,1)"},
 #endif
     {"@SND",	AT_CMD_AT_SND,   atAtSND,	0,	0,	0},
     {"@E1",	AT_CMD_AT_E1,    atAtE1,	0,	0,	0},