2016年6月14日 星期二

Nordic NUS service


Compare to standard UUID 128 bit
The Bluetooth_Base_UUID is: 00000000-0000-1000-8000 00805F9B34FB
 TI base UUID of F000XXXX-0451-4000-B000-000000000000 where XXXX is the initial 16-bit UUID.
=============================================================================
#define NUS_BASE_UUID   {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E}}
#define BLE_UUID_NUS_SERVICE   0x0001
#define BLE_UUID_NUS_TX_CHARACTERISTIC   0x0002
#define BLE_UUID_NUS_RX_CHARACTERISTIC   0x0003

#define GATT_MTU_SIZE_DEFAULT   23
Default MTU size. 
#define GATT_RX_MTU   23
Only the default MTU size of 23 is currently supported.

UUIDs used are:

  • 6E400001-B5A3-F393-E0A9-E50E24DCCA9E for the Service
  • 6E400002-B5A3-F393-E0A9-E50E24DCCA9E for the TX Characteristic Property = Write without response
  • 6E400003-B5A3-F393-E0A9-E50E24DCCA9E for the RX Characteristic Property = Notify

Information from Android App description, the notify setting is different from the nordic official doc.
The Bluetooth low energy shield is available from Seeed Studio and Maker Shed
UUIDs used are:
- 6E400001-B5A3-F393-E0A9-E50E24DCCA9E for the Service
- 6E400003-B5A3-F393-E0A9-E50E24DCCA9E for the TX Characteristic
Property = Notify (TX is from pheriperal site sent data to App)
- 6E400002-B5A3-F393-E0A9-E50E24DCCA9E for the RX Characteristic
Property = Write without response (RX is got data from App site)

#define BLE_NUS_MAX_DATA_LEN   (GATT_MTU_SIZE_DEFAULT - 3) ==> 23-3=20


UART configuration:
The application uses the following UART settings:
  • Baud rate: 38.400
  • 8 data bits
  • 1 stop bit
  • No parity
  • HW flow control: RTS/CTS

Notification:
ble_uart_c_rx_notif_enable
uint8_t rx_data[20];
#define SEC_PARAM_BOND 0 /**< Perform bonding. */ #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */

reference:
1. http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v10.0.0%2Fble_sdk_app_nus_c.html&cp=4_0_1_4_2_0_3

2. Old doc
https://devzone.nordicsemi.com/documentation/nrf51/6.0.0/s110/html/a00066.html

3. App: nRF UART app

4. https://github.com/NordicSemiconductor/ble_app_uart_c_S120/commit/f2a82961aba22e3457a3bfdc1bcad3180121075f

5. Demo App from Youtube:
https://www.youtube.com/watch?v=pcuXUIP61IA

6. ANCS NUS code
https://github.com/NordicSemiconductor/nrf51-ble-ancs-nus/blob/master/nrf51-ble-ancs-nus/ble_nus.c


沒有留言:

張貼留言