node-mavlink
Version:
MavLink definitions and parsing library
65 lines • 2.08 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { EventEmitter } from 'events';
import { MavLinkPacketSplitter, MavLinkPacketParser } from './mavlink';
import { uint8_t, MavLinkData } from 'mavlink-mappings';
export interface TCPConnectionInfo {
ip: string;
port: number;
}
/**
* Encapsulation of communication over TCP
*/
export declare class MavTCP extends EventEmitter {
private input;
private socket?;
private ip;
private port;
private seq;
/**
* @param splitter packet splitter instance
* @param parser packet parser instance
*/
constructor({ splitter, parser, }?: {
splitter?: MavLinkPacketSplitter | undefined;
parser?: MavLinkPacketParser | undefined;
});
/**
* Start communication with the controller via MAVESP8266
*
* @param receivePort port to receive messages on (default: 14550)
* @param sendPort port to send messages to (default: 14555)
* @param ip IP address to send to in case there is no broadcast (default: empty string)
*/
start(host?: string, port?: number): Promise<TCPConnectionInfo>;
/**
* Closes the client stopping any message handlers
*/
close(): Promise<void>;
/**
* Send a packet
*
* @param msg message to send
* @param sysid system id
* @param compid component id
*/
send(msg: MavLinkData, sysid?: uint8_t, compid?: uint8_t): Promise<number>;
/**
* Send a signed packet
*
* @param msg message to send
* @param sysid system id
* @param compid component id
* @param linkId link id for the signature
*/
sendSigned(msg: MavLinkData, key: Buffer, linkId?: uint8_t, sysid?: uint8_t, compid?: uint8_t): Promise<number>;
/**
* Send raw data over the socket. Useful for custom implementation of data sending
*
* @param buffer buffer to send
*/
sendBuffer(buffer: Buffer): Promise<number>;
private processIncomingTCPData;
private processIncomingPacket;
}
//# sourceMappingURL=mavtcp.d.ts.map