| 数据搜索系统,热门电子元器件搜索 |
|
PM0237 数据表(PDF) 52 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
PM0237 数据表(HTML) 52 Page - STMicroelectronics |
|
52 / 88 page ![]() Design an application using BlueNRG, BlueNRG-MS ACI APIs PM0237 52/88 DocID027104 Rev 2 3.3 Services and characteristic configuration In order to add a service and related characteristics, a user application has to define the specific profile to be addressed: 1. Standard profile defined by Bluetooth SIG organization. The user must follow the profile specification and services, characteristic specification documents in order to implement them by using the related defined Profile, Services & Characteristics 16 bits UUID (refer to Bluetooth SIG web page: https://www.bluetooth.org/en- us/specification/adopted-specifications). 2. Proprietary, non-standard profile. The user must define its own services and characteristics. In this case, 128-bits UIDS are required and must be generated by profile implementers (refer to UUID generator web page: http://www.famkruithof.net/uuid/uuidgen) A service can be added using the following command: - aci_gatt_add_serv (Service_UUID_Type, Service_UUID_16, Service_Type, Max_Attributes_Records, &ServHandle); This command returns the pointer to the Service Handle (ServHandle ), which is used to identify the service within the user application. A characteristic can be added to this service using this command: - aci_gatt_add_char (ServHandle, Char_UUID_Type, Char_UUID_16, Char_Value_Length, Char_Properties, Security_Permissions, GATT_Evt_Mask, Enc_Key_Size, Is_Variable, &CharHandle); This command returns the pointer to the Characteristic Handle (Char_Handle), which is used to identify the characteristic within the user application. For a detailed description of the aci_gatt_add_serv() and aci_gatt_add_char() functions parameters refer to the user manuals UM1755 and UM1865. The following pseudocode example illustrates the steps to be followed for adding a service and two associated characteristic on a proprietary, non-standard profile. tBleStatus Add_Server_Services_Characteristics(void) { tBleStatus ret; /* The following 128bits UUIDs have been generated from the random UUID generator: D973F2E0-B19E-11E2-9E96-0800200C9A66 --> Service 128bits UUID D973F2E1-B19E-11E2-9E96-0800200C9A66 --> Characteristic_1 128bits UUID D973F2E2-B19E-11E2-9E96-0800200C9A66 --> Characteristic_2 128bits UUID */ /* Service 128bits UUID */ const uint8_t service_uuid[16] = {0x66,0x9a,0x0c,0x20,0x00,0x08,0x96,0x9e,0xe2,0x11,0x9e,0xb1,0xe0,0xf2,0x7 3,0xd9}; /* Characteristic_1 128bits UUID */ const uint8_t charUuid_1[16] = {0x66,0x9a,0x0c,0x20,0x00,0x08,0x96,0x9e,0xe2,0x11,0x9e,0xb1,0xe1,0xf2,0x7 3,0xd9}; /* Characteristic_2 128bits UUID */ |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |