void Advertise() { // don't advertise and monitor at the same time StopMonitor(); if ((peripheralManager != null) && (peripheralManager.isAdvertising)) { Log("Already advertising."); return; } pmDelegate = new PeripheralManagerDelegate(this); peripheralManager = new CBPeripheralManager(pmDelegate, null); }