<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Problem with frame length to sent of APP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34646/problem-with-frame-length-to-sent-of-app</link><description>Hello, I am developing a system where I have a app and a Rigado BMD-300 Module. I am using, for experiment, the nRF Connect App and in program, I use SDK 14.2 and s132 softdevice. My question is that I want sending 5 bytes (40 bits) but the App only permite</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 25 May 2018 07:34:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34646/problem-with-frame-length-to-sent-of-app" /><item><title>RE: Problem with frame length to sent of APP</title><link>https://devzone.nordicsemi.com/thread/133348?ContentTypeID=1</link><pubDate>Fri, 25 May 2018 07:34:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54ff09c1-4191-43e3-9d69-b41652513b63</guid><dc:creator>danielfernandes</dc:creator><description>&lt;p&gt;Yes, my problem is solved. Thank You, Bjorn.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with frame length to sent of APP</title><link>https://devzone.nordicsemi.com/thread/133334?ContentTypeID=1</link><pubDate>Fri, 25 May 2018 06:18:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11723238-7a52-40a6-8b79-e7de95fc301e</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;OK, are you now able to write 5 bytes to the characteristic?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with frame length to sent of APP</title><link>https://devzone.nordicsemi.com/thread/133266?ContentTypeID=1</link><pubDate>Thu, 24 May 2018 13:35:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04e34f6f-d94d-4807-91e2-1dd37d6eeebe</guid><dc:creator>danielfernandes</dc:creator><description>&lt;p&gt;Thanks, I didn&amp;#39;t already remember this part of code. When, I sent for you this part of code and I saw this lines I did remember that it are this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with frame length to sent of APP</title><link>https://devzone.nordicsemi.com/thread/133235?ContentTypeID=1</link><pubDate>Thu, 24 May 2018 12:20:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abf97308-e78f-436c-8270-8b5c6f6e75d5</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Exactly what I wanted. In your code you&amp;#39;ll see that the length of the characteristic value is set to 4, i.e. 4 bytes.&lt;/p&gt;
&lt;p&gt;attr_char_value.max_len = 4;&lt;br /&gt; attr_char_value.init_len = 4;&lt;/p&gt;
&lt;p&gt;If you change this to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;attr_char_value.max_len = 5;&lt;br /&gt; attr_char_value.init_len = 5;&lt;/p&gt;
&lt;p&gt;Then you should be able to write 5bytes to the characteristic.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with frame length to sent of APP</title><link>https://devzone.nordicsemi.com/thread/133226?ContentTypeID=1</link><pubDate>Thu, 24 May 2018 12:04:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ff385c1-27ca-4451-a83d-49f4fc8586a8</guid><dc:creator>danielfernandes</dc:creator><description>&lt;p&gt;I don&amp;#39;t know if I understand your question, but I send this short part of my code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint32_t our_char_add(ble_os_t * p_our_service, ble_gatts_char_handles_t* p_chandle, uint16_t chuuid, bool notifyenabled, bool writeenabled, uint32_t* p_value)
{
    uint32_t            err_code;
    ble_uuid_t          char_uuid;
    ble_uuid128_t       base_uuid = BLE_UUID_OUR_BASE_UUID;

    char_uuid.uuid = chuuid;
    err_code = sd_ble_uuid_vs_add(&amp;amp;base_uuid, &amp;amp;char_uuid.type);
    APP_ERROR_CHECK(err_code);

    // Add read only properties to our characteristic
    ble_gatts_char_md_t char_md;
    memset(&amp;amp;char_md, 0, sizeof(char_md));
    char_md.char_props.read = 1;
    char_md.char_props.write = 0;
    
    if (notifyenabled) {
        // Configuring Client Characteristic Configuration Descriptor metadata
        // for notification and add to char_md structure
        // This should be read/write
        static ble_gatts_attr_md_t cccd_md;
        memset(&amp;amp;cccd_md, 0, sizeof(cccd_md));
        BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cccd_md.read_perm);
        BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cccd_md.write_perm);
        cccd_md.vloc                = BLE_GATTS_VLOC_STACK;    
        char_md.p_cccd_md           = &amp;amp;cccd_md;
        char_md.char_props.notify   = 1;   
    }
    
    // Configure the attribute metadata
    ble_gatts_attr_md_t attr_md;
    memset(&amp;amp;attr_md, 0, sizeof(attr_md));  
    attr_md.vloc        = BLE_GATTS_VLOC_USER; // user provided location
    
    // Set read/write security levels to our characteristic
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.read_perm);
    if (writeenabled) {
        char_md.char_props.write = 1;
        BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.write_perm);
    } else {
        BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&amp;amp;attr_md.write_perm);
    }
    
    // Configure the characteristic value attribute
    ble_gatts_attr_t    attr_char_value;
    memset(&amp;amp;attr_char_value, 0, sizeof(attr_char_value));
    attr_char_value.p_uuid      = &amp;amp;char_uuid;
    attr_char_value.p_attr_md   = &amp;amp;attr_md;
    
    // Define characteristic length (in number of bytes) and set
    // initial value to whatever passed to here
    attr_char_value.max_len     = 4;
    attr_char_value.init_len    = 4;
    attr_char_value.p_value     = (uint8_t *)p_value;

    // Add our new characteristic to the service
    err_code = sd_ble_gatts_characteristic_add(p_our_service-&amp;gt;service_handle,
                                                &amp;amp;char_md,
                                                &amp;amp;attr_char_value,
                                                p_chandle);
    APP_ERROR_CHECK(err_code);

    return NRF_SUCCESS;
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with frame length to sent of APP</title><link>https://devzone.nordicsemi.com/thread/133223?ContentTypeID=1</link><pubDate>Thu, 24 May 2018 11:57:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:565d1d81-5ba6-4e27-9d3d-6bb5513c6719</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Daniel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;can you post the snippet from the application code where you add the characteristic that you&amp;#39;re trying to write to? I want to make sure that the size of the characteristic is set 5 and not 4.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>