| поискавой системы для электроныых деталей |
|
UM1870 датащи(PDF) 47 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM1870 датащи(HTML) 47 Page - STMicroelectronics |
|
47 / 58 page ![]() DocID027602 Rev 1 47/58 UM1870 BLE remote control demo application 58 8.2 BLE remote control application setup This section describes how to configure a BlueNRG-MS device to acting as a remote control device. 8.2.1 Initialization The BlueNRG-MS's stack must be correctly initialized before establishing a connection with another Bluetooth LE device. This is done with two commands • Aci_Gatt_Init() • Aci_Gap_Init(GAP_PERIPHERAL_ROLE) 8.2.2 Define advertising data The BLE Remote Control application advertises some manufacturing data as follows: /* Set advertising device name as Node */ const uint8_t scan_resp_data[] = {0x05,AD_TYPE_COMPLETE_LOCAL_NAME,'N','o','d','e'} /* Set scan response data */ hci_le_set_scan_resp_data(sizeof(scan_resp_data),scan_resp_data); /* Set Undirected Connectable Mode */ ret = aci_gap_set_discoverable(ADV_IND, (ADV_INTERVAL_MIN_MS*1000)/625, (ADV_INTERVAL_MAX_MS*1000)/625, PUBLIC_ADDR, NO_WHITE_LIST_USE, 0, NULL, 0, NULL, 0, 0); /* Set advertising data */ ret = hci_le_set_advertising_data(sizeof(adv_data),adv_data); On the BlueNRG-MS development platform (STEVAL-IDB005V1), the temperature sensor value is set within the adv_data variable. 8.2.3 Add service and characteristics The BLE Remote Control service is added using the following command: aci_gatt_add_serv(UUID_TYPE_128, service_uuid, PRIMARY_SERVICE, 7, &RCServHandle); Where service_uuid is the private service 128-bit UUID allocated for the BLE remote service (ed0ef62e-9b0d-11e4-89d3-123b93f75cba). The command returns the service handle in RCServHandle. The BLE Remote Control characteristic is added using the following command: #if ENABLE_SECURITY ret = aci_gatt_add_char(RCServHandle, UUID_TYPE_128, controlPointUuid, 1, CHAR_PROP_READ|CHAR_PROP_WRITE|CHAR_PROP_WRITE_WITHOUT_RESP|CH AR_PROP_SIGNED_WRITE, ATTR_PERMISSION_AUTHEN_READ|ATTR_PERMISSION_AUTHEN_WRITE, GATT_NOTIFY_ATTRIBUTE_WRITE, 16, 1, &controlPointHandle); |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |