Crates.io | audiomoth-hid-rs |
lib.rs | audiomoth-hid-rs |
version | 0.1.2 |
source | src |
created_at | 2022-07-22 15:05:12.499761 |
updated_at | 2022-07-22 17:24:18.299784 |
description | audiomoth-hid-rs |
homepage | |
repository | https://github.com/cxping/audiomoth-hid-rs.git |
max_upload_size | |
id | 630848 |
size | 17,498 |
a rust library for interfacing with AudioMoth devices over USB
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);
}