Dear All,
I am trying to get my position with CellID.
I found that function, which seams to be strange
int SIMCOM900::readCellData(int &mcc, int &mnc, long &lac, long &cellid)
{
if (getStatus()==IDLE)
return 0;
//_tf.setTimeout(_GSM_DATA_TOUT_);
//_cell.flush();
SimpleWriteln(F("AT+QENG=1,0"));
SimpleWriteln(F("AT+QENG?"));
if(gsm.WaitResp(5000, 50, "+QENG")!=RX_FINISHED_STR_NOT_RECV)
return 0;
//mcc=_tf.getValue(); // The first one is 0
mcc=_cell.read();
//mcc=_tf.getValue();
mcc=_cell.read();
//mnc=_tf.getValue();
mnc=_cell.read();
//lac=_tf.getValue();
lac=_cell.read();
//cellid=_tf.getValue();
cellid=_cell.read();
gsm.WaitResp(5000, 50, "+OK");
SimpleWriteln(F("AT+QENG=1,0"));
gsm.WaitResp(5000, 50, "+OK");
return 1;
}
When I call that function
gsm.raedCellData(mmc,mnc,lac,cellid);
it return me
-1
for mmc,mnc,lac and cellid
What look starnge for me the following
mcc=_cell.read();
mcc=_cell.read();;
mnc=_cell.read();
lac=_cell.read();
cellid=_cell.read();
_cell.read() will return the same value for all??
if Serial.print(_cell.read); display -1, it seams to be normal that the variable, mmc, mnc, lat, cellid return -1 as well.
Something seams to be wrong for you?
How would you correct it?
Do you have an other example?
Thank for all
Cheers
Pierre