Mtf.HardwareKey 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Mtf.HardwareKey --version 1.0.4                
NuGet\Install-Package Mtf.HardwareKey -Version 1.0.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mtf.HardwareKey" Version="1.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mtf.HardwareKey --version 1.0.4                
#r "nuget: Mtf.HardwareKey, 1.0.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Mtf.HardwareKey as a Cake Addin
#addin nuget:?package=Mtf.HardwareKey&version=1.0.4

// Install Mtf.HardwareKey as a Cake Tool
#tool nuget:?package=Mtf.HardwareKey&version=1.0.4                

Mtf.HardwareKey Library Documentation

Overview

The Mtf.HardwareKey library provides the HardwareKey class, designed for interacting with hardware keys for licensing and security. It includes methods for reading and writing data, handling bitwise operations, and checking memory status. This document covers installation, properties, methods, events, and usage examples for integrating with hardware keys in .NET applications.

Sentinel Superpro Client Library v7.1.0.19

Installation

To use Mtf.HardwareKey, add the package to your project:

  1. Add Package: Run the following in your project directory:

    dotnet add package Mtf.HardwareKey
    
  2. Include the Namespace: Add the Mtf.HardwareKey namespace at the beginning of your code:

    using Mtf.HardwareKey;
    

Class: HardwareKey

The HardwareKey class manages hardware key interactions, including read and write operations on specific memory addresses and bit manipulation. This class supports initialization with developer details and hardware key configurations.

Constructor

HardwareKey(HardwareKeyDeveloper developerId, ushort hardwareKeyIndex, string contactServer)

  • Parameters:
    • developerId: Identifies the developer for hardware key configuration.
    • hardwareKeyIndex: Index of the hardware key to target.
    • contactServer: Server contact details for accessing the hardware key's API.

Properties

Property Type Description
ApiPacket ulong[] Packet used for API communication with the hardware key.
HardwareKeyIndex ushort Index of the selected hardware key.
DeveloperId HardwareKeyDeveloper Developer-specific ID used for hardware key access.

Methods

Connection and Disposal
  • Dispose()
    Disposes of the hardware key and releases resources. Called automatically on object destruction.
Data Read and Write
  • ushort ReadCellValue(MemoryAddress address)
    Reads a cell value from a specified memory address.

  • void WriteCellValue(MemoryAddress address, ushort data, SentinelSuperProAccessCode accessCode = SentinelSuperProAccessCode.ReadWrite)
    Writes a cell value to a specified address with optional access code.

  • bool CanReadFrom(MemoryAddress address)
    Checks if the hardware key can read data from the specified address.

  • void OverwriteCellValue(MemoryAddress address, ushort data)
    Attempts to overwrite the value at a memory address.

Bitwise Operations
  • byte ReadByte(MemoryAddress address, ByteType type)
    Reads a specific byte (higher or lower) from a word at a memory address.

  • void WriteBit(MemoryAddress address, Bit bit, bool bitValue)
    Writes a bit value to a specific bit at a memory address.

Utility Methods
  • string ReadCellValueWithNoException(MemoryAddress address)
    Attempts to read a cell value from a memory address, returning status code as a string if an error occurs.

  • bool IsOverwriteSucceededOrHasDataAlreadyInAddress(MemoryAddress address, ushort data)
    Checks if the overwrite was successful or if the address already contains the specified data.

  • ushort GetMemoryAddressStoredValue(MemoryDataType memoryDataType)
    Retrieves stored memory address data based on the developer's configuration.

  • BitMemoryAddress GetBitMemoryAddress(BitMemoryDataType bitMemoryDataType)
    Retrieves the bit memory address for specified bit data.

Example Usage

using Mtf.HardwareKey;
using Mtf.HardwareKey.Enums;
using System;

public class HardwareKeyExample
{
    public void Example()
    {
        // Initialize HardwareKey with developer ID and server details
        var hardwareKey = new HardwareKey(HardwareKeyDeveloper.YourDeveloperId, 0, "yourContactServer");

        // Read and write cell values
        var address = new MemoryAddress(0x01);
        ushort cellValue = hardwareKey.ReadCellValue(address);
        Console.WriteLine($"Read cell value: {cellValue}");

        hardwareKey.WriteCellValue(address, 1234);
        Console.WriteLine($"New cell value written.");

        // Perform a bitwise operation
        hardwareKey.WriteBit(address, Bit.Bit7, true);

        // Dispose of the hardware key instance
        hardwareKey.Dispose();
    }
}

Notes

  • Exception Handling: Ensure exception handling for errors during API communication and hardware access.
  • Dispose: Always dispose of the HardwareKey instance to free up resources.
  • Bitwise Operations: Use bitwise methods to manipulate specific bits if required by your application logic.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.7 98 12/3/2024
1.0.4 102 12/3/2024