Skip to content

add CBPeripheral DidModifySerivices#49

Merged
teach310 merged 8 commits intodevelopfrom
feature/peripheral_didModifyService
Oct 20, 2023
Merged

add CBPeripheral DidModifySerivices#49
teach310 merged 8 commits intodevelopfrom
feature/peripheral_didModifyService

Conversation

@teach310
Copy link
Copy Markdown
Owner

Description

  • add CBPeripheralManager.Remove, RemoveAllServices
  • add CBPeripheralDelegate.DidModifyServices

使いどき

didModifyServicesが発火したらDiscoverServicesを再度呼ぶ

https://harumi.sakura.ne.jp/wordpress/2019/11/24/iphone%E3%81%A7peripheral%E3%82%92%E4%BD%9C%E3%81%A3%E3%81%9F%E6%99%82%E3%81%ABcentral%E3%81%8B%E3%82%89%E6%A4%9C%E5%87%BA%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%84%E5%95%8F%E9%A1%8C/
https://shu223.hatenablog.com/entry/20140604/1401846626

Test

SampleDebugで実機確認

invalidatedなserviceのcharacteristicに書き込もうとすると以下のようにエラーになるという挙動になっている。
スクリーンショット 2023-10-20 23 03 38

teach310 added 8 commits October 20, 2023 23:27
サービス取得できないため、クラッシュしないことを確認
invalidatedServicesの中にあるIDは
Peripheralからアクセスできなくなっていることが確認できた。そのためローカルのPeripheralManagerからも消している。

invalidatedなServiceのCharactersiticに対してWriteCharacteristicValueを呼び出すとNativePluginでエラーが出るようになっている。
Csharp側で出した方が早くエラーを投げられるが必要性は感じていない
@teach310 teach310 added the add label Oct 20, 2023
@teach310 teach310 merged commit 0e4ba1b into develop Oct 20, 2023
@teach310 teach310 deleted the feature/peripheral_didModifyService branch October 20, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant