Cocos2d-x x iBeacon...

Click here to load reader

download Cocos2d-x x iBeacon Bluetooth‚’½£‚±‚™ƒ¼ƒ ‚’½œ‚†

of 22

  • date post

    27-Aug-2014
  • Category

    Software

  • view

    1.336
  • download

    0

Embed Size (px)

description

【TechBuzz】第4回cocos2d-x勉強会 資料 Cocos2d-x x iBeacon Bluetoothを使ったゲームを作ろう

Transcript of Cocos2d-x x iBeacon...

  • Cocos2d-x x iBeacon ? Bluetooth Tomoo Kaku
  • Tomoo Kaku Cocos2d-x iOS /Android Objective-CC/C++JavaRubyPHP
  • 1. iBeacon 2. iBeacon 3. Cocos2d-x x Bluetooth
  • iBeacon iBeaconApple Bluetooth Low Energy Android4.3OS
  • iBeacon iOSCore Location Framework Multipeer Connectivity Framework BeaconRegion BeaconRanging iOS7.1
  • iBeacon iBeacon(Beacon) P2P
  • Bluetooth Low Energy iPhone 4SiPadNaxus 5 / Nexus 7 iOS7Android 4.3
  • iOS / Android P2P iOSiOS AndroidAndroid Android iOS
  • iBeacon Android4.3 BLE Beacon => P2P BLEAndroid AndroidiOSiOS Cocos2d-x
  • iBeacon iOS AndroidiOS iOSAndroid AndroidP2P AndroidClassic Bluetooth AndroidBLE
  • Cocos2d-xBluetooth P2P iOS iOS Android Android iOS Android
  • Cocos2d-xBluetooth iOSCore LocationCore BluetoothMultipeer Connectivity AndroidClassic Bluetooth Classic BluetoothBLEBluetooth 2.1 3.0 API Level 10Android 2.3.3
  • Cocos2d-xBluetooth iOS: ProximityUUID Android:DeviceName
  • UUID Mac OS X $ uuidgen uuuidgen
  • Cocos2d-x Bluetooth P2P Cocos2d-x Bluetooth P2P Cocos2d-x(iOS/Android) BLEClassic Bluetooth
  • Cocos2d-x Bluetooth P2P JSON Cocos2d-x Bluetooth P2PGithub ()
  • CCBluetooth CCBluetooth.h #define RESULT_NOTFOUND_PEER 0 #define RESULT_RECEIVE_MESSAGE 1 #define STATUS_ERROR -1 #define STATUS_OK 1 class CCBluetoothDelegate { public: virtual void onResult(int resultCode, int status, const char *error, const char *peerID, const char *message) {}; }; class CCBluetooth { public: CCBluetooth(CCBluetoothDelegate* delegate); ~CCBluetooth(); void start(const char *peerID, const char *message); void stop(); private: CCBluetoothDelegate *_delegate; };
  • CCBluetooth Function // void start( const char *peerID, // () const char *message // ); // void stop();
  • CCBluetooth CCBluetoothDelegate void onResult( int resultCode, // int status, // const char *error, // const char *peerID, // ID const char *message // );
  • SampleScene.cpp void SampleScene::onEnter() { cocos2d::CCLayer::onEnter(); bluetooth = new bluetooth_plugin::CCBluetooth(this); bluetooth->start("", ""); } void SampleScene::onExit() { cocos2d::CCLayer::onExit(); bluetooth->stop("", ""); } // CCBluetoothDelegate void SampleScene::onResult( int resultCode, int status, const char *error, const char *peerID, const char *message) { CCLOG(": %s", peerID.c_str()); CCLOG(": %s", message.c_str()); }
  • GitHub GitHub: https://github.com/tomookaku Gist: https://gist.github.com/tomookaku facebook: https://www.facebook.com/tomoo.kaku