import type { ImplementationConfigBase } from '../lib/adapter-config'; import { toHexString } from '../lib/shared'; import { DeviceHandlerBase } from './device-handler-base'; export abstract class LittleEndianDeviceHandlerBase extends DeviceHandlerBase { protected async readWord(command: number): Promise { const word = await this.adapter.i2cBus.readWord(this.address, command); this.silly(`readWord(${toHexString(command)}): ${toHexString(word, 4)}`); return word; } protected async writeWord(command: number, word: number): Promise { this.silly(`writeWord(${toHexString(command)}, ${toHexString(word, 4)})`); return await this.adapter.i2cBus.writeWord(this.address, command, word); } }