npm.io
1.8.4 • Published 3h ago

@springfield/ham-radio-driver

Licence
MIT
Version
1.8.4
Deps
5
Size
573 kB
Vulns
0
Weekly
0

Ham Radio Driver

A high-level driver for reading and writing ham radio memory using DSL-based protocol specifications.

Features

  • Protocol-Driven: Uses DSL-based protocol specifications for radio communication
  • Multi-Radio Support: Supports different radio models through configuration files
  • Memory Operations: Read and write complete radio memory
  • Progress Tracking: Real-time progress indication and cancellation support
  • Serial Logging: Built-in serial communication logging for debugging
  • Log Comparison: Tools to compare logs between sniffer and driver

Serial Logging

The driver includes comprehensive serial logging capabilities to help debug radio communication:

Enabling Serial Logging
import { RadioDriver } from '@springfield/ham-radio-driver';

// Enable serial logging
const driver = new RadioDriver(radioConfig, logger, undefined, true);
Log Comparison

Compare logs between the sniffer and driver:

import { LogComparator } from '@springfield/ham-radio-driver';

const comparator = new LogComparator('sniffer.log', 'driver.log');
const result = comparator.compareLogs();
console.log(comparator.generateReport(result));
Command Line Comparison
# Compare logs and generate report
node log-comparator.js sniffer.log driver.log

# Save comparison report to file
node log-comparator.js sniffer.log driver.log comparison-report.txt

For detailed documentation, see Serial Logging Guide.

Installation

npm install @springfield/ham-radio-driver

Quick Start

import { RadioDriver } from '@springfield/ham-radio-driver';
import { RadioProgressIndicator } from '@springfield/ham-radio-api';

// Create driver instance
const driver = new RadioDriver(radioConfig, logger);

// Read radio memory
const progressIndicator = new RadioProgressIndicator();
const memoryData = await driver.readRadio('/dev/ttyUSB0', progressIndicator);

// Write radio memory
await driver.writeRadio('/dev/ttyUSB0', memoryData, progressIndicator);

Documentation

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.