[Swift 開發] Bluetooth 藍牙連接狀態

判斷藍牙連接狀態

我們可以使用CBCentralManagerDelegate

- (void)centralManagerDidUpdateState:(CBCentralManager *)central;

Bluetooth連接狀態的枚舉值

public enum CBManagerState : Int {

    case unknown        // 藍牙狀態未知

    case resetting      // 藍牙重置中

    case unsupported    // 不支持藍牙

    case unauthorized   // 藍牙未授權

    case poweredOff     // 藍牙關閉狀態

    case poweredOn      // 藍牙開啓狀態
}

 

發佈了53 篇原創文章 · 獲贊 19 · 訪問量 14萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章