{"id":157975,"date":"2012-11-09T12:19:06","date_gmt":"2012-11-09T08:19:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=157975"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=157975","title":{"rendered":"<span class=\"post_title\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 GPS \u0432 WinCE (C#)<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c GPS \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043d\u0430 \u0431\u0430\u0437\u0435 WindowsCE. \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0421\u041a\u0410\u0423\u0422-\u041d\u0430\u0432\u0438\u0433\u0430\u0442\u043e\u0440, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0435 \u043a\u0430\u043a \u0432 Win\u0421\u0415 \u0432\u0435\u0440\u0441\u0438\u0438 5.0, \u0442\u0430\u043a \u0438 \u0432 WinCE \u0432\u0435\u0440\u0441\u0438\u0438 6.0, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 NMEA \u0441 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a\u0430, \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GPS \u0432 WinCE \u043a\u0430\u043a \u0432\u0435\u0440\u0441\u0438\u0438 5.0, \u0442\u0430\u043a \u0438 \u0432\u0435\u0440\u0441\u0438\u0438 6.0 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 COM \u043f\u043e\u0440\u0442\u043e\u043c. \u041d\u0430\u0439\u0442\u0438 \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435, \u043a\u0430\u043a\u043e\u0439 COM-\u043f\u043e\u0440\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 GPS, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b: DeviceManager.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/ff2\/56d\/c32\/ff256dc32086e142a73e539af879ad40.jpg\"\/><\/p>\n<p>  \u0427\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043e\u043a \u0443\u0436\u0435 \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0438\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b COM \u043f\u043e\u0440\u0442\u043e\u0432 GPS \u0431\u044b\u043b\u043e \u0434\u0432\u0430. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0441\u0442\u0438 \u041f\u041e, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f GPS \u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043d\u0435 \u0431\u043e\u0440\u043e\u043b\u0438\u0441\u044c \u0437\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a COM-\u043f\u043e\u0440\u0442\u0443. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e COM \u043f\u043e\u0440\u0442 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u043e\u043d\u043e\u043f\u043e\u043b\u044c\u043d\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435.<br \/>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 NMEA (http:\/\/ru.wikipedia.org\/wiki\/NMEA_0183), \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e-\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c COM \u043f\u043e\u0440\u0442, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043a\u0440\u044b\u0442\u044c COM \u043f\u043e\u0440\u0442. \u0427\u0442\u043e \u043d\u0430 C# \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>\/\/\/&lt;summary&gt; \/\/\/ \u0427\u0442\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 COM \u043f\u043e\u0440\u0442\u0430 \/\/\/&lt;\/summary&gt; \/\/\/&lt;param name=&quot;comPortName&quot;&gt;\u0418\u043c\u044f COM-\u043f\u043e\u0440\u0442\u0430&lt;\/param&gt; \/\/\/&lt;param name=&quot;baudRate&quot;&gt;\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u043e\u0431\u043c\u0435\u043d\u0430&lt;\/param&gt; private void ReadData(string comPortName,int baudRate) {     var serialPort = newSerialPort(comPortName)     {         BaudRate = baudRate,         DataBits = 8,         Parity = Parity.None,         StopBits = StopBits.One,         RtsEnable = true     };     serialPort.Open();     \/\/\u0427\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 COM-\u043f\u043e\u0440\u0442\u0430     \/\/.....     var line=serialPort.ReadLine();      \/\/.....     serialPort.Close(); } <\/code><\/pre>\n<p>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a COM-\u043f\u043e\u0440\u0442\u0443. (\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430: \u00abUnauthorizedAccessException: Access to the port is denied\u00bb).<\/p>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 OpenNetCf \u0437\u0430\u0431\u043e\u0442\u043b\u0438\u0432\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e SerialPort.<\/p>\n<p>  <a href=\"http:\/\/serial.codeplex.com\/SourceControl\/changeset\/view\/25883#435389\">http:\/\/serial.codeplex.com\/SourceControl\/changeset\/view\/25883#435389<\/a><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 OpenNetCf.IO.Serial<\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 COM-\u043f\u043e\u0440\u0442\u043e\u043c GPS \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code>\/\/\/&lt;summary&gt; \/\/\/ \u041a\u043b\u0430\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GPS COM-\u043f\u043e\u0440\u0442\u043e\u043c \/\/\/&lt;\/summary&gt; public class GpsPort: IDisposable {     private Port _serialPort;     private bool _disposed;     private readonly object _syncObject = new object();      public bool IsOpen { get; private set; }      \/\/\/&lt;summary&gt;     \/\/\/\u041f\u043e\u0440\u0442 \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 GPS     \/\/\/&lt;\/summary&gt;     \/\/\/&lt;param name=&quot;serialPortName&quot;&gt;\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043f\u043e\u0440\u0442\u0430&lt;\/param&gt;     \/\/\/&lt;param name=&quot;baudRate&quot;&gt;\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u043f\u043e\u0440\u0442\u0430&lt;\/param&gt;     public GpsPort(string serialPortName, int baudRate)     {         _serialPort = newPort(serialPortName, newDetailedPortSettings { BasicSettings = newBasicPortSettings { BaudRate = (BaudRates)baudRate }, EOFChar = '\\n' });         _disposed = false;     }      public void Dispose()     {         if (!_disposed)         {             Close();             _serialPort = null;             _disposed = true;         }         GC.SuppressFinalize(this);     }      \/\/\/&lt;summary&gt;     \/\/\/Destructor     \/\/\/&lt;\/summary&gt;     ~GpsPort()     {         Dispose();     }      \/\/\/&lt;summary&gt;     \/\/\/ \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445     \/\/\/&lt;\/summary&gt;     public void Open()     {         try         {             _serialPort.Open();             _serialPort.DataReceived += SerialPortDataReceived;             IsOpen = true;         }         catch (Exception ex)         {             throw new ApplicationException(&quot;Could not open com port&quot;, ex);         }        }      \/\/\/&lt;summary&gt;     \/\/\/ \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u0440\u0442\u0430     \/\/\/&lt;\/summary&gt;     private void SerialPortDataReceived()     {         lock (_syncObject)         {             if (_serialPort == null || !_serialPort.IsOpen) return;              var realPortData = _serialPort.Input;             if (realPortData.Length == 0) return;              Debug.Write(Encoding.GetEncoding(&quot;ASCII&quot;).GetString(realPortData, 0, realPortData.Length));          }     }      \/\/\/&lt;summary&gt;     \/\/\/\u0417\u0430\u043a\u0440\u044b\u0442\u0438\u0435\u043f\u043e\u0440\u0442\u0430     \/\/\/&lt;\/summary&gt;     public void Close()     {         IsOpen = false;         if (_serialPort != null)         if (_serialPort.IsOpen)         {             _serialPort.DataReceived -= SerialPortDataReceived;             _serialPort.Close();         }     } } <\/code><\/pre>\n<p>  \u0412\u043c\u0435\u0442\u043e\u0434\u0435 SerialPortDataReceived \u043f\u0438\u0448\u0435\u043c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0430\u0440\u0441\u0438\u043d\u0433 NMEA \u0441\u0442\u0440\u043e\u043a.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e:  <\/p>\n<ol>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0430\u0440\u0441\u0435\u0440 NMEA;<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/sharpgps.codeplex.com\/\">SharpGps<\/a>;<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/www.codeproject.com\/Articles\/279647\/NMEA-0183-2-0-Sentense-parser-builder\">NMEA-0183-2-0-Sentense-parser-builder<\/a> (<a href=\"http:\/\/habrahabr.ru\/post\/132493\/\">\u0422\u0443\u0442<\/a> \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435);<\/li>\n<li>\u041b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0430\u0440\u0441\u0435\u0440.<\/li>\n<\/ol>\n<p>  Sentenseparserbuilder \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b, \u0430 \u0432\u043e\u0442 \u043f\u0440\u043e SharpGps \u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p>  \u0421\u0434\u0435\u043b\u0430\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 \u043e\u0442 \u0442\u0435\u043c\u044b. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0435\u0441\u0442\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u044b, \u0445\u043e\u0442\u044f \u043c\u043d\u043e\u0433\u0438\u0435 \u043c\u043e\u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0441\u0447\u0438\u0442\u0430\u044e\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0430 \u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u041d\u043e \u043e\u0431\u043e \u0432\u0441\u0451\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443:<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435 NMEA 0183 (<a href=\"http:\/\/www.tronico.fi\/OH6NT\/docs\/NMEA0183.pdf\">http:\/\/www.tronico.fi\/OH6NT\/docs\/NMEA0183.pdf<\/a>) \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a 2-\u0437\u043d\u0430\u0447\u043d\u043e\u0435 16-\u0440\u0438\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0430\u044f XOR-\u0441\u0443\u043c\u043c\u0430 \u0432\u0441\u0435\u0445 \u0431\u0430\u0439\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043c\u0435\u0436\u0434\u0443 \u00ab$\u00bb \u0438 \u00ab*\u00bb. <\/p>\n<p>  \u0412 SharpGps \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435:   <\/p>\n<pre><code>private bool CheckSentence(string strSentence) {     int iStart = strSentence.IndexOf('$');     int iEnd = strSentence.IndexOf('*');     \/\/If start\/stop isn't found it probably doesn't contain a checksum,     \/\/or there is no checksum after *. In such cases just return true.     if (iStart &gt;= iEnd || iEnd + 3 &gt; strSentence.Length) return true;     byte result = 0;     for (int i = iStart + 1; i &lt; iEnd; i++)     {         result ^= (byte)strSentence[i];     }     return (result.ToString(&quot;X&quot;) == strSentence.Substring(iEnd + 1, 2)); } <\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b (0x01, 0x02 \u0438 \u0442.\u0434.), \u043a\u0430\u043a \u0438 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u043e \u0432 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435. \u041d\u043e \u043b\u044e\u0431\u043e\u0439 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u043f\u0430\u043a\u0435\u0442\u044b \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u043e\u0439, \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u043d\u043e\u043b\u044c (0x1,0x2).<\/p>\n<p>  \u0412 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043e\u0442\u0441\u0435\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0451 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u0442\u0440\u0435\u043a, \u0445\u043e\u0442\u044c \u043e\u043d \u0438 \u0435\u0441\u0442\u044c, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430. <\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c, \u0445\u043e\u0442\u044f \u0431\u044b \u0442\u0430\u043a:<\/p>\n<pre><code>var packCrc = byte.Parse(strSentence.Substring(iEnd + 1, 2),         System.Globalization.NumberStyles.AllowHexSpecifier); return (result == packCrc); <\/code><\/pre>\n<p>  \u0421 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u0451. <\/p>\n<p>  \u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c SqlServer Compact Edition. \u0415\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SqlServer Compact \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e SqlServer Compact \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0430 WinCe \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0433\u043e \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a GPS \u0434\u0430\u043d\u043d\u044b\u043c \u043d\u0430 WinCe \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0442\u043e\u0440\u0430\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439 (Prestigio, Texet, Shturmann, Mio) \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 WinCE. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0447\u0442\u043e \u043e\u0442 \u0447\u0430\u0441\u0442\u0438 \u0433\u0440\u0430\u0431\u043b\u0435\u0439 \u043f\u043e\u0434\u0441\u0442\u0435\u0440\u0435\u0433\u0430\u044e\u0449\u0438\u0445 \u0432\u0430\u0441 \u043d\u0430 \u043f\u0443\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434 WinCE \u043e\u043d\u0430 \u0438\u0437\u0431\u0430\u0432\u0438\u0442.<br \/>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0416\u0434\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/scout\/blog\/157975\/\"> http:\/\/habrahabr.ru\/company\/scout\/blog\/157975\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c GPS \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043d\u0430 \u0431\u0430\u0437\u0435 WindowsCE. \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0421\u041a\u0410\u0423\u0422-\u041d\u0430\u0432\u0438\u0433\u0430\u0442\u043e\u0440, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0435 \u043a\u0430\u043a \u0432 Win\u0421\u0415 \u0432\u0435\u0440\u0441\u0438\u0438 5.0, \u0442\u0430\u043a \u0438 \u0432 WinCE \u0432\u0435\u0440\u0441\u0438\u0438 6.0, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 NMEA \u0441 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a\u0430, \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-157975","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/157975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=157975"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/157975\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=157975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=157975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=157975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}