Windows SDK 6.1 이상부터 지원함
Socket 으로 BlueTooth 장치를 사용함..
MS의 Bluetooth 관련 reference site
중요 structure와 function 사용법이 나와 있음...
Bluetooth를 검색해서 간단한 정보를 표시해 주는 예제
- #include <windows.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <winsock2.h>
- #include <bthdef.h>
- #include <BluetoothAPIs.h>
- #pragma comment(lib, "Irprops.lib")
- BLUETOOTH_FIND_RADIO_PARAMS m_bt_find_radio = {
- sizeof(BLUETOOTH_FIND_RADIO_PARAMS)
- };
- BLUETOOTH_RADIO_INFO m_bt_info = {
- sizeof(BLUETOOTH_RADIO_INFO),
- 0,
- };
- BLUETOOTH_DEVICE_SEARCH_PARAMS m_search_params = {
- sizeof(BLUETOOTH_DEVICE_SEARCH_PARAMS),
- 1,
- 0,
- 1,
- 1,
- 1,
- 15,
- NULL
- };
- BLUETOOTH_DEVICE_INFO m_device_info = {
- sizeof(BLUETOOTH_DEVICE_INFO),
- 0,
- };
- HANDLE m_radio = NULL;
- HBLUETOOTH_RADIO_FIND m_bt = NULL;
- HBLUETOOTH_DEVICE_FIND m_bt_dev = NULL;
- int DiscoveryBlueToothDevices(CString &BTMac, BOOL &isBTSuccess)
- {
- while(true) {
- m_bt = BluetoothFindFirstRadio(&m_bt_find_radio, &m_radio);
- int m_radio_id = 0;
- do {
- m_radio_id++;
- BluetoothGetRadioInfo(m_radio, &m_bt_info);
- dprintf(L"Radio %d:\r\n", m_radio_id);
- dprintf(L"\tName: %s\r\n", m_bt_info.szName);
- dprintf(L"\tAddress: %02x:%02x:%02x:%02x:%02x:%02x\r\n", m_bt_info.address.rgBytes[1], m_bt_info.address.rgBytes[0], m_bt_info.address.rgBytes[2], m_bt_info.address.rgBytes[3], m_bt_info.address.rgBytes[4], m_bt_info.address.rgBytes[5]);
- dprintf(L"\tClass: 0x%08x\r\n", m_bt_info.ulClassofDevice);
- dprintf(L"\tManufacturer: 0x%04x\r\n", m_bt_info.manufacturer);
- m_search_params.hRadio = m_radio;
- ::ZeroMemory(&m_device_info, sizeof(BLUETOOTH_DEVICE_INFO));
- m_device_info.dwSize = sizeof(BLUETOOTH_DEVICE_INFO);
- m_bt_dev = BluetoothFindFirstDevice(&m_search_params, &m_device_info);
- int m_device_id = 0;
- do {
- m_device_id++;
- dprintf(L"\tDevice %d:\r\n", m_device_id);
- dprintf(L"\t\tName: %s\r\n", m_device_info.szName);
- dprintf(L"\t\tAddress: %02x:%02x:%02x:%02x:%02x:%02x\r\n", m_device_info.Address.rgBytes[1], m_device_info.Address.rgBytes[0], m_device_info.Address.rgBytes[2], m_device_info.Address.rgBytes[3], m_device_info.Address.rgBytes[4], m_device_info.Address.rgBytes[5]);
- dprintf(L"\t\tClass: 0x%08x\r\n", m_device_info.ulClassofDevice);
- dprintf(L"\t\tConnected: %s\r\n", m_device_info.fConnected ? L"true" : L"false");
- dprintf(L"\t\tAuthenticated: %s\r\n", m_device_info.fAuthenticated ? L"true" : L"false");
- dprintf(L"\t\tRemembered: %s\r\n", m_device_info.fRemembered ? L"true" : L"false");
- if ( wcslen(m_device_info.szName) > 0 )
- {
- isBTSuccess = true;
- break;
- }
- } while(BluetoothFindNextDevice(m_bt_dev, &m_device_info));
- BluetoothFindDeviceClose(m_bt_dev);
- } while(BluetoothFindNextRadio(&m_bt_find_radio, &m_radio));
- BluetoothFindRadioClose(m_bt);
- Sleep(10000);
- break;
- }
- return 0;
- }
또 다른 예제...
덧글
http://v2effects.com/ , , http://c2effects.com/ , , http://v2forsale.com/ , , http://c2forsale.com/ , ,
http://v2cheaponline.com/ , , http://c2cheaponline.com/ , , http://via2india.com/ , , http://cia2india.com/ , ,
http://via1buycheap.com/ , , http://pills1cia.com/ , , http://cheap1v.com/ , , http://via1sideffects.com/ , , http://cia1sideffects.com/ , ,
http://indian1vonline.com/ , , http://purchase1c.com/ , , http://v1fastdelivery.com/ , , http://v4sale12.com/ , , http://onlinepharmacy12cia.com/ , ,
http://via1buycheap.com/ , , http://v1buyonline.com/ , , http://sale1genericv.com/ , , http://www.order12via.com/ , , http://fastdelivery10v.com/ , ,
http://via1buycheap.com/ , , http://v1buyonline.com/ , , http://sale1genericv.com/ , , http://www.order12via.com/ , , http://fastdelivery10v.com/ , ,
http://v2puronline.com/ , , http://c2puronline.com/purchase , , , , hhttp://fastdelivery2vv.com/ , ,
http://discount11cia.com/ , , http://purchase11online.com/ , , http://v11fastdelivery.com/ , , http://10ciaonline.com/ , , http://order8v.com/ , ,
http://c1forsale.com/ , , http://v1buyonline.com/ , , http://sideffects1c.com/ , , http://www.sideffects1v.com/ , , http://indian1vonline.com/ , ,
http://via3professional.com/ , , http://cia3superactive.com/ , , http://v33canada.com/ , , http://c33canada.com/ , ,
http://via3cosr.com/ , , http://cia3cost.com/ , , http://via3sapmles.com/ , , http://cia3sapmles.com/ , ,
http://cia3cost.com/ , , http://via3sapmles.com/ , , http://cia3sapmles.com/ , , http://via3cosr.com/ , ,
http://purchase1c.com/ , , http://onlinepharmacy12cia.com/ , , http://indian10via.com/ , , http://10ciaonline.com/ , , http://v1onlinepharm.com/ , ,
http://order3onlinev.com/ , , http://order3onlinec.com/ , ,
http://online3via.com/ , , http://online3cia.com/ , , http://withoutprescriptinv3ind.com/ , , http://withoutprescriptinc3ind.com/ , ,
http://sideffects1c.com/ , , http://c12superactive.com/ , , http://v12sale.com/ , , http://c9indian.com/ , , http://v2indian.com/ , ,
http://buyvia2.com/ , , http://via2pills.com/ , , http://v2cheaponline.com/ , , http://onlinevia2.com/ , , http://via3pills.com/ , ,
http://c4sale12.com/ , , http://noscript12c.com/ , , http://indian10via.com/ , , http://www.orderv2o.com/ , , http://www.cheap1c.com/ , ,
http://www.sideffects1v.com/ , , http://generic1vsale.com/ , , http://sale1genericv.com/ , , http://cia2online.com/ , , http://clia2online.com/ , ,
http://viaprofessional.us/ , , http://ciasuperactive4.us/ , , http://quickpayday44.us/ , , http://viadiscount4.life/ , , http://discountcia4.store/ , ,
http://ciasuperactive4.us/ , , http://quickpayday44.us/ , , http://viadiscount4.life/ , , http://discountcia4.store/ , , http://viaprofessional.us/ , ,
http://cialischeapgeneric.com/ , ,
http://www.cialisonline100.com/ , ,
http://buycialisfxz.com/ , ,
http://soloadvance.com/ , , http://paydayfastnowz.com/ , , http://fastloansolo.com/ , , http://nofaxpaydaynpz.com/ , ,
http://cialisubz.com/ , , http://cialisjqp.com/ , , http://cialisqpa.com/ , , http://cialisuperfd.com/ , , http://cialistas.com/ , ,
http://cialisubz.com/ , , http://cialisbva.com/ , , http://cialisuyb.com/ , , http://loansoloie.com/ , , http://cialisrxss.com/ , ,