home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / viobase.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  13.4 KB  |  336 lines

  1. /*******************************************************************************
  2.  *
  3.  *  File:
  4.  *    VIOBASE.H
  5.  *
  6.  *  Description:
  7.  *    Header file containing declarations of the base VIO COM Interfaces
  8.  *    This file will then be included by the files that implement the 
  9.  *    actual components used in the VIO API.
  10.  *
  11.  *  Original Author:
  12.  *    Paul Horenberger
  13.  *
  14.  *  Modification History:
  15.  *    $Log:   H:/AUTOPC/HOSTSW/PVCSARCH/INCLUDE/VIOBASE.H_V  $
  16.  * 
  17.  *    Rev 1.12   May 28 1998 14:39:34   PHorenberger
  18.  * Changed  the type returned from the Next() method of IVIO_EnumDiagnosticEntries
  19.  * to return an array of IVIO_DataValue objects
  20.  * 
  21.  *    Rev 1.11   Feb 13 1998 16:46:04   PHorenberger
  22.  * Added the diagnostic item and 
  23.  * diagnostic entry interfaces
  24.  * 
  25.  *    Rev 1.10   Nov 10 1997 11:41:46   PHorenberger
  26.  * New interface declarations that incorporate changes made to the
  27.  * IVIO_Vehicle interface specification.
  28.  * 
  29.  *    Rev 1.9   Oct 08 1997 19:16:52   PHorenberger
  30.  * Changed the IVIO_Device and IVIO_EventSink interfaces
  31.  * so that the functions that send or receive data to the vehicle
  32.  * don't have to send byte counts
  33.  * 
  34.  *    Rev 1.8   Sep 23 1997 12:21:10   PAULH
  35.  * Removed typedefs and enums from this file and 
  36.  * added them to new file "viotype.h"
  37.  * 
  38.  *    Rev 1.7   Aug 05 1997 18:19:42   PAULH
  39.  * Changes to correlate with the API Spec. submitted to Microsoft
  40.  * 
  41.  *    Rev 1.6   Jul 17 1997 09:47:00   PAULH
  42.  * Changes to project to allow build of API with the WinCE 2.0 Beta SDK rather than straight Win32
  43.  * 
  44.  *    Rev 1.5   Jul 11 1997 18:51:52   PAULH
  45.  * 
  46.  *    Rev 1.4   Jul 08 1997 13:55:24   PAULH
  47.  * Changed a few things as the API implementation has proceeded
  48.  * 
  49.  *    Rev 1.3   Jul 01 1997 17:39:34   PAULH
  50.  * Baseline of final VIO API Header file.  This may be altered depending on the feedback from Microsoft
  51.  * 
  52.  *    Rev 1.2   Jun 16 1997 17:46:46   PAULH
  53.  * Initial Implementation of the VIO API Server DLL.  This includes a stubbed out implementation of the IVIO_Ioctl interface and the framework for implementing the rest of the VIO API COM Interfaces
  54.  * 
  55.  *    Rev 1.1   Jun 12 1997 14:48:38   PAULH
  56.  * Made the file heading consistent with all of the other source files
  57.  * 
  58.  *    Rev 1.0   Jun 09 1997 16:36:08   PAULH
  59.  * Initial revision.
  60.  * 
  61.  *  Copyright (C) 1997 Vetronix Corp.
  62.  ******************************************************************************/
  63. #if (!defined __VIOBASE_H)
  64. #define __VIOBASE_H 1
  65.  
  66. //------------------------------------------------------------------------------
  67. //
  68. // Declarations
  69. //
  70. //------------------------------------------------------------------------------
  71. DECLARE_INTERFACE(IVIO_Vehicle);
  72. DECLARE_INTERFACE(IVIO_EnumMetrics);
  73. DECLARE_INTERFACE(IVIO_EnumMaintenanceItems);
  74. DECLARE_INTERFACE(IVIO_EnumMaintenanceEntry);
  75. DECLARE_INTERFACE(IVIO_EnumDevices);
  76. DECLARE_INTERFACE(IVIO_EnumDiagnosticItems);
  77. DECLARE_INTERFACE(IVIO_EnumDiagnosticEntry);
  78. DECLARE_INTERFACE(IVIO_DataValue);
  79. DECLARE_INTERFACE(IVIO_EventSink);
  80. DECLARE_INTERFACE(IVIO_Device);
  81. DECLARE_INTERFACE(IVIO_Ioctl);
  82. DECLARE_INTERFACE(IVIO_MiniDriver);
  83.  
  84.  
  85. //------------------------------------------------------------------------------
  86. //
  87. // Interfaces
  88. //
  89. //------------------------------------------------------------------------------
  90. // Classes to define
  91. // IVIO_Vehicle interface declaration:
  92. // The purpose of this interface is to provide information about the vehicle
  93. // as a whole.  Examples of this information are vehicle year, make, model,
  94. // VIN Number, and other specifications (i.e. recommended tire pressure, fuel
  95. // capacity, etc.)
  96. // Other attributes of this class are a collection of maintenance information
  97. // (oil change interval, tune-up interval, tire rotation, etc.)
  98. DECLARE_INTERFACE_(IVIO_Vehicle, IUnknown)
  99. {
  100.   // Get an enumerator for the vehicle metrics
  101.   STDMETHOD(get_Metrics) (THIS_ IVIO_EnumMetrics **ppMetricsEnum) PURE;
  102.  
  103.   // Get an enumerator for the vehicle maintenance entries
  104.   STDMETHOD(get_MaintenanceItems) 
  105.                      (THIS_ IVIO_EnumMaintenanceItems **ppMaintItemsEnum) PURE;
  106.  
  107.   // Get an enumerator for the available componenents exposing the IVIO_Device 
  108.   // interface on the vehicle.
  109.   STDMETHOD(get_Devices) (THIS_ IVIO_EnumDevices **ppDevicesEnum) PURE;
  110. };
  111.  
  112.  
  113. // IVIO_EnumMetrics interface declaration:
  114. // This is an OLE enumeration interface that allows enumeration of all available
  115. // vehicle attributes.  It is returned by the IVIO_Vehicle interface by the 
  116. // get_Metrics() method.
  117. DECLARE_INTERFACE_(IVIO_EnumMetrics, IUnknown)
  118. {
  119.   // Reset the enumerator to the beginning of the enumeration list
  120.   STDMETHOD(Reset) (THIS_) PURE;
  121.  
  122.   // Skip the enumerator n items in the enumeration list
  123.   STDMETHOD(Skip) (THIS_ ULONG cMetrics) PURE;
  124.  
  125.   // Attempt to seek to a certain metric entry in the enumeration list
  126.   STDMETHOD(Seek) (THIS_ DWORD dwMetricsID) PURE;
  127.  
  128.   // Retrieve the next n vehicle metrics from the enumeration list
  129.   STDMETHOD(Next) (THIS_ ULONG cMetrics, IVIO_DataValue **rgValueArray, 
  130.                    ULONG *pcMetricsFetched) PURE;
  131.  
  132.   // Add a new vehicle metric to the collection
  133.   STDMETHOD(Add) (THIS_ DWORD dwMetricsID) PURE;
  134.  
  135.   // Set the value of the current vehicle metric 
  136.   STDMETHOD(Set) (THIS_ LPVARIANT pValue) PURE;
  137.  
  138.   // Clone the enumerator with the same state as the current one.
  139.   STDMETHOD(Clone) (THIS_ IVIO_EnumMetrics **ppMetricsEnumerator) PURE;
  140. };
  141.  
  142. // IVIO_EnumMaintenanceItems interface declaration:
  143. // This is an OLE enumeration interface that allows enumeration of all available
  144. // vehicle maintenance items .  It is returned by the IVIO_Vehicle interface by 
  145. // the get_MaintenanceItems() method.
  146. DECLARE_INTERFACE_(IVIO_EnumMaintenanceItems, IUnknown)
  147. {
  148.   // Reset the enumerator to the beginning of the enumeration list
  149.   STDMETHOD(Reset) (THIS_) PURE;
  150.  
  151.   // Skip the enumerator n items in the enumeration list
  152.   STDMETHOD(Skip) (THIS_ ULONG cItems) PURE;
  153.  
  154.   // Attempt to seek to a certain maintenance item in the enumeration list
  155.   STDMETHOD(Seek) (THIS_ DWORD dwItemID) PURE;
  156.  
  157.   // Retrieve the next n maintenance items from the enumeration list
  158.   STDMETHOD(Next) (THIS_ ULONG cItems, IVIO_DataValue **rgValueArray, 
  159.                    ULONG *pcItemsFetched) PURE;
  160.  
  161.   // Add a new maintenance item to the collection
  162.   STDMETHOD(Add) (THIS_ DWORD dwItemID) PURE;
  163.  
  164.   // Clone the enumerator with the same state as the current one.
  165.   STDMETHOD(Clone) (THIS_ IVIO_EnumMaintenanceItems **ppItemsEnumerator) PURE;
  166. };
  167.  
  168. // IVIO_EnumMaintenanceEntry interface declaration:
  169. // This is an OLE enumeration interface that allows enumeration of the 
  170. // attributes of a maintenance entry.  It is returned by the 
  171. // IVIO_EnumMaintenanceItems interface's Next() method
  172. DECLARE_INTERFACE_(IVIO_EnumMaintenanceEntry, IUnknown)
  173. {
  174.   // Reset the enumerator to the beginning of the enumeration list
  175.   STDMETHOD(Reset) (THIS_) PURE;
  176.  
  177.   // Skip the enumerator n items in the enumeration list
  178.   STDMETHOD(Skip) (THIS_ ULONG cAttributes) PURE;
  179.  
  180.   // Attempt to seek to a certain maintenance entry attribute in the enumeration
  181.   // list
  182.   STDMETHOD(Seek) (THIS_ DWORD dwItemID) PURE;
  183.  
  184.   // Retrieve the next n maintenance entry attributes from the enumeration list
  185.   STDMETHOD(Next) (THIS_ ULONG cAttributes, IVIO_DataValue **rgValueArray, 
  186.                    ULONG *pcAttributesFetched) PURE;
  187.  
  188.   // Set the value of the current maintenance entry attribute
  189.   STDMETHOD(Set) (THIS_ LPVARIANT pValue) PURE;
  190.  
  191.   // Clone the enumerator with the same state as the current one.
  192.   STDMETHOD(Clone) (THIS_ IVIO_EnumMaintenanceEntry **ppEntryEnumerator) PURE;
  193. };
  194.  
  195. // IVIO_EnumDevices interface declaration:
  196. // This is an OLE enumeration interface that allows enumeration of all available
  197. // components that expose the IVIO_Device interface.  It is returned by the 
  198. // IVIO_Vehicle interface using the get_Devices() method.
  199. DECLARE_INTERFACE_(IVIO_EnumDevices, IUnknown)
  200. {
  201.   // Reset the enumerator to the beginning of the enumeration list
  202.   STDMETHOD(Reset) (THIS_) PURE;
  203.  
  204.   // Skip the enumerator n items in the enumeration list
  205.   STDMETHOD(Skip) (THIS_ ULONG cDevices) PURE;
  206.  
  207.   // Attempt to seek to a certain device in the enumeration list
  208.   STDMETHOD(Seek) (THIS_ REFCLSID rclsid) PURE;
  209.  
  210.   // Retrieve the next n devices from the enumeration list
  211.   STDMETHOD(Next) (THIS_ ULONG cDevices, LPCLSID *rgDeviceArray, 
  212.                    ULONG *pcDevicesFetched) PURE;
  213.  
  214.   // Clone the enumerator with the same state as the current one.
  215.   STDMETHOD(Clone) (THIS_ IVIO_EnumDevices **ppDeviceEnumerator) PURE;
  216. };
  217.  
  218. // IVIO_EnumDiagnosticItems interface declaration:
  219. // This is an OLE enumeration interface that allows enumeration of all available
  220. // diagnostic trouble codes from the CLSID_TROUBLE_CODES object's GetData() 
  221. // method as the object IUnknown interface.
  222. DECLARE_INTERFACE_(IVIO_EnumDiagnosticItems, IUnknown)
  223. {
  224.   // Reset the enumerator to the beginning of the enumeration list
  225.   STDMETHOD(Reset) (THIS_) PURE;
  226.  
  227.   // Skip the enumerator n items in the enumeration list
  228.   STDMETHOD(Skip) (THIS_ ULONG cItems) PURE;
  229.  
  230.   // Retrieve the next n diagnostic items from the enumeration list
  231.   STDMETHOD(Next) (THIS_ ULONG cItems, IVIO_DataValue **rgValueArray,
  232.                    ULONG *pcItemsFetched) PURE;
  233.  
  234.   // Clone the enumerator with the same state as the current one.
  235.   STDMETHOD(Clone) (THIS_ IVIO_EnumDiagnosticItems **ppItemsEnumerator) PURE;
  236. };
  237.  
  238. // IVIO_EnumDiagnosticEntry interface declaration:
  239. // This is an OLE enumeration interface that allows enumeration of the 
  240. // attributes of a diagnostic item.  An object that exposes this interface is
  241. // returned by the Next() method in the IVIO_EnumDiagnosticItems interface.
  242. DECLARE_INTERFACE_(IVIO_EnumDiagnosticEntry, IUnknown)
  243. {
  244.   // Reset the enumerator to the beginning of the enumeration list
  245.   STDMETHOD(Reset) (THIS_) PURE;
  246.  
  247.   // Skip the enumerator n items in the enumeration list
  248.   STDMETHOD(Skip) (THIS_ ULONG cAttributes) PURE;
  249.  
  250.   // Attempt to seek to a certain diagnostic entry attribute in the enumeration
  251.   // list
  252.   STDMETHOD(Seek) (THIS_ DWORD dwItemID) PURE;
  253.  
  254.   // Retrieve the next n diagnostic entry attributes from the enumeration list
  255.   STDMETHOD(Next) (THIS_ ULONG cAttributes, IVIO_DataValue **rgValueArray, 
  256.                    ULONG *pcAttributesFetched) PURE;
  257.  
  258.   // Clone the enumerator with the same state as the current one.
  259.   STDMETHOD(Clone) (THIS_ IVIO_EnumDiagnosticEntry **ppEntryEnumerator) PURE;
  260. };
  261.  
  262.  
  263. // IVIO_DataValue interface declaration:
  264. // This is the interface that is returned by the Next() methods in the 
  265. // IVIO_EnumMetrics, IVIO_EnumMaintenanceItems, and IVIO_EnumMaintenanceEntry
  266. // interfaces to return data back to the requesting application.  See the VIO
  267. // API specification for details on the specific data values and their meanings
  268. DECLARE_INTERFACE_(IVIO_DataValue, IUnknown)
  269. {
  270.   // Get the data item's ID
  271.   STDMETHOD(get_ItemID)(THIS_ LPDWORD pItemID) PURE;
  272.  
  273.   // Get the value of the data item.
  274.   // Note:  The calling application must call VariantClear() on the value set
  275.   //        by this method in order to free up any resources in use by the 
  276.   //        variant.
  277.   STDMETHOD(get_DataValue)(THIS_ LPVARIANT pDataValue) PURE;
  278. };
  279.  
  280. // IVIO_EventSink class declaration:
  281. // This is an abstract base class used to create notification
  282. // objects that are called from an IVIO_Device instance when the 
  283. // IVIO_Device->SetNotify() method is invoked
  284. DECLARE_INTERFACE_(IVIO_EventSink, IUnknown)
  285. {
  286.   // Method that is called from the IVIO_Device instance
  287.   // Need to determine specific parameters that are needed
  288.   STDMETHOD(ReceiveData) (THIS_ LPVARIANT pData, LPARAM lParam) PURE;
  289. };
  290.  
  291. // IVIO_Device class declaration:
  292. // This is the base class that all vehicle information is derived from
  293. DECLARE_INTERFACE_(IVIO_Device, IUnknown)
  294. {
  295.   //
  296.   // Get Properties of a IVIO_Device instance
  297.   //
  298.   // Get the metrics of this IVIO_Device
  299.   STDMETHOD(get_Metrics) (THIS_ LPVIODEVICEMETRICS pVIODeviceMetrics) PURE;
  300.   // Get the status of this IVIO_Device
  301.   STDMETHOD(get_Status) (THIS_ DWORD *pStatus) PURE;
  302.   // Get the access mode of this IVIO_Device (shared, exclusive)
  303.   STDMETHOD(get_AccessMode) (THIS_ DWORD dwMode, DWORD *pAccessMode) PURE;
  304.   // Set the access mode of this IVIO_Device (shared, exclusive)
  305.   STDMETHOD(set_AccessMode) (THIS_ DWORD dwMode, DWORD dwAccessMode) PURE;
  306.  
  307.   // 
  308.   // Send/Retrieve data from the device itself
  309.   //
  310.   // Read data from a IVIO_Device instance (read data from vehicle) 
  311.   STDMETHOD(GetData) (THIS_ LPVARIANT pData, DWORD dwTimeout) PURE;
  312.   // Send data to a IVIO_Device instance (send control data to vehicle)
  313.   STDMETHOD(SetData) (THIS_ const LPVARIANT pData, DWORD dwTimeout) PURE;
  314.   
  315.   //
  316.   // Add an event sink to a given device
  317.   //
  318.   // Add a notification sink to a IVIODevice instance
  319.   STDMETHOD(SetNotify) (THIS_ const LPVARIANT pParameterData, 
  320.                         IVIO_EventSink *pEventSink, DWORD dwFreq) PURE;  
  321. };
  322.  
  323. // Low-level, straight to the device driver type of interface
  324. // This facilitates applications sending device driver-specific commands
  325. // to the VIO device driver
  326. DECLARE_INTERFACE_(IVIO_Ioctl, IUnknown)
  327. {
  328.   // Similar to the standard DeviceIoControl API
  329.   STDMETHOD(DoCommand) (THIS_ DWORD dwCommandId, const PVOID pCommandData, 
  330.                         DWORD cb, PVOID pReply, DWORD dwOutputSize, 
  331.                         DWORD *pReplySize) PURE;
  332.  
  333. };
  334.  
  335. #endif // include sentry
  336.