This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How extend tx packet length(BLE_NUS_MAX_TX_CHAR_LEN)?, and..

I am developing packet exchange process for betwween nRF51822 BLE to My MCU. I modify to use nordic demo project. It is place C:\Keil\ARM\Device\Nordic\nrf51822\Board\pca10001\s110\experimental\ble_app_uart Now, I can transmit 26 packet per 1 sec. Packet size is 19 character.

Test connection is My MCU <-> nRF51822 <-> iPhone5 App: nRF UART

Packet transmit test capture is below.

CS> Exit:[ESC] 00:002-Tx:Sample packet:000 00:040-Tx:Sample packet:001 00:078-Tx:Sample packet:002 00:116-Tx:Sample packet:003 00:154-Tx:Sample packet:004 00:192-Tx:Sample packet:005 00:230-Tx:Sample packet:006 00:268-Tx:Sample packet:007 00:306-Tx:Sample packet:008 00:344-Tx:Sample packet:009 00:382-Tx:Sample packet:010 00:420-Tx:Sample packet:011 00:458-Tx:Sample packet:012 00:496-Tx:Sample packet:013 00:534-Tx:Sample packet:014 00:572-Tx:Sample packet:015 00:610-Tx:Sample packet:016 00:648-Tx:Sample packet:017 00:686-Tx:Sample packet:018 00:724-Tx:Sample packet:019 00:762-Tx:Sample packet:020 00:800-Tx:Sample packet:021 00:838-Tx:Sample packet:022 00:876-Tx:Sample packet:023 00:914-Tx:Sample packet:024 00:952-Tx:Sample packet:025 00:990-Tx:Sample packet:026 01:028-Tx:Sample packet:027 01:066-Tx:Sample packet:028 01:104-Tx:Sample packet:029

Then, Tx/Rx packet length is defined at ble_nus.h #define BLE_NUS_MAX_DATA_LEN (GATT_MTU_SIZE_DEFAULT - 3) /< Maximum length of data (in bytes) that can be transmitted by the Nordic UART service module to the peer. */ #define BLE_NUS_MAX_RX_CHAR_LEN BLE_NUS_MAX_DATA_LEN /< Maximum length of the RX Characteristic (in bytes). */ #define BLE_NUS_MAX_TX_CHAR_LEN 20 /**< Maximum length of the TX Characteristic (in bytes). */

My question is 1.If no probram, how extend Tx packet length(BLE_NUS_MAX_TX_CHAR_LEN)? In the book-Buletooth Low Energy, PDU size isannounced Max 39 byte. 2.How exchange Hex code(0-0xFF) instead ASCII code? 3. BLE_NUS_MAX_TX_CHAR_LEN is 20, but actually it is 19 byte. How use 1 byte? "Tx:Sample packet:xxx\n\r" = 19 byte

Good luck.

Related