Overview

总体概述

CBCentralManager objects are used to manage discovered or connected remote peripheral devices (represented by CBPeripheral objects),
including scanning for, discovering, and connecting to advertising peripherals.

CBCentralManager 对象负责管理外设的发现或连接,包括扫描、发现、连接正在广播的外设。

Before you call CBCentralManager methods, the state of the central manager object must be powered on, as indicated by theCBCentralManagerStatePoweredOn constant.
This state indicates that the central device (your iPhone or iPad, for instance) supports Bluetooth low energy and that Bluetooth is on and available to use.

在调用CBCentralManager 方法前,我们必须查看中央管理器的状态是否为打开状态(CBCentralManagerStatePoweredOn)。如果是该状态,表明该中心设备(你的iphone或者ipad)是支持蓝牙低功耗4.0的。

Tasks 任务

Initializing a Central Manager  初始化中央管理器

  • – initWithDelegate:queue:
  • – initWithDelegate:queue:options:
  • - (id)initWithDelegate:(id<CBCentralManagerDelegate>)delegate queue:(dispatch_queue_t)queue options:(NSDictionary *)options
  • 方法说明:delegate代理:接受中心事件        queue:指明在哪个队列处理事件,为nil时表示在主线程处理
  • options:有一下两个选择
  • NSString *const CBCentralManagerOptionShowPowerAlertKey;用该参量出事中央管理器时,当蓝牙开关未打开时会弹出警告框。
    NSString *const CBCentralManagerOptionRestoreIdentifierKey;该参量包含一个指定中央管理器的uid

Establishing or Canceling Connections with Peripherals 连接外设  或者 取消外设连接

Retrieving Lists of Peripherals  整理出外设列表

Scanning or Stopping Scans of Peripherals 扫描或者停止扫描外设

Monitoring Properties

  • state  property
  • 返回一个central
    manager的当前状态,
  • Discussion 讨论

    When a central manager object is initially created, the default value of this property is CBCentralManagerStateUnknown.

    当一个中央管理器对象初始化时,他的默认值是CBCentralManagerStateUnknown

    As the central manager’s state changes, the central manager updates the value of this property and calls the centralManagerDidUpdateState:

    当中央管理器状态改变时,会调用centralManagerDidUpdateState:委托方法

    delegate  property

    Central Manager State中央管理器状态

    Values representing the current state of a central manager object.

    typedef enum {
    CBCentralManagerStateUnknown = 0, 未知
    CBCentralManagerStateResetting, 复位
    CBCentralManagerStateUnsupported, 表明设备不支持蓝牙低功耗
    CBCentralManagerStateUnauthorized,该应用程序是无权使用蓝牙低功耗。
    CBCentralManagerStatePoweredOff, 关闭状态
    CBCentralManagerStatePoweredOn, 打开状态
    } CBCentralManagerState

Central Manager State

Values representing the current state of a central manager object.

