Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일

C# - Rapsberry Pi Zero W와 PC 간 Bluetooth 통신 예제 코드

일전에 소개한 Rapsberry Pi Zero W(이하 rpi)는,

윈도우즈 사용자를 위한 라즈베리 파이 제로 W 모델을 설정하는 방법
; https://www.sysnet.pe.kr/2/0/11372

(무선 랜과 함께) 블루투스(Bluetooth 4.1)를 내장하고 있습니다. 그럼 지난번의 실습에 이어,

C# - 32feet.NET을 이용한 PC 간 Bluetooth 통신 예제 코드
; https://www.sysnet.pe.kr/2/0/12004

이번에는 블루투스 서버를 C++로 구현해 rpi에 설치하고 PC에서는 C#으로 만든 블루투스 클라이언트를 만들어 볼까요? ^^




지난 글에도 언급했지만, 블루투스 통신을 하려면 그전에 반드시 pairing을 해야 합니다. rpi의 경우 대개는 명령어 모드로 부팅할 것이기 때문에 pairing 과정도 명령어로 진행해야 한다는 점이 약간 수고스럽습니다. 우선 Pairing 신청은 간편하게 윈도우 PC 측에서 하면 좋습니다. 이를 위해 윈도우에서 "Settings" / "Devices" / "Bluetooth & other devices"에서 + 모양의 "Add Bluetooth or other device" 버튼을 누릅니다. 그럼 다음과 같은 화면이 뜨고,

window_bluetooth_add_device_1.png

위의 화면에서 "Bluetooth"를 선택하면 이제 주변 기기 탐색을 시작합니다.

그럼, rpi가 탐색될 수 있도록 SSH 연결을 한 후 sudo 권한으로 bluetoothctl 명령어를 실행합니다.

$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install bluetooth blueman bluez

# bluetoothctl
Agent registered
[bluetooth]#

보는 바와 같이 bluetooth 명령어 처리로 바뀌는데 간단하게 "show" 명령어를 이용해 rpi의 블루투스 환경 설정을 조회할 수 있습니다.

[bluetooth]# show
Controller BF:32:A1:CD:82:EF (public)
        Name: raspberrypi
        Alias: raspberrypi
        Class: 0x00480000
        Powered: yes
        Discoverable: no
        Pairable: yes
        UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v1D6Bp0246d0532
        Discovering: no
BluetoothPolicy.BluetoothUUID
; https://docs.samsungknox.com/devref/knox-sdk/reference/com/samsung/android/knox/bluetooth/BluetoothPolicy.BluetoothUUID.html

Bluetooth Low Energy
; https://www.digi.com/resources/documentation/digidocs/90001547/reference/bsp/r_bluetooth_ble.htm

Headset AG - HSP(Headset Profile)
  Headset Profile (HSP) Acts as an audio gateway alone.

Generic Attribute Profile - GATT(Generic Attribute Profile)
  Used to transfer data between BLE devices.

A/V Remote Control - AVRCP(Audio/Video Remote Control Profile)
  Allows sending command frames to a target.

Generic Access Profile - GAP(Generic Access Profile)
  Controls connections and advertisements between devices.

PnP Information

A/V Remote Control Target - AVRCP(Audio/Video Remote Control Profile)
  Allows receiving command frames and generating response frames.

Audio Source - A2DP(Advanced Audio Distribution Profile)
  Acts as a source of digital audio data and sends the stream to the sink

Handsfree Audio Gateway - HFP(Hands-Free Profile)
  Acts as an audio gateway alone.

출력 결과에 따라 "Discoverable: no"인데, 이걸 true로 바꿔야 윈도우의 블루투스 기기 검색에 나타나게 됩니다. 그래서 다음의 명령어를 내립니다.

