<?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>i2c data on ble</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11092/i2c-data-on-ble</link><description>hello there . i want to get i2c data on ble advertising packet 
 int main(void)
{
 uint32_t err_code;
 bool erase_bonds;
	ret_code_t ret_code;
 int16_t x_val;
 int16_t y_val;
 int16_t z_val;
 uint8_t start_string[] = START_STRING;
 ret_code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 31 Dec 2015 01:40:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11092/i2c-data-on-ble" /><item><title>RE: i2c data on ble</title><link>https://devzone.nordicsemi.com/thread/41508?ContentTypeID=1</link><pubDate>Thu, 31 Dec 2015 01:40:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bfba747-0fff-44c4-8bdd-36128fba4465</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;no of course you can&amp;#39;t use the company identifier.&lt;/p&gt;
&lt;p&gt;If you want three int16_t then define data as an array of ... 3 x int16_t instead of 3 x uint8_t. You must have the compiler warnings turned down, assigning three 16 bit values to an 8-bit array is usually something it would tell you about. Change to (not checked with a compiler, just typed straight in)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint16_t data[3] = { x_val, y_val , z_val };
manuf_data.p_data = (uint8_t*)data;
manuf_data.data.size = sizeof( data )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;.. and if you&amp;#39;re thinking that will update the advertising data each time x_val etc change, it won&amp;#39;t, but it will put the current values in.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c data on ble</title><link>https://devzone.nordicsemi.com/thread/41512?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2015 15:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c5eed59-6d01-43d7-a2c9-38172538a99c</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;can i use uint16_t ble_advdata_manuf_data_t::company_identifier ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c data on ble</title><link>https://devzone.nordicsemi.com/thread/41511?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2015 15:32:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e86a97c4-d296-4446-a083-b8dcb237ab9e</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;how can we edit size of manufacture data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c data on ble</title><link>https://devzone.nordicsemi.com/thread/41510?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2015 15:31:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0ab391d-a95b-42b1-bb35-c2784def692e</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;yes i want 10 bits&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i2c data on ble</title><link>https://devzone.nordicsemi.com/thread/41509?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2015 15:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a687617-6bb0-4714-82bc-40ca3e80bff2</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Clearly, you can&amp;#39;t fit 16 bits (int16_t) into 8 bits (uint8_t) - so you&amp;#39;re either going to have to do some of &amp;quot;compression&amp;quot;, or expand the amount of data in your advertising packet.&lt;/p&gt;
&lt;p&gt;For a start, does your accelerometer actually give you 16 bits of data?&lt;/p&gt;
&lt;p&gt;Do you actually need the full resolution? Could you just discard some of the  least-significant bits?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>