diff --git a/GSMCommServer/GSMCommServer.csproj b/GSMCommServer/GSMCommServer.csproj index a2bea1a..3fac8ca 100644 --- a/GSMCommServer/GSMCommServer.csproj +++ b/GSMCommServer/GSMCommServer.csproj @@ -33,16 +33,7 @@ - - .\GSMCommServerReferences\GSMCommShared.dll - - - .\GSMCommServerReferences\GSMCommunication.dll - - - .\GSMCommServerReferences\PDUConverter.dll - @@ -78,5 +69,19 @@ false + + + {71ea4054-a98a-46ba-84fa-81652db72b72} + GSMCommShared + + + {32b76f1e-b022-47c6-86ec-28639d348067} + GSMCommunication + + + {5e657efe-0a30-466d-b025-ff177e23a727} + PDUConverter + + \ No newline at end of file diff --git a/GSMCommServer/Server/SmsServer.cs b/GSMCommServer/Server/SmsServer.cs index a85a158..e588063 100644 --- a/GSMCommServer/Server/SmsServer.cs +++ b/GSMCommServer/Server/SmsServer.cs @@ -197,20 +197,32 @@ public void Dispose() this.StopInternal(); } - /// - /// Finalizes the class. - /// - protected override void Finalize() - { - try - { - this.Dispose(); - } - finally - { - this.Finalize(); - } - } + ~SmsServer() + { + try + { + this.Dispose(); + } + finally + { + //this.Finalize(); + } + } + + ///// + ///// Finalizes the class. + ///// + //protected override void Finalize() + //{ + // try + // { + // this.Dispose(); + // } + // finally + // { + // this.Finalize(); + // } + //} /// /// Tells if the remoting server is currently running. diff --git a/GSMCommunication/GSMCommunication.csproj b/GSMCommunication/GSMCommunication.csproj index e7d0d86..4966341 100644 --- a/GSMCommunication/GSMCommunication.csproj +++ b/GSMCommunication/GSMCommunication.csproj @@ -1,7 +1,7 @@ - + - {32b76f1e-b022-47c6-86ec-28639d348067} + {32B76F1E-B022-47C6-86EC-28639D348067} 2 Debug AnyCPU @@ -19,6 +19,7 @@ full prompt AnyCPU + true bin\Release\ @@ -31,13 +32,7 @@ AnyCPU - - .\GSMCommunicationReferences\PDUConverter.dll - - - .\GSMCommunicationReferences\GSMCommShared.dll - @@ -246,5 +241,15 @@ false + + + {71ea4054-a98a-46ba-84fa-81652db72b72} + GSMCommShared + + + {5e657efe-0a30-466d-b025-ff177e23a727} + PDUConverter + + \ No newline at end of file diff --git a/GSMCommunication/GsmCommunication/GsmCommMain.cs b/GSMCommunication/GsmCommunication/GsmCommMain.cs index e198f8e..3322d1a 100644 --- a/GSMCommunication/GsmCommunication/GsmCommMain.cs +++ b/GSMCommunication/GsmCommunication/GsmCommMain.cs @@ -410,7 +410,7 @@ public void DeleteMessage(int index, string storage) /// public void DeleteMessages(DeleteScope scope, string storage) { - int num = scope; + int num = (int)scope; DeleteFlag deleteFlag = (DeleteFlag)Enum.Parse(typeof(DeleteFlag), num.ToString()); string[] str = new string[5]; str[0] = "Deleting \""; diff --git a/GSMCommunication/GsmCommunication/GsmPhone.cs b/GSMCommunication/GsmCommunication/GsmPhone.cs index 4b0e66e..fd7e5f0 100644 --- a/GSMCommunication/GsmCommunication/GsmPhone.cs +++ b/GSMCommunication/GsmCommunication/GsmPhone.cs @@ -668,7 +668,7 @@ public void DeleteMessage(int index, DeleteFlag delflag) str[3] = delflag.ToString(); str[4] = "..."; this.LogIt(LogLevel.Info, string.Concat(str)); - int num = delflag; + int num = (int)delflag; string str1 = string.Concat("AT+CMGD=", index.ToString(), ",", num.ToString()); this.ExecAndReceiveMultiple(str1); } @@ -1031,7 +1031,7 @@ private int GetMessageServiceErrorCode(string input) /// A object that contains details about the supported storages. public MessageStorageInfo GetMessageStorages() { - MessageStorageInfo messageStorageInfo; + MessageStorageInfo messageStorageInfo = new MessageStorageInfo { }; lock (this) { this.VerifyValidConnection(); @@ -1196,9 +1196,9 @@ public MemoryStatusWithStorage GetPhonebookMemoryStatus() /// Receives the upper bound of the phonebook /// Receives the maximum number length, 0 if unknown /// Receives the maximum text length, 0 if unknown - public void GetPhonebookSize(out int lowerBound, out int upperBound, out int nLength, out int tLength) + unsafe public void GetPhonebookSize(out int lowerBound, out int upperBound, out int nLength, out int tLength) { - int num; + //int num; int num1; lock (this) { @@ -1213,26 +1213,27 @@ public void GetPhonebookSize(out int lowerBound, out int upperBound, out int nLe } lowerBound = int.Parse(match.Groups[1].Value); upperBound = int.Parse(match.Groups[2].Value); - int& numPointer = nLength; + //int* numPointer = &nLength; if (match.Groups[3].Value != "") { - num = int.Parse(match.Groups[3].Value); + nLength = int.Parse(match.Groups[3].Value); } else { - num = 0; + nLength = 0; } - *(numPointer) = num; - int& numPointer1 = tLength; + //*(numPointer) = num; + + //int* numPointer1 = &tLength; if (match.Groups[4].Value != "") { - num1 = int.Parse(match.Groups[4].Value); + tLength = int.Parse(match.Groups[4].Value); } else { - num1 = 0; + tLength = 0; } - *(numPointer1) = num1; + //*(numPointer1) = num1; string[] strArrays = new string[8]; strArrays[0] = "lowerBound="; strArrays[1] = lowerBound.ToString(); diff --git a/GSMCommunication/GsmCommunication/MessageIndicationHandlers.cs b/GSMCommunication/GsmCommunication/MessageIndicationHandlers.cs index 9c6a1c4..6344af4 100644 --- a/GSMCommunication/GsmCommunication/MessageIndicationHandlers.cs +++ b/GSMCommunication/GsmCommunication/MessageIndicationHandlers.cs @@ -166,7 +166,7 @@ private bool IsCompleteDeliverPduModeIndication(string input) Match match = regex.Match(input); if (match.Success) { - match.Groups[1].Value; + //match.Groups[1].Value; int num = int.Parse(match.Groups[2].Value); string value = match.Groups[3].Value; if (BcdWorker.CountBytes(value) <= 0) diff --git a/GSMCommunication/GsmCommunication/MessageIndicationSettings.cs b/GSMCommunication/GsmCommunication/MessageIndicationSettings.cs index 6f25138..b2cb49a 100644 --- a/GSMCommunication/GsmCommunication/MessageIndicationSettings.cs +++ b/GSMCommunication/GsmCommunication/MessageIndicationSettings.cs @@ -135,7 +135,8 @@ public MessageIndicationSettings(int mode, int mt, int bm, int ds, int bfr) /// Specifies how new SMS-STATUS-REPORT messages should be indicated. /// Specifies how the indication buffer should be handled when indications are activated, i.e. /// when is set to any value except . - public MessageIndicationSettings(MessageIndicationMode mode, SmsDeliverIndicationStyle mt, CbmIndicationStyle bm, SmsStatusReportIndicationStyle ds, IndicationBufferSetting bfr) : this(mode, mt, bm, ds, bfr) + public MessageIndicationSettings(MessageIndicationMode mode, SmsDeliverIndicationStyle mt, CbmIndicationStyle bm, SmsStatusReportIndicationStyle ds, IndicationBufferSetting bfr) + : this((int)mode, (int)mt, (int)bm, (int)ds, (int)bfr) { } } diff --git a/GSMCommunication/GsmCommunication/SerialPortFixer.cs b/GSMCommunication/GsmCommunication/SerialPortFixer.cs index b8316d9..4a9c434 100644 --- a/GSMCommunication/GsmCommunication/SerialPortFixer.cs +++ b/GSMCommunication/GsmCommunication/SerialPortFixer.cs @@ -124,7 +124,7 @@ private void InitializeDcb() { SerialPortFixer.Dcb flags = new SerialPortFixer.Dcb(); this.GetCommStateNative(ref flags); - flags.Flags = flags.Flags & -16385; + flags.Flags = (uint)(flags.Flags & -16385); this.SetCommStateNative(ref flags); } diff --git a/PDUConverter/GsmComm.PduConverter/PduParts.cs b/PDUConverter/GsmComm.PduConverter/PduParts.cs index fdea4d0..b9194be 100644 --- a/PDUConverter/GsmComm.PduConverter/PduParts.cs +++ b/PDUConverter/GsmComm.PduConverter/PduParts.cs @@ -144,7 +144,7 @@ public static string DecodeText(byte[] userData, byte dataCodingScheme) } case 1: { - Label0: + //Label0: str = PduParts.Decode7BitText(userData); break; } @@ -155,7 +155,9 @@ public static string DecodeText(byte[] userData, byte dataCodingScheme) } default: { - goto Label0; + //goto Label0; + str = PduParts.Decode7BitText(userData); + break; } } return str; diff --git a/PDUConverter/GsmComm.PduConverter/SmartMessaging/SmartMessageFactory.cs b/PDUConverter/GsmComm.PduConverter/SmartMessaging/SmartMessageFactory.cs index 7e97f4b..2a7f305 100644 --- a/PDUConverter/GsmComm.PduConverter/SmartMessaging/SmartMessageFactory.cs +++ b/PDUConverter/GsmComm.PduConverter/SmartMessaging/SmartMessageFactory.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; +using System.Drawing; using System.Text; /// @@ -23,7 +24,7 @@ public class SmartMessageFactory static SmartMessageFactory() { SmartMessageFactory.refNumber = 1; - SmartMessageFactory.EmptyOperatorLogo = SmartMessageFactory.CreateOperatorLogo(new OtaBitmap(null), "000", "00"); + SmartMessageFactory.EmptyOperatorLogo = SmartMessageFactory.CreateOperatorLogo(new OtaBitmap((Bitmap)null), "000", "00"); } public SmartMessageFactory() diff --git a/PDUConverter/GsmComm.PduConverter/SmsTimestamp.cs b/PDUConverter/GsmComm.PduConverter/SmsTimestamp.cs index 1371b42..47e7438 100644 --- a/PDUConverter/GsmComm.PduConverter/SmsTimestamp.cs +++ b/PDUConverter/GsmComm.PduConverter/SmsTimestamp.cs @@ -235,7 +235,7 @@ public SmsTimestamp(DateTime timestamp, int timeZoneOffset) /// value is not an . public int CompareTo(object value) { - if (value as SmsTimestamp == null) + if (!(value is SmsTimestamp)) { if (value != null) {