[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller BF:32:A1:CD:82:EF Discoverable: yes

[CHG] Device 7C:5C:F8:DB:08:0C Connected: yes
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000111f-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C Modalias: bluetooth:v0006p0001d0A00
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 00001115-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000111f-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: c7f94713-891e-496a-a0e7-983a0946126e
[CHG] Device 7C:5C:F8:DB:08:0C ServicesResolved: yes
[CHG] Device 7C:5C:F8:DB:08:0C Paired: yes
[CHG] Device 7C:5C:F8:DB:08:0C ServicesResolved: no
[CHG] Device 7C:5C:F8:DB:08:0C Connected: no

위의 명령어를 수행하자마자 윈도우 PC 측의 기기 선택 목록에 rpi가 나타나고 이를 선택하면 pairing 과정이 간단하게 완료됩니다.




pairing이 완료되었으면 이제 블루투스 서버 용 프로그램을 만들어 rpi 측에서 실행해야 하는데요. 이를 위해 2개의 빌드 도구를 설치합니다.

# apt install build-essential
# apt install libbluetooth-dev

그런 다음 아래의 글에 공개된 소스 코드를,

BluetoothTest/C BlueZ Server/
; https://github.com/RyanGlScott/BluetoothTest/tree/master/C%20BlueZ%20Server

Raspberry Pi 3 블루투스 페어링 방법(bluetoothctl) 및 C언어 블루투스 서버 예제
; https://webnautes.tistory.com/1137

Visual Studio의 리눅스 프로젝트 템플릿을 이용해,

Visual Studio 2017에서 Raspberry Pi C++ 응용 프로그램 제작
; https://www.sysnet.pe.kr/2/0/11358

작성하면 윈도우 PC에서 디버깅까지 가능한 환경을 제공받으며 편리하게 서버 프로그램을 마무리할 수 있습니다.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
#include <bluetooth/rfcomm.h>
#include <sys/wait.h>
#include <pthread.h>
#include <signal.h>

// https://github.com/RyanGlScott/BluetoothTest/tree/master/C%20BlueZ%20Server
// https://webnautes.tistory.com/1137

void* ThreadMain(void* argument);
bdaddr_t bdaddr_any = { 0, 0, 0, 0, 0, 0 };
bdaddr_t bdaddr_local = { 0, 0, 0, 0xff, 0xff, 0xff };

int _str2uuid(const char* uuid_str, uuid_t* uuid) {
    /* This is from the pybluez stack */

    uint32_t uuid_int[4];
    char* endptr;

    if (strlen(uuid_str) == 36) {
        char buf[9] = { 0 };

        if (uuid_str[8] != '-' && uuid_str[13] != '-' &&
            uuid_str[18] != '-' && uuid_str[23] != '-') {
            return 0;
        }
        // first 8-bytes
        strncpy(buf, uuid_str, 8);
        uuid_int[0] = htonl(strtoul(buf, &endptr, 16));
        if (endptr != buf + 8) return 0;
        // second 8-bytes
        strncpy(buf, uuid_str + 9, 4);
        strncpy(buf + 4, uuid_str + 14, 4);
        uuid_int[1] = htonl(strtoul(buf, &endptr, 16));
        if (endptr != buf + 8) return 0;

        // third 8-bytes
        strncpy(buf, uuid_str + 19, 4);
        strncpy(buf + 4, uuid_str + 24, 4);
        uuid_int[2] = htonl(strtoul(buf, &endptr, 16));
        if (endptr != buf + 8) return 0;

        // fourth 8-bytes
        strncpy(buf, uuid_str + 28, 8);
        uuid_int[3] = htonl(strtoul(buf, &endptr, 16));
        if (endptr != buf + 8) return 0;

        if (uuid != NULL) sdp_uuid128_create(uuid, uuid_int);
    }
    else if (strlen(uuid_str) == 8) {
        // 32-bit reserved UUID
        uint32_t i = strtoul(uuid_str, &endptr, 16);
        if (endptr != uuid_str + 8) return 0;
        if (uuid != NULL) sdp_uuid32_create(uuid, i);
    }
    else if (strlen(uuid_str) == 4) {
        // 16-bit reserved UUID
        int i = strtol(uuid_str, &endptr, 16);
        if (endptr != uuid_str + 4) return 0;
        if (uuid != NULL) sdp_uuid16_create(uuid, (uint16_t)i);
    }
    else {
        return 0;
    }

    return 1;
}

sdp_session_t* register_service(uint8_t rfcomm_channel) {

    const char* service_name = "Armatus Bluetooth server";
    const char* svc_dsc = "A HERMIT server that interfaces with the Armatus Android app";
    const char* service_prov = "Armatus";

    uuid_t root_uuid, l2cap_uuid, rfcomm_uuid, svc_uuid;

    sdp_list_t* l2cap_list = 0;
    sdp_list_t* rfcomm_list = 0;
    sdp_list_t* root_list = 0;
    sdp_list_t* proto_list = 0;
    sdp_list_t* access_proto_list = 0;

    sdp_data_t* channel = 0;
    sdp_record_t record = { 0 };
    sdp_session_t* session = 0;

    _str2uuid("00000004-0000-1000-8000-00805F9B34FB", &svc_uuid);
    sdp_set_service_id(&record, svc_uuid);

    char str[256] = "";
    sdp_uuid2strn(&svc_uuid, str, 256);
    printf("Registering UUID %s\n", str);

    // make the service record publicly browsable
    sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
    root_list = sdp_list_append(0, &root_uuid);
    sdp_set_browse_groups(&record, root_list);

    // set l2cap information
    sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
    l2cap_list = sdp_list_append(0, &l2cap_uuid);
    proto_list = sdp_list_append(0, l2cap_list);

    // register the RFCOMM channel for RFCOMM sockets
    sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID);
    channel = sdp_data_alloc(SDP_UINT8, &rfcomm_channel);
    rfcomm_list = sdp_list_append(0, &rfcomm_uuid);
    sdp_list_append(rfcomm_list, channel);
    sdp_list_append(proto_list, rfcomm_list);

    access_proto_list = sdp_list_append(0, proto_list);
    sdp_set_access_protos(&record, access_proto_list);

    // set the name, provider, and description
    sdp_set_info_attr(&record, service_name, service_prov, svc_dsc);

    // connect to the local SDP server, register the service record,
    // and disconnect
    session = sdp_connect(&bdaddr_any, &bdaddr_local, SDP_RETRY_IF_BUSY);
    sdp_record_register(session, &record, 0);

    // cleanup
    sdp_data_free(channel);
    sdp_list_free(l2cap_list, 0);
    sdp_list_free(rfcomm_list, 0);
    sdp_list_free(root_list, 0);
    sdp_list_free(access_proto_list, 0);

    return session;
}

