KDK_BLUETOOTH_GET_DEV_VERSION(3)

📦 version 3.0.1.4, in arch rolling, ubuntu resolute, ubuntu stonking

💖 KDK_BLUETOOTH_GET_DEV_VERSION(3) 💖

okay bestie, welcome to the Library Functions Manual ✨ this one's the glow-up guide for kdk_bluetooth_get_dev_version — it's giving "let me peek at ur bluetooth device's version real quick" 🦋


🌸 NAME 🌸

kdk_bluetooth_get_dev_version — 获取蓝牙的设备id

(yes the description is in Chinese, no I'm not translating away the vibes, it means "get the bluetooth device id" 🎀)


✨ SYNOPSIS ✨

#include <libkybluetooth.h>

extern char* kdk_bluetooth_get_dev_version(int num);

and like, don't forget to link it, bestie:

Link with -lkybluetooth.

💅 DESCRIPTION 💅

So the main character job of this interface? It obtains the device version of Bluetooth. that's it, that's the gig 👑

The argument num is the number of Bluetooth devices, starting from 0 — 0 represents 1, and so on. so like, zero-indexed, one-indexed-adjacent, classic programmer chaos, iykyk 💀


🫶 RETURN VALUE 🫶

On success, it returns the device Bluetooth version of type char* — and listen, the returned string needs to be released by free 🚨 do not forget, do not pass go, do not leak memory bestie.

On error, it returns NULL.


🌈 EXAMPLES 🌈

here's the whole vibe in action, no cap:

#include "libkybluetooth.h"
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i = 0;
    char *manufacturer = " ";
    char *version = " ";
    char *name = " ";
    char *address = " ";
    char *link_mode  =" ";
    char *link_policy =" ";
    char *scomtu = " ";
    char *alcmtu = " ";
    char *packettype = " ";
    char *features = " ";
    char *bus = " ";
    int **id = kdk_bluetooth_get_device_id();
    do
    {
        printf("id = %d0,id[i]);
        manufacturer = kdk_bluetooth_get_manufacturer(i);
        printf("manufacturer: %s0, manufacturer);
        free(manufacturer);
        version = kdk_bluetooth_get_dev_version(i);
        printf("version: %s0, version);
        free(version);
        name = kdk_bluetooth_get_name(id[i]);
        printf("name: %s0, name);
        address = kdk_bluetooth_get_address(id[i]);
        printf("address: %s0, address);
        link_mode = kdk_bluetooth_get_link_mode(id[i]);
        printf("link_mode: %s0, link_mode);
        link_policy = kdk_bluetooth_get_link_policy(id[i]);
        printf("link_policy: %s0, link_policy);
        scomtu = kdk_bluetooth_get_scomtu(id[i]);
        printf("scomtu: %s0, scomtu);
        alcmtu = kdk_bluetooth_get_alcmtu(id[i]);
        printf("alcmtu: %s0, alcmtu);
        packettype = kdk_bluetooth_get_packettype(id[i]);
        printf("packettype: %s0, packettype);
        features = kdk_bluetooth_get_features(id[i]);
        printf("features: %s0, features);
        bus = kdk_bluetooth_get_bus(id[i]);
        printf("bus: %s0, bus);
        i++;
    }while(id[i]);
    return 0;
}
note bestie: this example is copied exactly as-is from the original page, typos and all. do not "fix" it, that's not our business 💀

🧚 CONFORMING TO 🧚

These functions are as per the withdrawn POSIX.1e draft specification. 📜

The following functions are Linux extensions:

  • kdk_bluetooth_get_device_id()
  • kdk_bluetooth_get_manufacturer()
  • kdk_bluetooth_get_name()
  • kdk_bluetooth_get_address()
  • kdk_bluetooth_get_link_mode()
  • kdk_bluetooth_get_link_policy()
  • kdk_bluetooth_get_bus()
  • kdk_bluetooth_get_scomtu()
  • kdk_bluetooth_get_alcmtu()
  • kdk_bluetooth_get_packettype()
  • kdk_bluetooth_get_features()

👑 SEE ALSO 👑


and that's the whole page, bestie 🎀✨ this lil beauty lives in the Linux Programmer's Manual, dated Fri Aug 25 2023 — go forth, free ur strings, and slay 💅🦋

📦 where this page comes from