Community Translation - Updating an Attribute’s Value in GATT DB of a BLE GATT Server - KBA219298

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HiOm_1802421
Level 5
Level 5
Distributor - Marubun (Japan)
50 replies posted 50 questions asked 25 replies posted

Hi,

I tried to translate this KBA219298 into Japanese.

Updating an Attribute’s Value in GATT DB of a BLE GATT Server - KBA219298

==========

タイトル:BLE GATTサーバのGATT DBの属性値更新

質問:

BLE GATTサーバのGATT DBの属性値を更新するにはどうすればよいですか。

回答:

BLE GATTサーバでは、プロファイル関連データはGATTデータベースと呼ばれるデータベース内に構造化されます。GATTデータベースは、サーバ上に存在するサービス、特性(キャラクタリスティック)、特性記述子(キャラクタリスティックデスクリプタ)、および宣言(デクラレーション)から構成されます。

PSoC® Creator™では、これらの属性 (特性、記述子) は、BLE Component Configurationウィンドウの「プロファイル」タブで初期化できます。実行時に特性値を更新する必要がある場合、アプリケーションは、以下のように API およびマクロを使用して更新することができます。

  1. サーバー自体が値をローカルで更新する必要がある場合:GATT特性は、多くの場合、GATTクライアントが読み取るようなスイッチの状態やセンサー出力などのアプリケーションでリアルタイム値を反映するために使用されます。特性の値を更新するには、アプリケーションで以下のいずれかを使用することができます。
    1. CyBle_GattsWriteAttributeValue() APIで最後のパラメータをCYBLE_GATT_DB_LOCALLY_INITIATEDへ設定
    2. CYBLE_GATT_DB_ATTR_SET_GEN_VALUE (handle,src,length) マクロ

    いずれの場合も、値ソースの長さは、BLEコンポーネント構成で設定された特性の長さ以下でなければなりません。

  2. GATT クライアントが書き込み要求を送信したために値を更新する必要がある場合:この場合、CyBle_GattsWriteAttributeValue() APIを使用して最後のパラメータをCYBLE_GATT_DB_PEER_INITIATEDにセットします。

CyBle_GattsWriteAttributeValue() APIの最後のパラメーターがCYBLE_GATT_DB_LOCALLY_INITIATEDに設定されている場合、APIは属性の権限をチェックせず、属性値を盲目的に更新します。反対に、フラグがCYBLE_GATT_DB_PEER_INITIATEDに設定されている場合、APIは書き込み操作を実行する前に属性の権限を確認します。クライアントが必要な権限と一致しなければ、CyBle_GattsWriteAttributeValue() APIはそれに応じてGATTエラーコードを返します。戻り値に基づいて、書き込み応答またはエラー応答をクライアントに送り返すことができます。

==========

BR,

Omoi

0 Likes
2 Replies
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello, Omoi-san

We receive your translation, it will be published to KBA to Community.

It will be reviewed internally.

After upload, You will receive the points as the word of KBA.

Due to the current volume of works, Please bear with me for the delayed the response.

It could be delayed, but it will be processed soon.

Thanks for your contribution to CDC!

Will keep you update the status.

Thanks,

Jenna Jo

Jenna Jo
JennaJo
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello, Omoi-san

Thanks for waiting for long time,

Your translation has been published to Community.

BLE GATTサーバのGATT DBでの属性値更新– KBA219298 - Community Translated (JA)

You will receive the point as a token of appreciation.

Thanks for your contribution.

Regards,

Jenna

Jenna Jo
0 Likes