maximum amount of data can be sent through ble_lbs service

hello,

 i am using nrf52832 with our customized board and i am trying to send 427 characters string at a time using lbs service but it only accepts 200 characters in single time is there any way to send a 427 character string in single time

//i have changed my lbs c file like this

uint32_t ble_lbs_init(ble_lbs_t * p_lbs, const ble_lbs_init_t * p_lbs_init)
{
uint32_t err_code;
ble_uuid_t ble_uuid;
ble_add_char_params_t add_char_params;

// Initialize service structure.
p_lbs->led_write_handler = p_lbs_init->led_write_handler;
p_lbs->button_write = p_lbs_init->button_write_handler;

// Add service.
ble_uuid128_t base_uuid = {LBS_UUID_BASE};
err_code = sd_ble_uuid_vs_add(&base_uuid, &p_lbs->uuid_type);
VERIFY_SUCCESS(err_code);

ble_uuid.type = p_lbs->uuid_type;
ble_uuid.uuid = LBS_UUID_SERVICE;

err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &ble_uuid, &p_lbs->service_handle);
VERIFY_SUCCESS(err_code);

// Add Button characteristic.
memset(&add_char_params, 0, sizeof(add_char_params));
add_char_params.uuid = LBS_UUID_BUTTON_CHAR;
add_char_params.uuid_type = p_lbs->uuid_type;
add_char_params.init_len = sizeof(uint8_t);


add_char_params.max_len = sizeof(uint8_t)*247;
add_char_params.is_var_len = true;
// add_char_params.char_props.read = 1;
add_char_params.char_props.notify = 1;
add_char_params.char_props.indicate = 1;
// add_char_params.char_props.write = 1;
// add_char_params.read_access = SEC_OPEN;
add_char_params.cccd_write_access = SEC_OPEN;

err_code = characteristic_add(p_lbs->service_handle,
&add_char_params,
&p_lbs->button_char_handles);
if (err_code != NRF_SUCCESS)
{
return err_code;
}

// Add LED characteristic.
memset(&add_char_params, 0, sizeof(add_char_params));
add_char_params.uuid = LBS_UUID_LED_CHAR;
add_char_params.uuid_type = p_lbs->uuid_type;
add_char_params.init_len = sizeof(uint8_t);
add_char_params.max_len = sizeof(uint8_t)*247;
add_char_params.is_var_len = true;
add_char_params.char_props.read = 1;
add_char_params.char_props.write = 1;
// add_char_params.char_props.notify = 1;
add_char_params.read_access = SEC_OPEN;
add_char_params.write_access = SEC_OPEN;
// add_char_params.cccd_write_access = SEC_OPEN;

return characteristic_add(p_lbs->service_handle, &add_char_params, &p_lbs->led_char_handles);
}

//changes i have done in sdk config

// <i> Requested BLE GAP data length to be negotiated.

#ifndef NRF_SDH_BLE_GAP_DATA_LENGTH
#define NRF_SDH_BLE_GAP_DATA_LENGTH 251
#endif

// <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links.
#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
#endif

// <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0
#endif

// <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count.
// <i> Maximum number of total concurrent connections using the default configuration.

#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
#define NRF_SDH_BLE_TOTAL_LINK_COUNT 2
#endif

// <o> NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length.
// <i> The time set aside for this connection on every connection interval in 1.25 ms units.

#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
#define NRF_SDH_BLE_GAP_EVENT_LENGTH 200
#endif

// <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size.
#ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
#endif

// <o> NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4.
#ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE
#define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408
#endif

thanks and regards

manikandan v

Parents
  • Hi,

    Did you mean that you want to send 247 bytes (as your configs seems to indicate), or 427 as you wrote in the description?

    Have you verified that the MTU size is updated to the requested value, and accepted by both sides of the link? Do you have any logs from the devices and a sniffer trace of the on-air communications?

    Best regards,
    Jørgen

  • hello thanks for the reply '

    now i have changed this lines 

    add_char_params.max_len = sizeof(uint8_t)*475;

    add_char_params.max_len = sizeof(uint8_t)*475;

    // <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size.
    #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE475
    #endif

    and i can be able to send the configuration successfully but if i connect with my device multiple times simultaneously to send the configuration again and again it goes to breakpoint with is error 

    <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at D:\sdk_15\nRF5_SDK_15.2.0_9412b96\examples\ota\ble_app_blinky\main.c:1118
    PC at: 0x0002E6CF
    <error> app: End of error report 

    thanks and regards

    manikandan  v

Reply
  • hello thanks for the reply '

    now i have changed this lines 

    add_char_params.max_len = sizeof(uint8_t)*475;

    add_char_params.max_len = sizeof(uint8_t)*475;

    // <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size.
    #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE475
    #endif

    and i can be able to send the configuration successfully but if i connect with my device multiple times simultaneously to send the configuration again and again it goes to breakpoint with is error 

    <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at D:\sdk_15\nRF5_SDK_15.2.0_9412b96\examples\ota\ble_app_blinky\main.c:1118
    PC at: 0x0002E6CF
    <error> app: End of error report 

    thanks and regards

    manikandan  v

Children
No Data
Related