static int ticalypso_initsettings(struct gsmd *g) { int rc = 0; struct gsmd_atcmd *cmd; /* use +CTZR: to report time zone changes */ rc |= gsmd_simplecmd(g, "AT+CTZR=1"); /* use %CTZV: Report time and date */ rc |= gsmd_simplecmd(g, "AT%CTZV=1"); /* use %CGREG */ //rc |= gsmd_simplecmd(g, "AT%CGREG=3"); /* enable %CPRI: ciphering indications */ rc |= gsmd_simplecmd(g, "AT%CPRI=1"); /* enable %CSQ: signal quality reports */ rc |= gsmd_simplecmd(g, "AT%CSQ=1"); /* send unsolicited commands at any time */ rc |= gsmd_simplecmd(g, "AT%CUNS=0"); /* enable %CPI: call progress indication */ cmd = atcmd_fill("AT%CPI=?", 9, &cpi_detect_cb, g, 0, NULL); if (cmd) atcmd_submit(g, cmd); return rc; }
static int siemens_initsettings(struct gsmd *g) { int rc = 0; /* reset the second mux channel to factory defaults */ rc |= gsmd_simplecmd(g, "AT&F2"); /* setup Mobile error reporting, mode=3 - buffer unsolic messages in TE 1 - indicator event reporting using result code +CIEV: */ rc |= gsmd_simplecmd(g, "AT+CMER=3,0,0,1,0"); /* ignore DTR line (on mux0! - channel 1)*/ // rc |= gsmd_simplecmd(g, "AT&D0"); /* enable ^SACD: Accessory Indicators */ rc |= gsmd_simplecmd(g, "AT^SACD=3"); return rc; }
int gsmd_initsettings2(struct gsmd *gsmd) { int rc = 0; if (gsmd->vendorpl && gsmd->vendorpl->initsettings) rc |= gsmd->vendorpl->initsettings(gsmd); /* echo off, display acknowledgments as text */ // rc |= gsmd_simplecmd(gsmd, "ATE0V1"); rc |= gsmd_simplecmd(gsmd, "ATE0"); /* use +CME ERROR: instead of ERROR */ rc |= gsmd_simplecmd(gsmd, "AT+CMEE=1"); return rc; }
static int siemens_initsettings_slow(struct gsmd *g) { int rc = 0; /* reset the mux 3 channel to factory defaults */ rc |= gsmd_simplecmd(g, "AT&F3"); return rc; }
static int siemens_initsettings(struct gsmd *gsmd) { int rc = 0; struct gsmd_atcmd *cmd; u_int8_t channel; //rc |= gsmd_simplecmd(gsmd, "AT&F"); // JIM resets the TC65 - cannot be done from siemens plugin // Added by Jim - need to be in place from the start /* use +CSMS: to set phase 2+ */ // Call status event reporting rc |= gsmd_notification_cmd(gsmd, "AT^SLCC=1", PIN_DEPENDENT); rc |= gsmd_notification_cmd(gsmd, "AT^SIND=\"audio\",1", PIN_DEPENDENT); #ifdef USING_TDC_DEV_BOARD // dev boards use default AT^SAIC=2,1,1 #else // TCL SL40 uses analog, mic 2 & earpiece 2 rc |= gsmd_simplecmd(gsmd, "AT^SNFS=2", NO_PIN_DEPEND); // factory defaults for SNFS 2 should same as // rc |= gsmd_simplecmd(gsmd, "AT^SAIC=2,2,2", NO_PIN_DEPEND); #endif // Set the default DTMF tone duration (10 10ths i.e 1 second) rc |= gsmd_simplecmd(gsmd, "AT+VTD=10", PIN_DEPENDENT); // AT+CSMS=1 must be passed down the same channel as the AT+CNMI // This SIM command may be delayed if the SIM is busy rc |= sim_notification_cmd(gsmd, 0,0); //JIM - for now we don't process cell broadcast messages rc |= gsmd_notification_cmd(gsmd, "AT+CNMI=2,2,0,1,1",PIN_DEPENDENT); // Force a creg lookup. MC55i doesn't appear to always give a CREG notification after // pin verification and auto operator selection rc |= query_network_status(gsmd); for (channel = GSMD_CMD_CHANNEL0; channel < gsmd->number_channels; channel++) { /* Siemens sometimes sends LFLF instead of CRLF */ gsmd->llp[channel].flags |= LGSM_ATCMD_F_LFLF; } return rc; }
/* these commands require PIN to be READY */ int gsmd_initsettings_after_pin(struct gsmd *gsmd) { int rc = 0; /* enable +CREG: unsolicited response if registration status changes */ rc |= gsmd_simplecmd(gsmd, "AT+CREG=2"); /* use +CRING instead of RING */ rc |= gsmd_simplecmd(gsmd, "AT+CRC=1"); /* use +CLIP: to indicate CLIP */ rc |= gsmd_simplecmd(gsmd, "AT+CLIP=1"); /* use +COLP: to indicate COLP */ /* set it 0 to disable subscriber info and avoid cme err 512 ?FIXME? */ rc |= gsmd_simplecmd(gsmd, "AT+COLP=1"); /* use +CCWA: to indicate waiting call */ rc |= gsmd_simplecmd(gsmd, "AT+CCWA=1"); /* activate the unsolicited reporting of CCM value */ rc |= gsmd_simplecmd(gsmd, "AT+CAOC=2"); /* get imsi */ atcmd_submit(gsmd, atcmd_fill("AT+CIMI", 0, &gsmd_get_imsi_cb, gsmd, 0, NULL)); sms_cb_init(g_slow); if (gsmd->vendorpl && gsmd->vendorpl->initsettings_after_pin) return gsmd->vendorpl->initsettings_after_pin(gsmd); else return rc; }
static int cpi_detect_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp) { struct gsmd *g = ctx; struct gsm_extrsp *er; if (strncmp(resp, "%CPI: ", 6)) return -EINVAL; resp += 6; er = extrsp_parse(cmd, resp); if (!er) return -EINVAL; if (extrsp_supports(er, 0, 3)) return gsmd_simplecmd(g, "AT%CPI=3"); else if (extrsp_supports(er, 0, 2)) return gsmd_simplecmd(g, "AT%CPI=2"); else DEBUGP("Call Progress Indication mode 2 or 3 not supported!!\n"); talloc_free(er); return 0; }