int read_int32(int client) 
{
    char buf[4] = { 0 };
    int bytes_read = read(client, buf, 4);

    if (bytes_read == 4) 
    {
        int length = *(int*)buf;
        printf("received-int32 [%d]\n", length);
        return length;
    }
     
    return 0;
}

int write_int32(int client, int value)
{
    char* buf = (char*)& value;
    int written = write(client, buf, 4);

    if (written == 4)
    {
        printf("written-int32 [%d]\n", 4);
        return 4;
    }

    return 0;
}

char *read_string(int client) 
{
    int len = read_int32(client);
    if (len == 0)
    {
        return nullptr;
    }
    
    char* buf = new char[len + 1];
    memset(buf, 0, sizeof(len + 1));

    int totalRead = 0;

    while (true)
    {
        int bytes_read = read(client, buf + totalRead, len * sizeof(buf[0]));
        if (bytes_read == len) 
        {
            printf("received [%s]\n", buf);
            return buf;
        }
        else if (bytes_read == 0)
        {
            delete[] buf;
            return nullptr;
        }

        len -= bytes_read;
        totalRead += bytes_read;
    }
}

int write_string(int client, char *buf, int bufLen)
{
    int written = write_int32(client, bufLen);
    if (written == 0)
    {
        return 0;
    }

    int totalWrite = 0;

    while (true)
    {
        int bytes_write = write(client, buf + totalWrite, bufLen * sizeof(buf[0]));
        if (bytes_write == bufLen)
        {
            printf("sent [%s]\n", buf);
            return totalWrite;
        }
        else if (bytes_write == 0)
        {
            delete[] buf;
            return 0;
        }

        bufLen -= bytes_write;
        totalWrite += bytes_write;
    }
}

