3 releases

0.1.2 Jul 22, 2022
0.1.1 Jul 22, 2022
0.1.0 Jul 22, 2022

#1848 in Hardware support

MIT/Apache

18KB
373 lines

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);
}

Dependencies

~1.6–2.8MB
~50K SLoC