<?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>Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7903/is-there-a-code-example-of-how-to-use-uuids_more_available</link><description>Hello, 
 at the moment I try to add some more services to my BLE device. This goes wrong with err_code = 12 (NRF_ERROR_DATA_SIZE). With some search in the devZone I found out, that it is not possible to advertise more than two uuid s because of the size</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Jul 2015 07:45:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7903/is-there-a-code-example-of-how-to-use-uuids_more_available" /><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28257?ContentTypeID=1</link><pubDate>Fri, 03 Jul 2015 07:45:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9023bbeb-c422-48be-95ff-49485bf9ed70</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;This question was answered through a MyPage support case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28250?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 13:54:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfd36b84-3d9a-4b1c-9341-2a3021875560</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Looks ok. Could you upload your complete project so I can have a test it here? You can also share it confidentially in a private support case through your MyPage account at nordicsemi.com, if you do, please refer to this question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28249?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 11:56:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc203f48-19a1-4c9d-ae6d-16b219484d84</guid><dc:creator>Andreas</dc:creator><description>&lt;p&gt;Hello, yes, I get the err_code=12 when calling sd_ble_characteristic_add(). This is done in the direction_char_add(...) function.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static uint32_t direction_char_add(ble_command_t * p_com, const ble_command_init_t * p_com_init){
ble_gatts_char_md_t char_md;
ble_gatts_attr_md_t cccd_md;
ble_gatts_attr_t    attr_char_value;
ble_uuid_t          ble_uuid;
ble_gatts_attr_md_t attr_md;
	uint32_t   err_code=0;
	int i=0;

	for(i=0;i&amp;lt;4;i++)
	{
		commandDirection[i]= i;
	}

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;

memset(&amp;amp;char_md, 0, sizeof(char_md));

char_md.char_props.notify = 1;
	char_md.char_props.read = 1;
char_md.p_char_user_desc  = NULL;
char_md.p_char_pf         = NULL;
char_md.p_user_desc_md    = NULL;
char_md.p_cccd_md         = &amp;amp;cccd_md;
char_md.p_sccd_md         = NULL;

ble_uuid.type = p_com-&amp;gt;uuid_type;
ble_uuid.uuid = BLE_UUID_DEV_COMMAND_DIRECTION_CHAR;

memset(&amp;amp;attr_md, 0, sizeof(attr_md));

BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.write_perm);

attr_md.vloc    = BLE_GATTS_VLOC_STACK;
attr_md.rd_auth = 0;
attr_md.wr_auth = 0;
attr_md.vlen    = 1;

memset(&amp;amp;attr_char_value, 0, sizeof(attr_char_value));

attr_char_value.p_uuid    = &amp;amp;ble_uuid;
attr_char_value.p_attr_md = &amp;amp;attr_md;
attr_char_value.init_len  = (4*sizeof(uint8_t));
attr_char_value.init_offs = 0;
attr_char_value.max_len   = BLE_COMMAND_MAX_DIRECTION_LEN;
	attr_char_value.p_value = commandDirection;

	err_code = sd_ble_gatts_characteristic_add(p_com-&amp;gt;service_handle,
                                       &amp;amp;char_md,
                                       &amp;amp;attr_char_value,
                                       &amp;amp;p_com-&amp;gt;direction_handle);
	
	if (err_code != NRF_SUCCESS)
{
    printf(&amp;quot;err_code_direction_char_add=%d\r&amp;quot;,err_code);
			return err_code;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;So in this function I get the printf &amp;quot;err_code_direction_char_add=12&amp;quot; on the terminal. I had a look on the types of the parameters given to sd_ble_gatts_characteristic_add(...). For me it looks ok...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28248?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 10:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6aea4dc-4f89-4254-ae10-8a3157a244d0</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;So sd_ble_gatts_characteristic_add() returns NRF_ERROR_DATA_SIZE? You haven&amp;#39;t included that part of the code. NRF_ERROR_DATA_SIZE means Invalid data size(s) supplied. What arguments are you supplying to sd_ble_gatts_characteristic_add()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28256?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 05:37:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:939a25e8-9061-444e-8fce-7eb3164a5b50</guid><dc:creator>Andreas</dc:creator><description>&lt;p&gt;No, I`m using the S120 as an peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28255?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 14:20:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaa83cb6-d9dc-40de-8a06-187c23c98298</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Not the S110? Are you adding the GATT server to the central or the peripheral?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28254?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 14:06:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebe16b51-bd0d-4a93-a0e7-8bc26e994fe6</guid><dc:creator>Andreas</dc:creator><description>&lt;p&gt;I`m using the S120 softdevice from the 8.1.0 SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28253?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 12:17:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:314cd0a6-66f4-4290-beee-6fb96954a087</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What SoftDevice and SoftDevice version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28252?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 11:58:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b058f87f-8529-46bd-8d12-0a76c83973d4</guid><dc:creator>Andreas</dc:creator><description>&lt;p&gt;Hello Petter,
thanks for your reply. For now, I also belive that there is no problem with the length of the advertising data. I&lt;code&gt;m able to add one custom service. I can also add a second custom service. But when I trie to add a characteristic to this service, I get an NRF_ERROR=12 (NRF_ERROR_DATA_SIZE). But I don&lt;/code&gt;t know how I can solve this issue... :-(
Can someone have a look on my ble_command_init() function? The second custom service is called command...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t ble_command_init(ble_command_t * p_com, const ble_command_init_t * p_com_init){
uint32_t   err_code;
ble_uuid_t ble_uuid;

// Initialize service structure
p_com-&amp;gt;conn_handle = BLE_CONN_HANDLE_INVALID;
//p_com-&amp;gt;type   = p_com_init-&amp;gt;temp_type;

// Add service
BLE_UUID_BLE_ASSIGN(ble_uuid, BLE_UUID_SERVICE_COMMAND);

err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &amp;amp;ble_uuid, &amp;amp;p_com-&amp;gt;service_handle);
if (err_code != NRF_SUCCESS)
{
    return err_code;
}

	
	err_code = direction_char_add(p_com, p_com_init);
	if (err_code != NRF_SUCCESS)
{
    printf(&amp;quot;err_code_direction_add=%d\r&amp;quot;,err_code);
			return err_code;
}
	
return NRF_SUCCESS;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thanks,
BTprogrammer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a code example of how to use uuids_more_available</title><link>https://devzone.nordicsemi.com/thread/28251?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 07:51:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9641ac76-242c-4603-890e-00f45e8ba7e5</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I think you are mixing things up at bit here. In services_init() you add services, characteristics and descriptors to the GATT server on your device. In advertising_init() you select what UUIDs that should be included in the advertising packet. But the UUIDs used in services_init() and advertising_init() are not related, they could be totally different, but of course that wouldn&amp;#39;t make much sense. What I&amp;#39;m trying to say is that you can&amp;#39;t fix an error in services_init() by modifying advertising_init(). How many vendor specific UUIDs are you trying to add? How many are you able to add before you get the error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>