int main()
{
    pthread_t thread_id;

    signal(SIGPIPE, SIG_IGN);

    int port = 3, result, sock, client;
    struct sockaddr_rc loc_addr = { 0 }, rem_addr = { 0 };
    char buffer[1024] = { 0 };
    socklen_t opt = sizeof(rem_addr);

    // local bluetooth adapter
    loc_addr.rc_family = AF_BLUETOOTH;
    loc_addr.rc_bdaddr = bdaddr_any;
    loc_addr.rc_channel = (uint8_t)port;

    // register service
    sdp_session_t* session = register_service((uint8_t)port);
    if (session == nullptr)
    {
        printf("SDP Service registration failed\n");
        return 1;
    }

    // allocate socket
    sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
    printf("socket() returned %d\n", sock);

    // bind socket to port 3 of the first available
    result = bind(sock, (struct sockaddr*) & loc_addr, sizeof(loc_addr));
    printf("bind() on channel %d returned %d\n", port, result);

    // put socket into listening mode
    result = listen(sock, 1);
    printf("listen() returned %d\n", result);

    while (1)
    {
        // accept one connection
        printf("calling accept()\n");
        client = accept(sock, (struct sockaddr*) & rem_addr, &opt);
        printf("accept() returned %d\n", client);

        ba2str(&rem_addr.rc_bdaddr, buffer);
        fprintf(stderr, "accepted connection from %s\n", buffer);
        memset(buffer, 0, sizeof(buffer));

        pthread_create(&thread_id, NULL, ThreadMain, (void*)client);
    }
}

void* ThreadMain(void* argument)
{
    pthread_detach(pthread_self());
    int client = (int)argument;

    while (true)
    {
        char* recv_message = read_string(client);
        if (recv_message == nullptr) {
            printf("client disconnected\n");
            break;
        }

        printf("%s\n", recv_message);

        write_string(client, recv_message, strlen(recv_message));

        delete[] recv_message;
    }

    printf("disconnected\n");
    close(client);

    return 0;
}

참고로 원래 소스 코드는 Serial Port 통신이 가능하도록 되어 있지만 저는 지난 글에서처럼 Socket 프로그래밍 처리를 위해 TCP_PROTOCOL_UUID 서비스를 등록하도록 바꿨습니다.

(서버 프로젝트는 DotNetSamples/Cpp/rpi/btserver github에 올려져 있습니다.)




아마도, 빌드가 완료된 (제 경우에 btserver.out) 실행 파일을 구동 시 다음과 같은 Segmentation fault 오류가 발생할 것입니다.

$ ./projects/btserver/bin/ARM/Debug/btserver.out
Registering UUID 00001101-0000-1000-8000-00805f9b34fb
Segmentation fault (또는, github 소스의 경우 "SDP Service registration failed")

문제가 되는 코드는 sdp_connect인데,

session = sdp_connect(&bdaddr_any, &bdaddr_local, SDP_RETRY_IF_BUSY);
sdp_record_register(session, &record, 0);

그 함수의 반환 값이 null인 경우 sdp_record_register가 nullptr 값을 사용하면서 segfault가 발생하는 것입니다. 이를 해결하려면 bluetoothd 데몬 실행 시 "--compat" 인자를 추가해야 하는데, "/etc/systemd/system/bluetooth.target.wants/bluetooth.service" 또는 "/etc/systemd/system/dbus-org.bluez.service" 파일을 편집기에서 열어 ExecStart 행을 다음과 같이 변경해 저장합니다.

ExecStart=/usr/lib/bluetooth/bluetoothd --compat

변경 사항을 반영하기 위해 서비스를 재시작합니다.

# systemctl daemon-reload
# systemctl restart bluetooth.service

하지만 그래도 여전히 Segmentation fault 오류가 발생할 텐데, 그 이유는 sdp_connect 함수가 bluetoothd 데몬과 통신 시 /var/run/sdp 유닉스 소켓을 사용하는데 이에 대한 권한이 없기 때문입니다.

# ls /var/run/sdp -l
srw-rw---- 1 root root 0 Aug 13 00:04 /var/run/sdp

결국 예전에 겪었던 그 현상입니다. ^^

C# - .NET Core Unix Domain Socket 사용 예제
; https://www.sysnet.pe.kr/2/0/11963

따라서 해당 유닉스 소켓에 대한 권한을 다음과 같이 조정해야 합니다.

# chmod 766 /var/run/sdp
# ls /var/run/sdp -l
srwxrw-rw- 1 root root 0 Aug 13 00:04 /var/run/sdp

