KDK_BLUETOOTH_GET_SCOMTU(3)

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

💖 kdk_bluetooth_get_scomtu(3) 💖

okay bestie, welcome to the Library Functions Manual — specifically the page for kdk_bluetooth_get_scomtu(3), and no cap this one is a little cutie. Let's get into it 🫶


✨ NAME ✨

  • kdk_bluetooth_get_scomtu — 获取蓝牙的SCO MTU (aka: grab the Bluetooth's SCO MTU, the whole reason we're here 💅)

🌸 SYNOPSIS 🌸

Like, here's the vibe you need to include:

#include <libkybluetooth.h>

extern char* kdk_bluetooth_get_scomtu(int id);

Link with -lkybluetooth.


🦋 Detailed Description 🦋

The main function of the interface is to obtain the SCO MTU of Bluetooth. That's it, that's the job, and it does it iconically ✨

The argument id is the device ID of Bluetooth. You gotta hand it the right one — that's your little ticket in 🎟️


🎀 RETURN VALUE 🎀

  • On success, returns the Bluetooth SCO MTU of type char*. Careful though — the returned string needs to be released by free. Yes queen, you own that memory now, so clean up after yourself 🧹💖
  • On error, return NULL. If you get NULL, that's your sign to go touch grass and check your id 🙈

🌈 EXAMPLES 🌈

Here's a whole little program showing the vibes, copied exactly as it lives in the page (yes, %d0 and %s0 are really in there, I don't make the rules 😭):

#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;
}

Not me spotting that only manufacturer and version get free'd in this example 😭 — the other strings are still out there living their best lives. Anyway, the scomtu line is our main character right there, and that's the whole demo 🫶


👑 CONFORMING TO 👑

These functions are as per the withdrawn POSIX.1e draft specification. Withdrawn, bestie, so clock that.

The following functions are Linux extensions:

  • kdk_bluetooth_get_device_id()
  • kdk_bluetooth_get_manufacturer()
  • 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_alcmtu()
  • kdk_bluetooth_get_packettype()
  • kdk_bluetooth_get_features()

💜 SEE ALSO 💜

Go read these next, they're the rest of the squad 🦋:


💖 that's the whole page, you ate 💖

Source/version vibes: this one comes to you from the Linux Programmer's Manual, dated Fri Aug 25 2023 — so it's giving vintage but still slaying 👑✨ Love that for us. Bye bestie, go free your strings 💅

📦 where this page comes from