Skip to content

0-wiz-0/rust-envsys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>$SENSORNAME</key>
        <array>
                <dict>
                        <key>INTEGER_KEY</key>
                        <integer>12345</integer>
                        <key>STRING_KEY</key>
                        <string>some text</string>
                        <key>BOOLEAN_KEY</key>
                        <true/>
                        ...
               </dict>
               ...         (an arbitrary number of entries like the one above, i.e. "<dict>...</dict>")
                <dict>
                        <key>device-properties</key>
                        <dict>
                                <key>device-class</key>
                                <string>something</string>
                                <key>refresh-timeout</key>
                                <integer>0x1e</integer>
                        </dict>
                </dict>
        </array>
        ... (an arbitrary number of entries like the one above, i.e. "<key>...</key><array>...</array>")
</dict>
</plist>

About

Example code how to use envsys(4) on NetBSD using rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages