tello-custom-ip
Version:
Tello drone client with custom IP address support, forked from @0x77/tellots
72 lines (64 loc) • 2.1 kB
text/typescript
import controlCommands from './commands/control';
import readCommands from './commands/read';
import setCommands from './commands/set';
import stateStream from './streams/state';
import videoStream from './streams/video';
import config from './config';
import { getTelloIP } from './config';
// Export types for library users
export * from './types';
export * from './streams/state.interfaces';
/**
* Main Tello SDK object with response parsing and typed return values
*
* - READ commands return structured data with appropriate types
* - CONTROL/SET commands return boolean (true for 'ok', false for errors)
*/
export const Tello = {
/**
* Set a custom IP address for the Tello drone
* @param ip - The IP address to connect to (default: 192.168.10.1)
*/
setIP: config.setTelloIP,
/**
* Get the current Tello IP address
* @returns The current IP address
*/
getIP: getTelloIP,
/**
* Control commands - All return boolean (true for success, false for failure)
*
* Examples:
* - connect() - Establish connection to the drone
* - takeOff() - Take off
* - land() - Land the drone
* - move.up(50) - Move up 50cm
* - rotate.clockwise(90) - Rotate 90 degrees clockwise
*/
control: controlCommands,
/**
* Read commands - All return structured data with proper types
*
* Examples:
* - battery() - Returns BatteryResponse {value: number}
* - height() - Returns HeightResponse {value: number, unit: 'dm'}
* - attitude() - Returns AttitudeResponse {pitch: number, roll: number, yaw: number, unit: '°'}
*/
read: readCommands,
/**
* Set commands - All return boolean (true for success, false for failure)
*
* Examples:
* - speed(50) - Set speed to 50cm/s
* - wifi(ssid, password) - Set WiFi SSID and password
*/
set: setCommands,
/**
* Receivers for state and video streams
*/
receiver: {
state: stateStream,
video: videoStream
}
};
export default Tello;