講義參考教案immediate alert service_第1頁
講義參考教案immediate alert service_第2頁
講義參考教案immediate alert service_第3頁
講義參考教案immediate alert service_第4頁
講義參考教案immediate alert service_第5頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費閱讀

付費下載

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、Immediate Alert ServiceImmediate Alert Servicev1.02015/6/121Copyright 2015 Realtek Semiconductor Corporation.s.Immediate Alert Service修訂歷史(ReviHistory)日期版本修改2Copyright 2015 Realtek Semiconductor Corporation.s.2015/6/12V1.0Draft by Enrelease verImmediate Alert Service目錄修訂歷史(ReviHistory)2表格列表41About I

2、mmediate Alert Service52Service Characteristics62.1Alert Level62.2GATT Table634Service Configuration7Serviceerfa. 84.1IAS_AddService85eract wipplication95.1Handle Cnt Write Request96Referen.103Copyright 2015 Realtek Semiconductor Corporation.s.Immediate Alert Service表格列表表2.1 Characteristic 描述6表2.2 A

3、ttribute Table7表5.1消息格式94Copyright 2015 Realtek Semiconductor Corporation.s.Immediate Alert Service1About Immediate Alert ServiceImmediate Alert Service(IAS)通過提供一個 Control Po,使對端設(shè)備能觸發(fā)本地設(shè)備的及能。警功Immediate Alert Service 包含一個 Alert Level characteristic,只要該 characteristic 被寫入除“No Alert”以外的值,都會引起設(shè)備。Immedi

4、ate Alert Service 一般與其他的 Service 一起某個 profile,如 Proximity,F(xiàn)ind Me 等,其作用就是使設(shè)備具備及警的功能。5Copyright 2015 Realtek Semiconductor Corporation.s.Immediate Alert Service2Service Characteristics這部分是對 IAS Service 的 Characteristic 的簡單介紹,使 Application 開發(fā)者能對 IAS Service 的內(nèi)容有大概的了解,另外也會涉及一些在 Application 中使用 IAS Serv

5、ice 時需要注意的一些事項。關(guān)于 IAS Service的詳細說明請參考 SIG的相關(guān) spec 文檔。如下是 IAS Service 中所包含的 Characteristic:表 2.1 Characteristic 描述從上表可以看到 IAS Service 僅有一個 Characteristic - Alert Level。下面將對 Alert Level 進行介紹。2.1Alert LevelAlert Level characteristic 是一個 control po,使對端可以通過寫這個 characteristic 來觸發(fā)本地設(shè)備報警,而且通過 level 的值設(shè)定的級別。

6、可以設(shè)置的級別分別為“No Alert”,“Mild Alert”和“High Alert”,級別是對強烈程度的分級,形式可以有多種多樣,如燈閃爍、蜂鳴器響、振動等。當本地設(shè)備被觸發(fā)后,以下的方式可以停止:時間到達;用戶關(guān)閉;新的 Alert Level 被寫入;鏈路斷開。2.2GATT Table如下是 IAS Service 的 Attribute Table,描述了 IAS Service 的各個 Attribute 的狀況:6Copyright 2015 Realtek Semiconductor Corporation.s.Characteristic NameRequirement

7、Mandatory PropertiesOptionalPropertiesSecurityPermissAlert LevelMWrite without ResponseNoneImmediate Alert Service表 2.2 Attribute Table3Service ConfigurationIAS Service 沒有可選的配置。7Copyright 2015 Realtek Semiconductor Corporation.s.FlagsAttribute TypeAttribute ValuePermisOptionalINCL/LEPrimary ServiceI

8、AS Service-0 x1802readMINCLCharacteristicproperty(write without response)readMAPPLAlert LevelValue not defined herewrite without responseMImmediate Alert Service4Serviceerfa這部分是 IAS Service 所提供的接口的說明以及一些使用注意事項。關(guān)于如何在 Application 中使用這些接口來實現(xiàn) IAS Service 相關(guān)的 Profile 功能,請參考ProfileerfaDesign。4.1IAS_AddSer

9、viceApplication 在初始化時調(diào)用該接口將 IAS Service 添加到 Profile Layer。8Copyright 2015 Realtek Semiconductor Corporation.s.Immediate Alert Service5eract wipplication當 Cnt 發(fā)起對 IAS Service 相關(guān)數(shù)據(jù)的請求時,IAS Service 會通過 App Callback 將消息通知到Application,IAS Service 發(fā)往 Application 的消息格式如下:表 5.1 消息格式Application 需要對 IAS Servi

10、ce 發(fā)來的這些消息進行處理,接下來將對這部分的處理詳細說明。5.1Handle Cnt Write RequestIAS Service 的 Alert Level 有被 C nt 端 write 的權(quán)限。當 C nt 發(fā)起對 Alert Level 的 write 請求時,IAS Service 會通過 App Callback 向 Application 發(fā)送一個消息, 消息的 msg_type 部分被設(shè)置為 SERVICE_CALLBACK_TYPE_WRITE_CHAR_VALUE,表示為 Write Characteristic 事件,消息的 msg_data的 write_ale

11、rt_level 即是要被寫入 Alert Level characteristic 的值:在 Application 中對該消息的處理相關(guān)的示例代碼片段如下:9Copyright 2015 Realtek Semiconductor Corporation.s.else if (serviceID = gIAServiceId) TIAS_CALLBACK_DATA *pIasCallbackData = (TIAS_CALLBACK_DATA *)pData;if(pIasCallbackData-msg_type = SERVICE_CALLBACK_TYPE_WRITE_CHAR_VALUE)DBG_BUFFER(MODULE_APP, LEVEL_INFO, write_alert_level = %d, 1,pIasCallbackData-msg_data.write_alert_level);SubContentValueDescriptionMessagemsg_typeSERVICE_CALLBACK_TYPE_WRITE_CHAR_VALUEWrite Characteristic Eventmsg_

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論