audiomoth-hid-rs

Crates.ioaudiomoth-hid-rs
lib.rsaudiomoth-hid-rs
version0.1.2
sourcesrc
created_at2022-07-22 15:05:12.499761
updated_at2022-07-22 17:24:18.299784
descriptionaudiomoth-hid-rs
homepage
repositoryhttps://github.com/cxping/audiomoth-hid-rs.git
max_upload_size
id630848
size17,498
chpin (cxping)

documentation

README

audiomot-hid-rs

a rust library for interfacing with AudioMoth devices over USB

OpenAcousticDevices/AudioMoth-HID

Usage

use audiomoth-hid-rs;
fn main(){
    //创建一个设备链接具柄
    let audio = audiomoth_hid_rs::AudioMothDevice::new().unwrap();
    //读取设备当前配置时间
    let device_time  = audio.get_time().unwrap();
    println!("Time:{:?}",device_time);
    //读取设备ID
    let device_id  = audio.get_id().unwrap();
    println!("DeviceId:{:?}",device_id);
    //获取固件版本号
    let firmware_version  = audio.get_firmware_version().unwrap();
    println!("FirmwareVersion:{:?}",firmware_version);
    //获取设备固件说明
    let firmware_description  = audio.get_firmware_description().unwrap();
    println!("FirmwareDescription:{:?}",firmware_description);
    //获取电池情况
    let firmware_battery  = audio.get_battery().unwrap();
    println!("FirmwareBattery:{:?}",firmware_battery);
    //读取固件所有配置信息
    let packet =  audio.get_packet().unwrap();
    println!("Packet:{:?}",packet);
}

Commit count: 8

cargo fmt