coreBluetooth


-
BLE 说明档,开发蓝牙4.0 时使用,必备资料
Contents Build your tree of services and characteristics 27 Publishing Your Services and Characteristics 28 Advertising Your Services 29 Responding to Read and Write Requests from a Central 30 Sending Updated Characteristic Values to Subscribed Centrals 33 Core Bluetooth Background Processing for iOS Apps 35 Foreground-Only Apps 35 Take Advantage of Peripheral Connection Options 36 Core bluetooth Background Execution Modes 36 The bluetooth-central Background Execution Mode 37 The bluetooth-peripheral Background Execution Mode 37 Use Background Execution Modes Wisely 38 Performing Long-Term Actions in the background 38 State Preservation and restoration 39 Adding Support for State Preservation and Restoration 40 Best Practices for Interacting with a Remote Peripheral Device 45 Be mindful of radio Usage and power Consumption 45 Scan for Devices Only When You Need To 45 Specify the CBCentralManagerScanOptionAllow DuplicatesKey Option Only When Necessary 45 Explore a Peripherals Data Wisely 46 Subscribe to Characteristic Values That Change often 46 Disconnect from a device when You have all the data you need 47 Reconnecting to Peripherals 47 Retrieving a List of Known Peripherals 49 Retrieving a List of Connected peripherals 50 Best Practices for Setting Up Your Local Device as a Peripheral 51 Advertising Considerations 51 Respect the Limits of Advertising Data 51 Advertise Data Only When You Need To 52 Configuring Your Characteristics 52 Configure Your Characteristics to Support Notifications 53 Require a paired Connection to Access sensitive Data 53 Document Revision History 55 2013-09-18 Copyright O 2013 Apple Inc. All Rights Reserved 3 Figures Core bluetooth overview 9 Figure 1-1 Central and peripheral devices 9 Figure 1-2 Advertising and discovery 10 igure 1-3 Fi A peripheral's service and characteristics 11 Fiqure 1-4 Core bluetooth objects on the central side 12 Figure 1-5 A remote peripheral s tree of services and characteristics 13 Figure 1-6 Core Bluetooth objects on the peripheral side 14 Figure 1-7 A local peripherals tree of services and characteristics 14 Best Practices for Interacting with a Remote Peripheral Device 45 Figure 5-1 A sample reconnection workflow 48 2013-09-18 Copyright O 2013 Apple InC. All Rights Reserved. About core bluetooth The Core bluetooth framework provides the classes needed for your iOS and Mac apps to communicate with devices that are equipped with bluetooth low energy wireless technology. For example, your app can discover, explore, and interact with low energy peripheral devices, such as heart rate monitors and digital thermostats As of oS X v10.9 and iOS 6, Mac and ioS devices can also function as bluetooth low energy peripherals, serving data to other devices, including other mac and ios devices Apps Core bluetooth Bluetooth low energy rotocol stack GATT ATT L2CAP At a glance Bluetooth low energy wireless technology is based on the bluetooth 4.0 specification, which, among other things, defines a set of protocols for communicating between low energy devices. The Core Bluetooth framework is an abstraction of the Bluetooth low energy protocol stack. That said, it hides many of the low-level detail of the specification from you, the developer, making it much easier for you to develop apps that interact with Bluetooth low energy devices Centrals and Peripherals Are the Key players in Core Bluetooth In Bluetooth low energy communication, there are two key players: the central and the peripheral. Each player has a different role to play in bluetooth low energy communication. a peripheral typically has data that is needed by other devices. A central typically uses the information served up by a peripheral to accomplish some task. For example a digital thermostat equipped with bluetooth low energy technology might provide the temperature of a room to an iOS app that then displays the temperature in a user-friendly way 2013-09-18 Copyright O 2013 Apple InC. All Rights Reserved. 5 About core bluetooth At a glance Just as each player has a different role to play in Bluetooth low energy communication, each player performs a different set of tasks. Peripherals make their presence known by advertising the data they have over the air Centrals,on the other hand, can scan for peripherals that might have data they're interested in. When a central discovers such a peripheral, the central can request to connect with the peripheral and begin exploring and interacting with the peripherals data. The peripheral is then responsible for responding to the central in approprlate ways Relevant Chapters: Core Bluetooth Overview"(page 9) Core Bluetooth Simplifies Common Bluetooth Tasks The Core bluetooth framework abstracts away the low-level details from the bluetooth 4.0 specification. As a result, many of the common bluetooth low energy tasks you need to implement in your app are simplified. If you are developing an app that implements the central role, Core bluetooth makes it easy to discover and connect with a peripheral, and to explore and interact with the peripheral s data. In addition Core bluetooth makes it easy to set up your local device to implement the peripheral role Relevant Chapters: "Performing Common Central Role Tasks"(page 16),"Performing Common Peripheral Role Tasks"(page 25 iOS App States Affect Bluetooth Behavior When your iOS app is in the background or in a suspended state its Bluetooth-related capabilities are affected By default, your app is unable to perform bluetooth low energy tasks while it is in the background or in a suspended state. That said, if your app needs to perform Bluetooth low energy tasks while in the background you can declare it to support one or both of the Core bluetooth background execution modes (there 's one for the central role, and one for the peripheral role). Even when you declare one or both of these background execution modes, certain Bluetooth tasks operate differently while your app is in the background. You want to take these differences into account when designing your app Even apps that support background processing may be terminated by the system at any time to free up memory for the current foreground app. As of iOS 7, Core bluetooth supports saving state information for central and peripheral manager objects and restoring that state at app launch time. You can use this feature to support long-term actions involving Bluetooth devices 2013-09-18 Copyright O 2013 Apple InC. All Rights Reserved 6 About core bluetooth How to use this document Relevant Chapters: Core Bluetooth Background Processing for iOS Apps"(page 35) Follow Best Practices to Enhance the User Experience The core bluetooth framework gives your app control over many of the common bluetooth low energy transactions. Follow best practices to harness this level of control in a responsible way and enhance the user's experlence For example, many of the tasks you perform when implementing the central or the peripheral role use your device's onboard radio to transmit signals over the air because your device s radio is shared with other forms of wireless communication and because radio usage has an adverse effect on a device's battery life always design your app to minimize how much it uses the radio Relevant Chapters: "Best Practices for Interacting with a Remote Peripheral Device"(page 45) Best Practices for Setting Up Your Local Device as a Peripheral"(page 51) How to Use this document If you have never used the Core bluetooth framework, or if you are unfamiliar with basic bluetooth low energy concepts, read this document in its entirety. In "Core Bluetooth Overview"(page 9), you learn the key terms and concepts that you need to know for the remainder of the book. After you understand the key concepts, read"Performing Common Central Role Tasks"(page 16)to learn how to develop your app to implement the central role on your local device. Similarly, to learn how to develop your pp to implement the peripheral role on your local device, read"Performing Common Peripheral role Tasks"(page 25 To ensure that your app is performing well and adhering to best practices, read the later chapters: Core Bluetooth Background Processing for ioS Apps"(page 35)," Best Practices for Interacting with a remote Peripheral Device"(page 45), and"Best Practices for Setting Up Your Local Device as a Peripheral"(page 51) See also The official Bluetooth Special Interest Group(SIG)website provides the definitive information about bluetooth low energy wireless technology. There, you can also find the Bluetooth 4.0 specification 2013-09-18 Copyright O 2013 Apple InC. All Rights Reserved. About core bluetooth See also If you are designing hardware accessories that use bluetooth low energy technology to communicate with Apple products, including Mac, iPhone, iPad, and iPod touch models, read Bluetooth Accessory Design Guidelines for Apple Products. If your bluetooth accessory( that connects to an ioS device through a bluetooth low energy link needs access to notifications that are generated on ioS devices, read Apple Notification Center Service(ANcs) Specification 2013-09-18 Copyright O 2013 Apple InC. All Rights Reserved. Core bluetooth overview The Core bluetooth framework lets your ioS and mac apps communicate with bluetooth low energy devices For example, your app can discover, explore, and interact with low energy peripheral devices, such as heart rate monitors, digital thermostats, and even other ios devices The framework is an abstraction of the bluetooth 4.0 specification for use with low energy devices. that said, it hides many of the low-level details of the specification from you, the developer, making it much easier for you to develop apps that interact with bluetooth low energy devices. Because the framework is based on the specification, some concepts and terminology from the specification have been adopted This chapter introduces you to the key terms and concepts that you need to know to begin developing great apps using the Core Bluetooth framework Central and Peripheral devices and Their roles in bluetooth Communication There are two major players involved in all Bluetooth low energy communication: the central and the peripheral Based on a somewhat traditional client-server architecture, a peripheral typically has data that is needed by other devices. a central typically uses the information served up by peripherals to accomplish some particular task. As Figure 1-1 shows, for example a heart rate monitor may have useful information that your Mac or iOS app may need in order to display the user's heart rate in a user-friendly way Figure 1-1 Central and peripheral devices Client server Wants data Has data Central Peripheral 2013-09-18 Copyright O 2013 Apple InC. All Rights Reserved Core bluetooth overview Central and Peripheral Devices and Their roles in Bluetooth Communication Centrals Discover and Connect to Peripherals That Are Advertising Peripherals broadcast some of the data they have in the form of advertising packets. An advertising packet is a relatively small bundle of data that may contain useful information about what a peripheral has to offer, such as the peripherals name and primary functionality. For instance, a digital thermostat may advertise that it provides the current temperature of a room In bluetooth low energy advertising is the primary way that peripherals make their presence known. A central, on the other hand, can scan and listen for any peripheral device that is advertising information that it's interested in, as shown in Figure 1-2. a central can ask to connect to any peripheral that it has discovered advertising Figure 1-2 Advertising and discovery Central Peripheral How the Data of a peripheral ls structured The purpose of connecting to a peripheral is to begin exploring and interacting with the data it has to offer Before you can do this, however, it helps to understand how the data of a peripheral is structured Peripherals may contain one or more services or provide useful information about their connected signal strength. a service is a collection of data and associated behaviors for accomplishing a function or feature of a device(or portions of that device). For example, one service of a heart rate monitor may be to expose heart rate data from the monitor' s heart rate sensor 2013-09-18 Copyright O 2013 Apple InC. All Rights Reserved.

