diff --git a/src/KnxProtocol.ts b/src/KnxProtocol.ts index e6f3b86..4860b11 100644 --- a/src/KnxProtocol.ts +++ b/src/KnxProtocol.ts @@ -52,7 +52,7 @@ KnxProtocol.define('IPv4Endpoint', { ) const [addr, port] = value.split(':') - this.raw(Buffer.from(ipaddr.parse(addr).toByteArray()), 4) + this.raw(Buffer.from(ipaddr.parse(addr).toByteArray())) this.UInt16BE(port) }, }) diff --git a/src/types/binary-protocol.d.ts b/src/types/binary-protocol.d.ts index d170d25..cd49d40 100644 --- a/src/types/binary-protocol.d.ts +++ b/src/types/binary-protocol.d.ts @@ -2,8 +2,8 @@ import { Duplex } from 'stream' declare module 'binary-protocol' { interface ProtocolConfig { - read(propertyName: string): void - write(value: any): void + read(this: Reader, propertyName: string): void + write(this: Writer, value: any): void } interface Reader { @@ -20,7 +20,7 @@ declare module 'binary-protocol' { end(fn: () => void): this finally(fn: () => void): this reset(): this - raw(property: string, fn: (value: any) => void): this + raw(property: string, length: number): this next(chunk?: any): any process(): any createLooper(property: string, fn: (value: any) => void): this