UNPKG

enip-ts

Version:

Typescript implementation of the Ethernet/IP™ protocol.

32 lines (31 loc) 929 B
/// <reference types="node" /> export type dataItem = { TypeID: number; length?: number; data: Buffer; }; export declare const ItemIDs: Record<string, number>; export declare class CPF { /** * Checks if the specified command number is a known command * @param cmd Command number to check * @returns if the command is a known command */ static isCmd(cmd: number): boolean; /** * Builds a Common Packet Formatted Buffer to be * Encapsulated. * * @param dataItems - Array of CPF Data Items * @returns CPF Buffer to be Encapsulated */ static build(dataItems: Array<dataItem>): Buffer; /** * Parses Incoming Common Packet Formatted Buffer * and returns an Array of Objects. * * @param buf - Common Packet Formatted Data Buffer * @returns Array of Common Packet Data Objects */ static parse(buf: Buffer): dataItem[]; }