KDK_BLUETO...NUFACTURER(3)

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

💖 KDK_BLUETO...NUFACTURER 💖

okay bestie, welcome to page 3 of the Library Functions Manual — we're hanging out with kdk_bluetooth_get_manufacturer, and honestly? she's a lil icon. let's get into it 🦋


✨ NAME ✨

kdk_bluetooth_get_manufacturer — 获取蓝牙的设备id

(yeah that's the original description, it's in Chinese, we're keeping it verbatim because we respect the source material 💅)


✨ SYNOPSIS ✨

#include <libkybluetooth.h>

extern char* kdk_bluetooth_get_manufacturer(int num);

and don't forget to link her up:

Link with -lkybluetooth.

🌸 Detailed Description 🌸

so the whole main character job of this interface is getting the manufacturer of Bluetooth. that's it, that's the gig. 💖

the argument num is the number of Bluetooth devices — it starts from 0, and 0 represents 1, and so on. (yes bestie, zero-indexed, we love to see it 🙈)


💜 RETURN VALUE 💜

  • on success — she returns the Bluetooth manufacturer, of type char*. and listen: the returned string needs to be released by free. do NOT forget that. free your girl or she leaks. 😭
  • on error — returns NULL.

🎀 EXAMPLES 🎀

here's the full little demo, copied exactly because code is sacred:

#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;
}
ngl that loop is giving "not me writing this at 3am" energy, but it's the example, we ship it as-is 🫶

🧚 CONFORMING TO 🧚

these functions are as per the withdrawn POSIX.1e draft specification. (withdrawn!! she's vintage, she's archival, she's a museum piece 👑)

the following functions are Linux extensions:

  • kdk_bluetooth_get_device_id()
  • kdk_bluetooth_get_dev_version()
  • 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 🌈

go read her friends too, they're all slaying in section 3:


and that's the whole page bestie!! 💖 this one came from the Linux Programmer's Manual, dated Fri Aug 25 2023 — so like, it's giving slightly vintage but still absolutely iconic. go free your strings, hydrate, and stan kdk_bluetooth_get_manufacturer. mwah 🎀✨💅

📦 where this page comes from