/// <summary> /// 認証処理実行(Delegate登録も実行) /// </summary> private void OnClickAppAuthorizedBtn() { MEMEBehaviour.StartSession(appClientId, appClientSecret, OnMemeAppAuthorized); MEMEBehaviour.SetMemeRealTimeModeDataReceivedDelegate(OnMemeRealTimeModeDataReceived); MEMEBehaviour.SetMemeCommandResponseDelegate(OnMemeCommandResponse); MEMEBehaviour.SetMemeFirmwareAuthorizedDelegate(OnMemeFirmwareAuthorized); isInit = true; }
void Update() { if (isInit == false) { statusText.text = ""; return; } statusText.text = MEMEBehaviour.IsConnected() ? "接続済み" : "未接続"; if (MEMEBehaviour.IsConnected()) { statusText.text += string.Format("\nデータ受信:{0}", MEMEBehaviour.IsDataReceivingPlugin() ? "可能" : "不可能"); statusText.text += string.Format("\nSDK Version:{0}", MEMEBehaviour.GetSDKVersionPlugin()); statusText.text += string.Format("\nHW Version:{0}", MEMEBehaviour.GetHWVersion()); statusText.text += string.Format("\nFW Version:{0}", MEMEBehaviour.GetFWVersionPlugin()); string deviceName = ""; int deviceType = MEMEBehaviour.GetConnectedDeviceTypePlugin(); if (deviceType == 1) { deviceName = "ES (ウェリントン)"; } else if (deviceType == 2) { deviceName = "MT(サングラス)"; } else if (deviceType == 3) { deviceName = "SW ES (ウェリントン)"; } statusText.text += string.Format("\nDevice Type:{0}", deviceName); string subDeviceName = ""; int subDeviceType = MEMEBehaviour.GetConnectedDeviceSubTypePlugin(); if (subDeviceType == 1) { subDeviceName = "シャイニーブラック"; } else if (subDeviceType == 2) { subDeviceName = "マッドブラック"; } statusText.text += string.Format("\nDevice Sub Type:{0}", subDeviceName); } }
// private string cacheDeviceID; private void OnMemePeripheral(string text) { connectUI.Add(text, () => MEMEBehaviour.MEMEconnectPeripheral(text, OnMemePeripheralConnected)); consoleText.text = "スキャン完了"; // cacheDeviceID = text; }
/// <summary> /// デバイス切断実行 /// </summary> private void OnClickDisConnectBtn() { isInit = false; MEMEBehaviour.MEMEdiconnectPeripheral(OnMemePeripheralDisconneted); MEMEBehaviour.EndSession(); }
/// <summary> /// デバイススキャン停止 /// </summary> private void OnClickStopScanningBtn() { connectUI.Init(); MEMEBehaviour.MEMEstopScanningPeripherals(); }
/// <summary> /// データ受信停止実行 /// </summary> private void OnClickEndDataBtn() { MEMEBehaviour.MEMEstopDataReport(); }
/// <summary> /// データ受信開始実行 /// </summary> private void OnClickStartDataBtn() { MEMEBehaviour.MEMEstartDataReport(); }
/// <summary> /// デバイススキャン実行 /// </summary> private void OnClickStartScanningBtn() { connectUI.Init(); MEMEBehaviour.MEMEstartScanningPeripherals(OnMemePeripheral); }