Skip to content

Commit

Permalink
fix: better binary protocol types
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Apr 11, 2024
1 parent 4d76d6b commit 7f93ccc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/KnxProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
})
Expand Down
6 changes: 3 additions & 3 deletions src/types/binary-protocol.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 7f93ccc

Please sign in to comment.