그런데, 여기서 끝이 아닙니다. 또 하나의 문제는, bluetoothd가 /var/run/sdp 유닉스 소켓을 여는 것이기 때문에 해당 서비스가 재시작되면 언제나 "srw-rw----" 권한으로 초기화된다는 점입니다. "Raspberry Pi 3 블루투스 페어링 방법(bluetoothctl) 및 C언어 블루투스 서버 예제" 글에 보면, 부팅하는 시점에 적용하도록 .bashrc에 해당 명령어를 넣어 놓으면 된다고 하지만, 경우에 따라 systemctl restart를 하거나 bluetoothd 데몬이 비정상 종료해 다시 시작하는 경우라면 수작업으로 chmod 명령어를 수행해야 합니다.

그런 면을 고려했을 때, 개인적으로는 .bashrc보다는 service 파일에 직접 Post 작업으로 등록하는 것을 더 권장합니다.

ExecStart=/usr/lib/bluetooth/bluetoothd --compat
ExecStartPost=chmod 766 /var/run/sdp




준비는 모두 끝났습니다. 윈도우의 블루투스 클라이언트는 DeviceName 판정만 바꾼 지난번 예제 코드를 그대로 사용해,

private static void bluetoothComponent_DiscoverDevicesProgress(object sender, DiscoverDevicesEventArgs e)
{
    foreach (var item in e.Devices)
    {
        if (item.DeviceName != "raspberrypi")
        {
            continue;
        }

        Guid serviceUUID = BluetoothService.TcpProtocol; // new Guid("00000004-0000-1000-8000-00805F9B34FB");

        BluetoothClient bluetoothClient = new BluetoothClient();
        bluetoothClient.Connect(item.DeviceAddress, serviceUUID);

        Console.WriteLine("Connected");
        bluetoothClient.Client.WriteString("Hello");
        string result = bluetoothClient.Client.ReadString();
        Console.WriteLine(result);

        bluetoothClient.Close();
        Console.WriteLine("Closed");
    }
}

접속하면 정상적으로 소켓 통신이 되는 것을 확인할 수 있습니다.

