diff --git a/src/kits/bluetooth/DiscoveryListener.cpp b/src/kits/bluetooth/DiscoveryListener.cpp new file mode 100644 index 0000000000..87a7c26d52 --- /dev/null +++ b/src/kits/bluetooth/DiscoveryListener.cpp @@ -0,0 +1,88 @@ +/* + * Copyright 2007 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com + * + * All rights reserved. Distributed under the terms of the MIT License. + * + */ + +#include +#include +#include + +#include + +namespace Bluetooth { + + +/* Move to some private header */ +#define B_BT_INQUIRY_COMPLETED_MSG 'IqCM' +#define B_BT_INQUIRY_TERMINATED_MSG 'IqTR' +#define B_BT_INQUIRY_ERROR_MSG 'IqER' +#define B_BT_INQUIRY_DEVICE_MSG 'IqDE' + +/* hooks */ + +void +DiscoveryListener::DeviceDiscovered(RemoteDevice btDevice, DeviceClass cod) +{ + + +} + + +void +DiscoveryListener::InquiryCompleted(int discType) +{ + +} + + +/* private */ + +DiscoveryListener::DiscoveryListener() +{ + +} + +void +DiscoveryListener::MessageReceived(BMessage* message) +{ + switch (message->what) + { + case B_BT_INQUIRY_DEVICE_MSG: + + /* TODO: Extract info from BMessage to create a + proper RemoteDevice, żżżmessage should be passed from Agent??? */ + + /* - Instance to be stored/Registered in the Agent? */ + //DeviceDiscovered( RemoteDevice(BString("00:00:00:00:00:00")), DeviceClass(0)); + + break; + + case B_BT_INQUIRY_COMPLETED_MSG: + + InquiryCompleted(B_BT_INQUIRY_COMPLETED); + + break; + case B_BT_INQUIRY_TERMINATED_MSG: + + InquiryCompleted(B_BT_INQUIRY_TERMINATED); + + break; + case B_BT_INQUIRY_ERROR_MSG: + + InquiryCompleted(B_BT_INQUIRY_ERROR); + + break; + + default: + + BLooper::MessageReceived(message); + + break; + + } + +} + +} diff --git a/src/kits/bluetooth/Jamfile b/src/kits/bluetooth/Jamfile index bad908d4cc..45cbed51da 100644 --- a/src/kits/bluetooth/Jamfile +++ b/src/kits/bluetooth/Jamfile @@ -2,5 +2,6 @@ SubDir HAIKU_TOP src kits bluetooth ; SharedLibrary libbluetooth.so : LocalDevice.cpp + DiscoveryListener.cpp : be ;