0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AndroidのBNEPの内部API

Posted at

Android内部のBluetooth BNEPの内部APIについて調べました。

このAPIはAndroidのBluetoothプロトコルスタック Bluedroid または Fluoride の内部APIです。
(なので、自分以外には役に立たない情報だと思われます。)

BNEPはBluetoothのprotocolで、正式名称はBluetooth Network Encupsulation Protocol です。
Bluetoothプロトコルのレイヤ的には、PANとL2CAPの間に位置します。

API

BNEP_Init

  • BNEPの初期化
  • コントロールブロック bnep_cbのゼロクリアとトレースレベルの設定

BNEP_Register

  • L2CAPにBNEPを登録。
  • L2CAPの登録処理はbnep_register_with_l2cap()で行う
  • L2CAPのMODEはデフォルトなのでBASICになる
  • L2CAPのPSMは0xf
  • L2CAPのMTUは1691

BNEP_Deregister

  • l2capのBNEP登録を解除

BNEP_Connect

  • 接続要求を送信

BNEP_ConnectResp

  • 接続応答を送信

BNEP_Disconnect

  • 指定したハンドルのコネクションを切断

BNEP_WriteBuf

  • GKI bufferでデータを送信する

BNEP_Write

  • データを送信する

BNEP_SetProtocolFilters

  • プロトコルフィルタの設定
  • 接続状態で呼ぶ

BNEP_SetMulticastFilters

  • BNEP用のマルチキャストアドレスの設定
  • 接続状態で呼ぶ

BNEP_SetTraceLevel

  • デバッグトレースのレベルを設定

BNEP_GetStatus

  • 指定したハンドルのステータスを取得
  • androidでは使っていない。

APIを使っているところ

PANの初期化

PAN_Register()
  pan_register_with_bnep()
    の中でBNEP_Register()が呼ばれる。

PANの接続

PAN_Connect()
 の中でBNEP_Connect()が呼ばれる。

PANの切断

PAN_Disconnect()
 の中でBNEP_Disconnect()が呼ばれる。

PANの送信

PAN_Write()
  の中でBNEP_Write()が呼ばれる。
PAN_WriteBuf()
  の中でBNEP_WriteBuf()が呼ばれる。

PANのマルチキャストアドレス設定

PAN_SetMulticastFilters()
  の中でBNEP_SetMulticastFilters()が呼ばれる。
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?