项目作者: 0-wiz-0

项目描述 :
Example code how to use envsys(4) on NetBSD using rust
高级语言: Rust
项目地址: git://github.com/0-wiz-0/rust-envsys.git
创建时间: 2021-06-27T13:02:56Z
项目社区:https://github.com/0-wiz-0/rust-envsys

开源协议:Creative Commons Zero v1.0 Universal

下载


This is example code how to get environmental sensor data on NetBSD
using the envsys(4) framework.

Examples of the output of this program are in the examples
directory.

If you want to deserialize the data yourself, the NetBSD kernel
returns a plist in XML format (including a terminating zero byte,
since it’s a C string). The format looks like this:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3. <plist version="1.0">
  4. <dict>
  5. <key>$SENSORNAME</key>
  6. <array>
  7. <dict>
  8. <key>INTEGER_KEY</key>
  9. <integer>12345</integer>
  10. <key>STRING_KEY</key>
  11. <string>some text</string>
  12. <key>BOOLEAN_KEY</key>
  13. <true></true>
  14. ...
  15. </dict>
  16. ... (an arbitrary number of entries like the one above, i.e. "<dict>...</dict>")
  17. <dict>
  18. <key>device-properties</key>
  19. <dict>
  20. <key>device-class</key>
  21. <string>something</string>
  22. <key>refresh-timeout</key>
  23. <integer>0x1e</integer>
  24. </dict>
  25. </dict>
  26. </array>
  27. ... (an arbitrary number of entries like the one above, i.e. "<key>...</key><array>...</array>")
  28. </dict>
  29. </plist>