-
2014-05-29
-
下载
用excel画甘特图gantt chart
用excel画甘特图gantt chart
-
下载
struts2 拦截器interceptor教程 示例源码
struts2 拦截器interceptor教程 示例源码
-
学院
转行做IT-第5章 流程控制语句
转行做IT-第5章 流程控制语句
-
学院
亿度云盘~Java小白入门实战
亿度云盘~Java小白入门实战
-
学院
java微服务常用技术整合
java微服务常用技术整合
-
学院
微信支付2021系列之付款码支付一学就会java版
微信支付2021系列之付款码支付一学就会java版
-
学院
C++异步串口通信
C++异步串口通信
-
博客
数组求平均值
数组求平均值
-
下载
Struts2中的validation_多国语言版 国际化i18n+struts2数据校验.zip
Struts2中的validation_多国语言版 国际化i18n+struts2数据校验.zip
-
博客
spring5框架中使用JdbcTemplate操作数据库--添加、修改、删除、查询
spring5框架中使用JdbcTemplate操作数据库--添加、修改、删除、查询
-
下载
java JSP页面静态化总结_动态页面变为静态页面以减少访问数据库的次数提高速度.zip
java JSP页面静态化总结_动态页面变为静态页面以减少访问数据库的次数提高速度.zip
-
博客
使用Vue-draggable组件实现表格拖拽效果
使用Vue-draggable组件实现表格拖拽效果
-
学院
Qt项目实战之基于Redis的网络聊天室
Qt项目实战之基于Redis的网络聊天室
-
下载
InGaAs/GaAs/InGaP量子阱激光器的激光单模特性研究
InGaAs/GaAs/InGaP量子阱激光器的激光单模特性研究
-
博客
VMware Ubuntu安装详细过程(非常靠谱)
VMware Ubuntu安装详细过程(非常靠谱)
-
学院
三维地图GIS大数据可视化
三维地图GIS大数据可视化
-
下载
kd-树matlab程序
kd-树matlab程序
-
博客
移动端动态设置viewport引起的大段文字字号变大
移动端动态设置viewport引起的大段文字字号变大
-
学院
【2021】UI自动化测试Selenium3
【2021】UI自动化测试Selenium3
-
博客
JVM学习纪要(一)
JVM学习纪要(一)
-
下载
day05.xmind
day05.xmind
-
学院
WPF上位机数据采集与监控系统零基础实战
WPF上位机数据采集与监控系统零基础实战
-
博客
pip常见命令
pip常见命令
-
下载
戴尔 Inspiron 3543 5200U EFI,仅支持10.13.x Clover版本为4366.zip
戴尔 Inspiron 3543 5200U EFI,仅支持10.13.x Clover版本为4366.zip
-
下载
数据挖掘一种用于预测的神经网络BP算法结合Cauchy训练的改进
数据挖掘一种用于预测的神经网络BP算法结合Cauchy训练的改进
-
学院
thinkphp5.1博客后台实战视频
thinkphp5.1博客后台实战视频
-
下载
高速列车用6106-T6铝合金型材激光-电弧复合焊接工艺及接头性能
高速列车用6106-T6铝合金型材激光-电弧复合焊接工艺及接头性能
-
学院
Linux与数据库基础
Linux与数据库基础
-
学院
【2021】Python3+Selenium3自动化测试(不含框架)
【2021】Python3+Selenium3自动化测试(不含框架)
-
学院
转行做IT-第7章 数组
转行做IT-第7章 数组