2015-04-18 21:46:51 +00:00
|
|
|
|
2015-04-21 04:02:43 +00:00
|
|
|
#include <CoreFoundation/CoreFoundation.h>
|
2015-04-18 21:46:51 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <boo.hpp>
|
|
|
|
|
2015-04-22 21:48:23 +00:00
|
|
|
class CTestDeviceFinder : public CDeviceFinder
|
|
|
|
{
|
|
|
|
CDolphinSmashAdapter* smashAdapter = NULL;
|
|
|
|
public:
|
|
|
|
CTestDeviceFinder()
|
|
|
|
: CDeviceFinder(DEV_DOL_SMASH_ADAPTER)
|
|
|
|
{}
|
|
|
|
void deviceConnected(CDeviceToken& tok)
|
|
|
|
{
|
|
|
|
printf("CONNECTED %s %s\n", tok.getVendorName().c_str(), tok.getProductName().c_str());
|
|
|
|
smashAdapter = dynamic_cast<CDolphinSmashAdapter*>(tok.openAndGetDevice());
|
|
|
|
}
|
|
|
|
void deviceDisconnected(CDeviceToken& tok)
|
|
|
|
{
|
|
|
|
printf("DISCONNECTED %s %s\n", tok.getVendorName().c_str(), tok.getProductName().c_str());
|
|
|
|
delete smashAdapter;
|
|
|
|
smashAdapter = NULL;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-04-18 21:46:51 +00:00
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2015-04-22 21:48:23 +00:00
|
|
|
CTestDeviceFinder finder;
|
|
|
|
finder.startScanning();
|
2015-04-21 04:02:43 +00:00
|
|
|
|
2015-04-19 00:09:24 +00:00
|
|
|
IGraphicsContext* ctx = new CGraphicsContext;
|
2015-04-18 23:12:22 +00:00
|
|
|
|
|
|
|
if (ctx->create())
|
|
|
|
{
|
|
|
|
}
|
2015-04-21 04:02:43 +00:00
|
|
|
|
|
|
|
CFRunLoopRun();
|
2015-04-18 23:12:22 +00:00
|
|
|
|
|
|
|
delete ctx;
|
2015-04-18 21:46:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|