Just My Life & My Work

Posts tagged ‘bluetooth’

[iOS] BLE某些概念的解釋

已經持續與藍芽奮戰近一年,來回顧一下BLE某些概念的解釋

首先總結CBServiceCBCharacteristic關係如圖,這樣才好理解其角色負責的任務!

bluetooth Services Characteristics

(繼續閱讀…)

廣告

FOTA (Firmware Over-the-Air)

最近持續在跟韌體「戰鬥」,其中一個功能就是要透過App來讓藍芽硬體中的韌體更新,那麼要怎麼做呢?

FOTA (Firmware Over-the-Air).png

目前有兩種做法:

  1. 藍芽裝置連結電腦來更新韌體
  2. 透過網路將韌體傳輸至藍芽裝置

第一種做法對使用者來說很煩瑣,所以在此不討論!

第二種就對使用者非常友善,因為使用者只要從網路下載更新程式,再透過藍芽傳輸到硬體,就能完成更新韌體的目標!

(繼續閱讀…)

[iOS] 重連藍芽裝置 (ReConnect BLE Device)

半年前透過人家寫好的藍芽裝置SDK,輕鬆愉快實現App各種功能,現在必須自己寫SDK這一層,也就是透過iOS SDK,來實現藍芽各種連線相關的功能。此刻,我來研究重連藍芽裝置

使用核心藍牙(Core Bluetooth)框架,有三種方式可以重連一個外設。你可以:

  1. 獲取已知外設的列表—你曾經發現或者鏈接的外設—使用retrievePeripheralsWithIdentifiers:方法。如果你尋找的外設在這個列表裡,嘗試去鏈接它。
  2. 用retrieveConnectedPeripheralsWithServices:方法獲取當前連接到系統的外設列表。如果你尋找的外設在這個列表裡,本地連接它。
  3. 用scanForPeripheralsWithServices:options:方法掃描發現外設。如果找到就連接。

取決於使用場景,你可能不想掃描發現相同的外設,每當你想重連它的時候。相反,你可能首先使用其他選項,嘗試重連。如圖所示,一個可能的重連工作流是嘗試每個選項。

一個示例重連工作流

BLE Retrieve.jpg

總覺得看了這圖後,就能完全掌握實作的流程!

(繼續閱讀…)

[iOS] 低功耗藍芽連線流程

最近寫iOS App要跟低功耗藍芽連線,接著傳輸資料解碼後來分析。兩年前有碰藍芽體脂計,是看著韌體溝通協議來實作,兩年後的今天再一次依樣畫葫蘆,這次要搞的硬體是24小時配戴的「玩意兒」。

bluetooth peripheral service characteristics

感謝網路上已有許多教學,學習藍芽只要拾人「芽」慧,就能快速上手!

(繼續閱讀…)

[iOS] 系統藍芽綁定

最近在搞藍芽裝置,它是IoT相關的硬體裝置,只要搞定藍芽連線部分,就能實現許多智慧家庭的應用。現在我想要在iOS連結藍芽裝置,照理說綁定藍芽裝置沒什麼稀奇,直到自己進入開發模式,才發現有許多眉眉角角要去深入瞭解,以老闆之前做藍芽眼罩的經驗來看,他說這就是為什麼IoT還無法普及的原因之一,因為光是藍芽連線,就有許多問題要去克服。「連線」是最基本的門檻,很多應用到死在這條線上⋯⋯

ios oserio 藍芽體脂計

註:物聯網(英語:Internet of Things,縮寫IoT)。

(繼續閱讀…)

寄送藍芽裝置給Apple測試

開發單純的iOS App沒什麼難度,可是送審後的議題總會出其不意。原以為可以只拍攝影片給審核人員看,如何連結我們的產品(藍芽裝置)來操作App,可惜我們沒能逃過高人的「法眼」,於是請老闆將一個貴重的藍芽裝置寄送給Apple測試。約莫一週左右,App總算順利上架啦⋯⋯我也順理成章去環島九天:D~

bluetooth peripheral service characteristics

以下就是在iTunes Connect被reject的原因與描述:

From Apple

  • 2. 1 Performance: App Completeness

Guideline 2.1 – Information Needed

We have started the review of your app, but we are not able to continue because we need the associated hardware to fully assess your app features.

Next Steps

To help us proceed with the review of your app, please send the necessary hardware/accessory to the address below.

NOTE: Please include your app name and app ID in the shipment; failure to provide this information can delay the review process.

Additionally, it may take several business days for us to receive the hardware once it has been delivered to Apple.

Apple, Inc.
1 Infinite Loop, M/S: 124-2APP
Cupertino, CA 95014
USA

ATTN: Marcus East
App Name: 快樂健康+
App ID: 1317204377

Once you’ve shipped the hardware, please reply to this message with the shipping carrier and tracking information. Once we have received the hardware, we will continue your app’s review.

IMPORTANT: for non-US Developers

To avoid delays with US Customs, please provide the following information with your shipment (required for all radio-frequency devices imported in the US):

– Description of the equipment
– Quantity
– Device Model/Type Name or Number
– FCC ID
– Original Manufacturer’s Name and Address

Please use FCC form 740 for details on how to provide this information.

Remember:

* A separate FCC Form 740 must be used for each different radio-frequency device or component in the shipment; however, a form is not required for subassemblies, parts, or components of radio-frequency devices.

* The form may be completed by the shipper or recipient, but if the form is not sent with the original shipping documents by the shipper, the shipment may be delayed in customs.

* Ensure all serial and ID numbers are available as well as the name and address of the original manufacturer.

以上問題,2017年11月的時光都耗在這裡啦⋯⋯

之後送審更新版,都不到一天就審核通過!

話說,Apple拿到藍芽裝置且測試過後,不會寄送回來給開發者呢⋯⋯

參考:

[C/C++] 4 bytes轉成integer (Convert 4 Bytes to Integer)

最近要讀取藍牙裝置回傳的資料來解析,需要將4 bytes轉成integer,才能知道訊號強度相對值。太久沒搞底層東東,有些生疏,好在嘗試一下就得到正確結果!

bluetooth Central Peripheral

(繼續閱讀…)

標籤雲

%d 位部落客按了讚: