Determine OEM Version c# MC95

M Markus Windischhofer 3 years 6 months ago
9 2 0

How can i determine the OEM Version from a MC95 Device? br Markus

Please Register or Login to post a reply

2 Replies

R Richard Linsley-Hood

As Paul said, some of these things require PInvoke's. Others are available directly from the OS or the EMDK.
/////////////////////////////////////// #region Terminal information  /// /// Get the OEM string data /// ///

 

 

private static string GetTerminalInfo()  {     string szOEMInfo = " ";      string strOEMInfo = "";      // Get OEM Info  if (NativeMethods.SystemParametersInfo(NativeMethods.SPI_GETOEMINFO, szOEMInfo.Length, szOEMInfo, 0) != 0)

 

 

strOEMInfo = szOEMInfo.Substring(0, szOEMInfo.IndexOf(

'\0'));

 

     

return strOEMInfo;   }

 

 

/// /// Get the OS version /// ///

 

 

private static string GetOSInfo() { System.OperatingSystem osInfo = System.Environment.OSVersion;

 

 

return osInfo.Version.ToString(); }

 

 

/// /// Get the Electronic Serial Number /// ///

 

 

private static string GetESNInfo() { Symbol.ResourceCoordination.TerminalInfo MyTerminalInfo = new Symbol.ResourceCoordination.TerminalInfo();

 

 

if (MyTerminalInfo.ESN != null)   {     return MyTerminalInfo.ESN.ToString();   }  else  {     return "";  } }

 

 

///  /// Get the GUID for this terminal  ///    ///

 

 

private static string GetGUIDInfo()  { Symbol.ResourceCoordination.TerminalInfo MyTerminalInfo = new Symbol.ResourceCoordination.TerminalInfo();

 

 System.

Guid g = new Guid();

 

 

if (MyTerminalInfo.UniqueUnitID != null)      g = new Guid(MyTerminalInfo.UniqueUnitID);

 

     

return ("{" + g.ToString() + "}");   }

 

 

/// /// Get the OEM data /// ///

 

 

private static string GetOEMInfo()  {     IntPtr iVerMaj = IntPtr.Zero;      IntPtr iVerMin = IntPtr.Zero;      IntPtr iBuild = IntPtr.Zero;

 

     

NativeMethods.CAD_GetOemVersionNumber(out iVerMaj, out iVerMin);

 

     

NativeMethods.CAD_GetOemBuildNumber(out iBuild);

 

 

return iVerMaj.ToString() + "." + iVerMin.ToString() + "." + iBuild.ToString();  }

 

 

class NativeMethods { /// /// P/Invoke to get the SystemParametersInfo ///   ///   ///   ///   ///   /// [DllImport("coredll.dll")]

 

 

public static extern int SystemParametersInfo(int uiAction, int uiParam, string pvParam, int fWinIni);

 

 

///   /// P/Invoke for the OEM Version Number  ///   ///   ///   /// [DllImport("CAD.dll")] public static extern int CAD_GetOemVersionNumber(out IntPtr iVerMaj, out IntPtr iVerMin);

 

 

///   /// P/Invoke for the OEM Build Number  ///   ///   /// [DllImport("CAD.dll")]

 

 

public static extern int CAD_GetOemBuildNumber(out IntPtr iBuild); ///   /// Constant to get the OEM info  ///

 

 

 

public const int SPI_GETOEMINFO = 258;

Y Yanis Dalabiras

Hi, Not sure there are C# calls to do this but you can PINVOKE some C calls to get this in CAD.dll CAD_GetOemVersionNumber CAD_GetOemBuildNumber CAD_GetLoaderVersionNumber There are some examples in the C EMDK look in C:\PROGRAM FILES\Motorola EMDK for C\v2.1\Samples\C\Standard\SysInfoSample\SysInfoSample.c also attached.

CONTACT
Can’t find what you’re looking for?