Skip to content

krosk93/ChameleonUltra.NET

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChameleonUltra

A .NET Standard 2.1 library for interacting with Chameleon Ultra devices. This library provides a robust, cross-platform SDK for managing RFID tags, emulating cards, and performing advanced reader operations.

Features

  • Cross-Platform: Built on .NET Standard 2.1, compatible with .NET 6+, .NET MAUI, Android, iOS, and Desktop (Windows/macOS/Linux).
  • Multiple Adapters:
    • BLE Adapter: Supports Bluetooth Low Energy communication using Plugin.BLE.
    • Serial Adapter: Supports USB-Serial communication using System.IO.Ports.
  • Mifare Classic Support: Full implementation of the Crypto1 cipher and high-level commands for reading and validating Mifare Classic 1k/4k cards.
  • Protocol Implementation: Complete port of the Chameleon Ultra frame protocol, including head/data LRC checks and asynchronous command/response handling.

Project Structure

  • src/ChameleonUltra: The core library.

Getting Started

Installation

Add a reference to the ChameleonUltra project or install the NuGet package:

dotnet add package ChameleonUltra

Usage Example (BLE)

using ChameleonUltra;
using ChameleonUltra.Adapters;

// In a MAUI/Mobile context with Plugin.BLE
var adapter = new BleAdapter(selectedBluetoothDevice);
using var ultra = new ChameleonUltra(adapter);

await ultra.ConnectAsync();

// Scan for HF Tag
var tagInfo = await ultra.ScanHf14aAsync();
if (tagInfo.AntiColl != null)
{
    Console.WriteLine($"Found Tag: {BitConverter.ToString(tagInfo.AntiColl.Uid)}");
}

// Read a Mifare Block
byte[] key = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
var blockData = await ultra.ReadMf1BlockAsync(4, Mf1KeyType.KEY_A, key);

await ultra.DisconnectAsync();

Usage Example (Serial)

using ChameleonUltra;
using ChameleonUltra.Adapters;

var adapter = new SerialAdapter("COM3"); // or "/dev/ttyUSB0" on Linux/macOS
using var ultra = new ChameleonUltra(adapter);

await ultra.ConnectAsync();
await ultra.SetDeviceModeAsync(DeviceMode.READER);
// ... perform operations
await ultra.DisconnectAsync();

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages