public void SaveTextMessage(Sms sms, ATCommunicator.CmgwStoreLocation location) { comm.At(); if (!comm.CmqwSupportQuery()) { throw new NotSupportedException("Message writing is not supported."); } ATCommunicator.CpmsStorageArea[] s1, s2, s3; comm.CpmsQuery(out s1, out s2, out s3); comm.Cpms(FindPreferredLocation(s1), FindPreferredLocation(s2), FindPreferredLocation(s3)); comm.Cmgf(0); EnumerableHelper.ForEach(PduEncoder.Encode(sms), pdu => comm.Cmgw(pdu, location)); }
public Phone(string portName) { port = new SerialPort(portName); port.Open(); if (!port.IsOpen) { throw new IOException("Unable to open port " + port); } comm = new ATCommunicator(port, d => { if (CommandSent != null) CommandSent(this, new GenericEventArgs<string>(d)); }, d => { if (ResponseReceived != null) ResponseReceived(this, new GenericEventArgs<string>(d)); }); }
public Phone(string portName) { port = new SerialPort(portName); port.Open(); if (!port.IsOpen) { throw new IOException("Unable to open port " + port); } comm = new ATCommunicator(port, d => { if (CommandSent != null) { CommandSent(this, new GenericEventArgs <string>(d)); } }, d => { if (ResponseReceived != null) { ResponseReceived(this, new GenericEventArgs <string>(d)); } }); }