c# - Get last call duration using AT+CLCC command -
I have coded a program and automatically dialed the last call when the phone is connected to a laptop. Duration is obtained. I command AT + CLCC to get the status of the current call. However this should return some string values back as ....... etc., I have not found anything like this yet ... this is my code Is ..
_serialPort.BaudRate = 9600; _serialPort.Parity = Samata. One; _serialPort.DataBits = 8; _serialPort.StopBits = StopBits.One; _serialPort.Handshake = Handshake.None; // Set the read / write time _serialPort.ReadTimeout = 500; _serialPort.WriteTimeout = 500; _serialPort.Open (); _serialPort.DtrEnable = true; _serialPort.RtsEnable = true; String phonen = ""; // string message; If (! _serialPort.IsOpen) {_serialPort.Open (); } _serialPort.WriteLine ("AT \ r"); {Console.WriteLine ("Enter the phone number:", the phone); Phonenr = Console.ReadLine (); _serialPort.WriteLine ("ATD" + PhoneRar + ";" + "\ r"); Console.WriteLine ("Ring ..."); Thread.Sleep (10000); _serialPort.WriteLine ("+ CLCC AT"); _serialPort.DataReceived + = New SerialDataReceivedEventHandler (DataReceivedHandler); // as a separate function .... Private Static Blank Dataraisevandler (Object Sender, Serial Data Receive Event Eg) e SerialPort Sp = (SerialPort) Sender; String indenta = sp.ReadExisting (); Console WrightLine ("Received Data:"); Console.Write (indata); } What is wrong with this code ???? How can I get feedback as a format ... etc ???
AT + CLCC order no provide information about the last call . It provides information about a call (during dialing / playing / waiting etc.) during the time . Read for detailed information. I think that you can automatically output the last call description to the terminal on the terminal when the call is disconnected, but I am not sure that it provides call duration. is. You may need to manually monitor the time recording with your app
I have also seen your other posts. I use a normal serial port terminal (Putty or Terminal etc.) to communicate with the phone and understand the concept, before using programming to automate the task.
Comments
Post a Comment