public async Task <bool> SelectStorage(IPortPlug port, Constants.MessageStorage readStore = Constants.MessageStorage.MobileEquipment, Constants.MessageStorage writeStore = Constants.MessageStorage.Unspecified, Constants.MessageStorage receivedStore = Constants.MessageStorage.Unspecified) { if (readStore == Constants.MessageStorage.Unspecified) { return(false); } var storageParam = new CommandParameter(getStorageParam(readStore, writeStore, receivedStore), Constants.BasicSuccessfulResponse); var storageCmd = new ParamATCommand(ATCommand.MessageStorage.Command(), storageParam); await storageCmd.ExecuteAsync(port); return(storageCmd.Succeeded()); }
private string getStorageParam(Constants.MessageStorage readStore, Constants.MessageStorage writeStore, Constants.MessageStorage receivedStore) { var param = new StringBuilder(readStore.Description()); if (writeStore != Constants.MessageStorage.Unspecified) { param.Append(",").Append(writeStore.Description()); } if (receivedStore != Constants.MessageStorage.Unspecified) { param.Append(",").Append(receivedStore.Description()); } return(param.ToString()); }