tplink-shome-protocol

Crates.iotplink-shome-protocol
lib.rstplink-shome-protocol
version0.1.2
sourcesrc
created_at2023-01-21 20:46:31.150494
updated_at2023-02-05 09:13:23.789208
descriptionSimple library to easily communicate with a tp link smart device.
homepage
repositoryhttps://github.com/cshjsc/tplink-shome-protocol
max_upload_size
id764595
size4,687
(cshjsc)

documentation

README

TP Link home protocol for rust

Simple library to easily communicate with a tp link smart device.

Made possible by this article.

Usage

use std::io;
use std::net::TcpStream;

use tplink_shome_protocol::{receive_message, send_message};

fn main() -> io::Result<()> {
    let stream = TcpStream::connect("192.168.1.1:9999")?;
    let raw = r#"{"system":{"get_sysinfo":{}}}"#;
    send_message(&stream, raw)?;
    let message = receive_message(&stream)?;
    ...
}
Commit count: 10

cargo fmt