typedef enum {
CBCentralManagerStateUnknown = 0,
CBCentralManagerStateResetting,
CBCentralManagerStateUnsupported,
CBCentralManagerStateUnauthorized,
CBCentralManagerStatePowe

CBCentralManager Class 的相关分析的更多相关文章

  1. 多视图学习利器----CCA(典型相关分析)及MATLAB实现

    Hello,我是你们人见人爱花见花开的小花.又和大家见面了,今天我们来聊一聊多视图学习利器------CCA. 一 典型相关分析的基本思想 当我们研究两个变量x和y之间的相关关系的时候,相关系数(相关 ...

  2. SPSS数据分析—基于最优尺度变换的典型相关分析

    传统的典型相关分析只能考虑变量之间的线性相关情况,且必须为连续变量,而我们依然可以使用最优尺度变换来拓展其应用范围,使其可以分析非线性相关.数据为分类数据等情况,并且不再仅限于两个变量间的分析, 虽然 ...

  3. SPSS数据分析—典型相关分析

    我们已经知道,两个随机变量间的相关关系可以用简单相关系数表示,一个随机变量和多个随机变量的相关关系可以用复相关系数表示,而如果需要研究多个随机变量和多个随机变量间的相关关系,则需要使用典型相关分析. ...

  4. SPSS数据分析—相关分析

    相关系数是衡量变量之间相关程度的度量,也是很多分析的中的当中环节,SPSS做相关分析比较简单,主要是区别如何使用这些相关系数,如果不想定量的分析相关性的话,直接观察散点图也可以. 相关系数有一些需要注 ...

  5. 中国各城市PM2.5数据间的相关分析

    code{white-space: pre;} pre:not([class]) { background-color: white; }if (window.hljs && docu ...

  6. Jordan Lecture Note-12: Kernel典型相关分析(Kernel Canonical Correlation Analysis, KCCA).

    Kernel典型相关分析 (一)KCCA 同样,我们可以引入Kernel函数,通过非线性的坐标变换达到之前CCA所寻求的目标.首先,假设映射$\Phi_X: x\rightarrow \Phi_X(x ...

  7. Jordan Lecture Note-11: 典型相关分析(Canonical Correlation Analysis, CCA).

    典型相关分析 (一)引入 典型相关分析(Canonical Correlation Analysis)是研究两组变量之间相关关系的一种多元统计方法.他能够揭示出两组变量之间的内在联系. 我们知道,在一 ...

  8. R语言 典型相关分析

    1.关键点 #典型相关分析##典型相关分析是用于分析两组随机变量之间的相关程度的一种统计方法,它能够有效地揭示两组随机变量之间的相互(线性依赖)关系#例如 研究生入学考试成绩与本科阶段一些主要课程成绩 ...

  9. BZOJ4817 SDOI2017 相关分析

    4821: [Sdoi2017]相关分析 Time Limit: 10 Sec  Memory Limit: 128 MBSec  Special Judge Description Frank对天文 ...

随机推荐

  1. VSCode插件开发

    VSCode插件开发全攻略(十)打包.发布.升级 发布方式 插件开发完了,如何发布出去分享给他人呢?主要有3种方法: 方法一:直接把文件夹发给别人,让别人找到vscode的插件存放目录并放进去,然后重 ...

  2. Backward Digit Sums

    FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N < ...

  3. 【DUBBO】Dubbo原理解析-服务引用

    服务引用是服务的消费方向注册中心订阅服务提供方提供的服务地址后向服务提供方引用服务的过程. 服务的应用方在spring的配置实例如下: <dubbo:referenceid="demo ...

  4. MySQL中地理位置数据扩展geometry的使用心得

    最近学习了些MySQL geometry数据存储和计算,在这里记录下. 1. 环境 geometry推荐在5.6版本以上使用,尽管大部分功能在5.5已经可用,除了距离计算函数st_distance等新 ...

  5. springboot: 集成freemark模板引擎

    1.freemark简介(摘自:http://blog.csdn.net/liaomin416100569/article/details/78349072) 在互联网软件内容网站中 一般首页的访问量 ...

  6. jsp_include

    jsp__include指令先包含后编译 include 行为 先编译后包含 <jsp:include page="head.jsp"></jsp:include ...

  7. java的日期

    直接看例子: import java.text.DateFormatSymbols; import java.util.Calendar; import java.util.GregorianCale ...

  8. 引用 LPSTR、LPCSTR、LPTSTR、LPCTSTR、LPWSTR及LPCWSTR的意义及区别

    1.ANSI(即MBCS):为多字节字符集,它是不定长表示世界文字的编码方式.ANSI表示英文字母时就和ASCII一样,但表示其他文字时就需要用多字节.   2.Unicode:用两个字节表示一个字符 ...

  9. linux(8)

    第十九单元 nfs服务 ===============服务端 介绍: NFS 是Network File System的缩写,即网络文件系统.一种使用于分散式文件系统的协定,由Sun公司开发,于198 ...

  10. Hibernate学习7—Hibernate 映射继承

    需求:学生有很多照片,分为生活照和工作照: 第一节:每个具体类对应一个表 Student.java: package com.cy.model; import java.util.Set; publi ...