@bacnet-js/device
Version:
A TypeScript library for implementing BACnet IP devices in Node.js.
28 lines • 871 B
JavaScript
import { ErrorCode, ErrorClass, ApplicationTag, PropertyIdentifier, } from '@bacnet-js/client';
import { BDAbstractArrayProperty, } from './abstract.js';
import { BDError, } from '../../errors.js';
import {} from './../types.js';
/**
*
*/
export class BDPolledArrayProperty extends BDAbstractArrayProperty {
#poll;
constructor(identifier, poll) {
super(identifier);
this.#poll = poll;
}
getData(ctx) {
return this.#poll(ctx ?? { date: new Date() });
}
async setData() {
throw new BDError('Cannot set data of polled property', ErrorCode.WRITE_ACCESS_DENIED, ErrorClass.PROPERTY);
}
/**
*
* @internal
*/
async ___writeData() {
throw new BDError('Cannot write data of polled property', ErrorCode.WRITE_ACCESS_DENIED, ErrorClass.PROPERTY);
}
}
//# sourceMappingURL=polled.js.map