The information contained here are property of DIGITAX Automotive Electronics Italy, and extremely confidential. Any disclosure, copying, distribution to third
party is strictly prohibited.
48
4.
AITP (Version and information)
This application shows how to use AITP to retrieve some hardware specific information like Hardware
ID, Hardware version, AITP version etc…
Sample code:
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Text;
using
System.Windows.Forms;
namespace
Digitax.Sample.HardwareInfo
{
//simple application that shows how to get from aitp hardware information like the HardwareID
public
partial
class
HardwareInfoForm
:
Form
{
//aitp instance
Aitp.Wrapper41.
AitpCore
_aitp =
new
Aitp.Wrapper41.
AitpCore
();
Aitp.Wrapper41.AitpObjects.
AitpVersionData
_ver;
public
HardwareInfoForm()
{
InitializeComponent();
this
.C=
new
CancelEventHandler
(HardwareInfoForm_Closing);
//init aitp in MDT/MCU "COM4:" 19200 on ForceOne "COM3:" 38400
_aitp.AITPInit(
"COM3:"
, 38400);
_aitp.EvAITPAskSoftwareV=
new
Aitp.Wrapper41.
AitpCore
.
delAITPAskSoftwareVersion
(_aitp_EvAITPAskSoftwareVersion);
}
void
_aitp_EvAITPAskSoftwareVersion(Aitp.Wrapper41.AitpObjects.
AitpVersionData
avd)
{
_ver = avd;
UpdForm();
}
private
delegate
void
delUpdForm
();
private
void
UpdForm()
{
if
(InvokeRequired)
{
this
.BeginInvoke(
new
delUpdForm
(UpdForm));
return
;
}
//update text
tbCountryCode.Text = _ver.CountryCode.ToString();
tbFWCheck.Text = _ver.FirmwareCheckSum.ToString();
tbHwSubVer.Text = _ver.HardwareSubVersion.ToString();
tbHwType.Text = _ver.HardwareType.ToString();
tbHwVer.Text = _ver.HardwareVersion.ToString();
tbHwID.Text = _ver.HwID.ToString();
tbProdDate.Text = _ver.ProductionDate.ToString();
tbSubVer.Text = _ver.SubVersion.ToString();
tbVer.Text = _ver.Version.ToString();
}
private
void
btAskVer_Click(
object
sender,
EventArgs
e)
{
_aitp.AITPAskSoftwareVersion();
}
void
HardwareInfoForm_Closing(
object
sender,
CancelEventArgs
e)
{
_aitp.AITPRelease();
}
}
}
Содержание Force One MDT
Страница 1: ...Force One MDT Technical Manual V 1 6...