Share via


MsrBase Class

2/27/2008

Contains most of the functionality for support of MSR devices.

Namespace: Microsoft.PointOfService.BaseServiceObjects
Assembly: Microsoft.PointOfService.ControlBase (in microsoft.pointofservice.controlbase.dll)

Syntax

'Declaration
Public MustInherit Class MsrBase
    Inherits MsrBasic
public abstract class MsrBase : MsrBasic
public ref class MsrBase abstract : public MsrBasic
public abstract class MsrBase extends MsrBasic
public abstract class MsrBase extends MsrBasic

Remarks

The MsrBase class derives from the MsrBasic class and contains most of the functionality for support of MSR devices. When deriving from MsrBase, service objects should implement the CheckHealth and DirectIO methods. In addition, the service object should provide implementations for the ParseMsrTrackData and ParseMsrFieldData methods, which will be called by MsrBase class when appropriate. (The POS for .NET SDK includes a class called MsrDataParser, which is an example of how to parse track data in ISO format.)

The MsrBase class provides three protected methods, GoodRead, FailedRead, and UnreadableCard, for the management of swiped card data. The service object should call one of these three methods when a card swipe occurs, using the following guidelines:

  • GoodRead: Should be called when all tracks have been read successfully. The MsrBase class will queue a DataEvent event to the application and increment the StatisticGoodReadCount statistic;

  • FailedRead: Should be called when some tracks have been read successfully but others have not. The MsrBase class queues an ErrorEvent event, sets the TrackData properties for the tracks that were read successfully, and increments the StatisticFailedReadCount statistic;

  • UnreadableCard: Should be called when no track can be read successfully. The MsrBase class queues an ErrorEvent event and increments the StatisticUnreadableCardCount statistic.

The MsrBase class provides the core functionality for opening, claiming, and enabling MSR devices. Typically, though, service objects will want to override these methods to add their own custom processing. (An example would be to update device statistics during the Open method, or to bring the device online when the application enables it.) When overriding these methods, the service object must call the base class implementation.

Inheritance Hierarchy

System.Object
   Microsoft.PointOfService.PosDevice
     Microsoft.PointOfService.PosCommon
       Microsoft.PointOfService.Msr
         Microsoft.PointOfService.BasicServiceObjects.MsrBasic
          Microsoft.PointOfService.BaseServiceObjects.MsrBase

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.

See Also

Reference

MsrBase Members
Microsoft.PointOfService.BaseServiceObjects Namespace