(첨부 파일은 블루투스 C# 클라이언트 / C++ 서버 프로젝트를 함께 담고 있습니다. - github 예제의 경우 프로젝트가 분리되어 올라가 있어 혼동이 될 수 있으므로.)




참고로, raspberry pi에서의 기타 bluetooth 명령어는 help 명령어로 더 자세하게 볼 수 있습니다.

[bluetooth]# help
Menu main:
Available commands:
-------------------
advertise                                         Advertise Options Submenu
scan                                              Scan Options Submenu
gatt                                              Generic Attribute Submenu
list                                              List available controllers
show [ctrl]                                       Controller information
select <ctrl>                                     Select default controller
devices                                           List available devices
paired-devices                                    List paired devices
system-alias <name>                               Set controller alias
reset-alias                                       Reset controller alias
power <on/off>                                    Set controller power
pairable <on/off>                                 Set controller pairable mode
discoverable <on/off>                             Set controller discoverable mode
agent <on/off/capability>                         Enable/disable agent with given capability
default-agent                                     Set agent as the default one
advertise <on/off/type>                           Enable/disable advertising with given type
set-alias <alias>                                 Set device alias
scan <on/off>                                     Scan for devices
info [dev]                                        Device information
pair [dev]                                        Pair with device
trust [dev]                                       Trust device
untrust [dev]                                     Untrust device
block [dev]                                       Block device
unblock [dev]                                     Unblock device
remove <dev>                                      Remove device
connect <dev>                                     Connect device
disconnect [dev]                                  Disconnect device
menu <name>                                       Select submenu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
export                                            Print evironment variables




기타, 컴파일 시 다음과 같은 오류가 발생한다면,

btserver.c:8:10: fatal error: bluetooth/bluetooth.h: No such file or directory
 #include <bluetooth/bluetooth.h>
          ^~~~~~~~~~~~~~~~~~~~~~~

libbluetooth-dev를 설치하면 해결됩니다.

# apt install libbluetooth-dev




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 5/4/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13475정성태12/7/20232279닷넷: 2180. .NET 8 - 함수 포인터에 대한 Reflection 정보 조회파일 다운로드1
13474정성태12/6/20232134개발 환경 구성: 690. 닷넷 코어/5+ 버전의 ilasm/ildasm 실행 파일 구하는 방법 - 두 번째 이야기
13473정성태12/5/20232326닷넷: 2179. C# - 값 형식(Blittable)을 메모리 복사를 이용해 바이트 배열로 직렬화/역직렬화파일 다운로드1
13472정성태12/4/20232155C/C++: 164. Visual C++ - InterlockedCompareExchange128 사용 방법
13471정성태12/4/20232183Copilot - To enable GitHub Copilot, authorize this extension using GitHub's device flow
13470정성태12/2/20232485닷넷: 2178. C# - .NET 8부터 COM Interop에 대한 자동 소스 코드 생성 도입파일 다운로드1
13469정성태12/1/20232193닷넷: 2177. C# - (Interop DLL 없이) CoClass를 이용한 COM 개체 생성 방법파일 다운로드1
13468정성태12/1/20232190닷넷: 2176. C# - .NET Core/5+부터 달라진 RCW(Runtime Callable Wrapper) 대응 방식파일 다운로드1
13467정성태11/30/20232199오류 유형: 882. C# - Unhandled exception. System.Runtime.InteropServices.COMException (0x800080A5)파일 다운로드1
13466정성태11/29/20232393닷넷: 2175. C# - DllImport 메서드의 AOT 지원을 위한 LibraryImport 옵션
13465정성태11/28/20232152개발 환경 구성: 689. MSBuild - CopyToOutputDirectory가 "dotnet publish" 시에는 적용되지 않는 문제파일 다운로드1
13464정성태11/28/20232271닷넷: 2174. C# - .NET 7부터 UnmanagedCallersOnly 함수 export 기능을 AOT 빌드에 통합파일 다운로드1
13463정성태11/27/20232216오류 유형: 881. Visual Studio - NU1605: Warning As Error: Detected package downgrade
13462정성태11/27/20232251오류 유형: 880. Visual Studio - error CS0246: The type or namespace name '...' could not be found
13461정성태11/26/20232270닷넷: 2173. .NET Core 3/5+ 기반의 COM Server를 registry 등록 없이 사용하는 방법파일 다운로드1
13460정성태11/26/20232225닷넷: 2172. .NET 6+ 기반의 COM Server 내에 Type Library를 내장하는 방법파일 다운로드1
13459정성태11/26/20232207닷넷: 2171. .NET Core 3/5+ 기반의 COM Server를 기존의 regasm처럼 등록하는 방법파일 다운로드1
13458정성태11/26/20232212닷넷: 2170. .NET Core/5+ 기반의 COM Server를 tlb 파일을 생성하는 방법(tlbexp)
13457정성태11/25/20232164VS.NET IDE: 187. Visual Studio - 16.9 버전부터 추가된 "Display inline type hints" 옵션
13456정성태11/25/20232461닷넷: 2169. C# - OpenAI를 사용해 PDF 데이터를 대상으로 OpenAI 챗봇 작성 [1]파일 다운로드1
13455정성태11/25/20232339닷넷: 2168. C# - Azure.AI.OpenAI 패키지로 OpenAI 사용파일 다운로드1
13454정성태11/23/20232683닷넷: 2167. C# - Qdrant Vector DB를 이용한 Embedding 벡터 값 보관/조회 (Azure OpenAI) [1]파일 다운로드1
13453정성태11/23/20232218오류 유형: 879. docker desktop 설치 시 "Invalid JSON string. (Exception from HRESULT: 0x83750007)"
13452정성태11/22/20232296닷넷: 2166. C# - Azure OpenAI API를 이용해 사용자가 제공하는 정보를 대상으로 검색하는 방법파일 다운로드1
13451정성태11/21/20232431닷넷: 2165. C# - Azure OpenAI API를 이용해 ChatGPT처럼 동작하는 콘솔 응용 프로그램 제작파일 다운로드1
13450정성태11/21/20232255닷넷: 2164. C# - Octokit을 이용한 GitHub Issue 검색파일 다운로드1
1  2  3  4  5  [6]  7  8  9  10  11  12  13  14  15  ...