| поискавой системы для электроныых деталей |
|
UM2071 датащи(PDF) 28 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM2071 датащи(HTML) 28 Page - STMicroelectronics |
|
28 / 56 page ![]() BlueNRG-1 chat demo application UM2071 28/56 DocID029370 Rev 3 aci_gap_init(GAP_CENTRAL_ROLE, 0, 0x08, &service_handle, &dev_name_char_handle, &appearance_char_handle); Peripheral and central BLE roles must be specified in the aci_gap_init() command. See the BlueNRG-1 BLE stack API documentation for more information on these and following commands. 7.1.2 Add service and characteristics The chat service is added to the BLE chat server device via: aci_gatt_add_service(UUID_TYPE_128, &service_uuid, PRIMARY_SERVICE, 7,&chatServHandle); Where service_uuid is the private service 128-bit UUID allocated for the chat service (Primary service). The command returns the service handle in chatServHandle. The TX characteristic is added using the following command on the BLE Chat server device: aci_gatt_add_char(chatServHandle, UUID_TYPE_128, &charUuidTX, 20, CHAR_PROP_NOTIFY, ATTR_PERMISSION_NONE, 0, 16, 1, &TXCharHandle); Where charUuidTX is the private characteristic 128-bit UUID allocated for the TX characteristic (notify property). The characteristic handle is returned on the TXCharHandle variable. The RX characteristic is added using the following command on the BLE Chat server device: aci_gatt_add_char(chatServHandle, UUID_TYPE_128, &charUuidRX, 20, CHAR_PROP_WRITE|CHAR_PROP_WRITE_WITHOUT_RESP, ATTR_PERMISSION_NONE, GATT_SERVER_ATTR_WRITE,16, 1, &RXCharHandle); Where charUuidRX is the private characteristic 128-bit UUID allocated for the RX characteristic (write property). The characteristic handle is returned on the RXCharHandle variable. See the BlueNRG-1 BLE stack API documentation for more information on these and following commands. 7.1.3 Enter connectable mode The server device uses GAP API commands to enter the general discoverable mode: aci_gap_set_discoverable(ADV_IND, 0, 0, PUBLIC_ADDR, NO_WHITE_LIST_USE,8,local_name, 0, NULL, 0, 0); The local_name parameter contains the name presented in advertising data, as per Bluetooth core specification version 4.2, Vol. 3, Part C, Ch. 11. 7.1.4 Connection with central device Once the server device is discoverable by the BLE chat client device, the client device uses aci_gap_create_connection()to connect with the BLE chat server device: aci_gap_create_connection(0x4000, 0x4000, PUBLIC_ADDR, bdaddr, PUBLIC_ADDR, 40, 40, 0, 60, 2000 , 2000); Where bdaddr is the peer address of the client device. Once the two devices are connected, you can set up corresponding serial terminals and type messages in either of them. The typed characters are stored in two respective buffers and when the return key is pressed: on the BLE chat server device, the typed characters are sent to the BLE chat client device by notifying the previously added TX characteristic (after notifications are enabled) with: |
|
ссылки 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 |