Skip to content

Latest commit

 

History

History
45 lines (36 loc) · 1.22 KB

README.md

File metadata and controls

45 lines (36 loc) · 1.22 KB

libknotdeviceinfo

Library, that fetch device info. Supports: Linux, macOS, Windows

For Android see knotandroidinfo

Example

#include <knot/deviceinfo.h>
#include <stdio.h>

int main(void) {
    KNDeviceInfo deviceInfo;
    KNDeviceInfoFetch(&deviceInfo);
    printf("Device Info:\n");
    if (deviceInfo.uuid) {
        printf("- UUID: %s\n", deviceInfo.uuid);
    }
    if (deviceInfo.name) {
        printf("- Name: %s\n", deviceInfo.name);
    }
    if (deviceInfo.model) {
        printf("- Model: %s\n", deviceInfo.model);
    }
    if (deviceInfo.platform) {
        printf("- Platform: %s\n", deviceInfo.platform);
    }
    if (deviceInfo.system_name) {
        printf("- System Name: %s\n", deviceInfo.system_name);
    }
    if (deviceInfo.system_version) {
        printf("- System Version: %s\n", deviceInfo.system_version);
    }
    KNDeviceInfoFree(&deviceInfo);
}

License

The source code is published under MIT License, the license is available here.

Authors