<?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>The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24700/the-setting-of-the-device-and-the-read-value-of-the-application-do-not-match-gls</link><description>GLS is implemented using Nordic(S110_7.0_SDK6.1). 
 When set to Control solution function. 
 The setting of the device and the READ value of the application do not match.
Type and sample_location are replaced. what is right? (device or application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Sep 2017 00:40:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24700/the-setting-of-the-device-and-the-read-value-of-the-application-do-not-match-gls" /><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97211?ContentTypeID=1</link><pubDate>Thu, 07 Sep 2017 00:40:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edaa2a24-c94b-4144-b3dc-145d76a49aec</guid><dc:creator>jh jang</dc:creator><description>&lt;p&gt;@Petter Myhre, Thank you for answer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97210?ContentTypeID=1</link><pubDate>Tue, 05 Sep 2017 19:05:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90898106-0ca5-487e-aedb-2d5ffb478133</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I have looked into this. And it seems to me that this is a bug in the Android app. 4A should decode to BLE_GLS_MEAS_LOC_CONTROL and BLE_GLS_MEAS_TYPE_CONTROL. This is according to the specification of the &lt;a href="https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.glucose_measurement.xml"&gt;Glucose Measurement Characteristic&lt;/a&gt;, see this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97216?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2017 00:58:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e702deb3-216c-4b18-9533-a72cbc6618ce</guid><dc:creator>jh jang</dc:creator><description>&lt;p&gt;@Dear Petter Myhre, This is JH Jang who is a coworker with leene99.&lt;/p&gt;
&lt;p&gt;The situation is like the followings:
  - In an Android app, the received packet is from the Nordic is &amp;quot;0B 00 00 E0 07 02 0E 0E 00 0C 00 00 88 B1 4A 00 00&amp;quot;. The meter&amp;#39;s SDK version is S110_7.0_SDK6.1.
  - The 4A is that Type and Location.
  - We found a different result between Android and iPhone app.
  - In Android, it is translated to Venous Plasma and Null but iPhone translates to Control Solution and Control Solution.&lt;/p&gt;
&lt;p&gt;So, the question is how can translates it which is Type and Location value in an application.&lt;/p&gt;
&lt;p&gt;What app is correct? The Android or the iPhone? If not all, is the SDK wrong? Please checks this issue.&lt;/p&gt;
&lt;p&gt;Thank you from
JH Jang.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97215?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2017 13:04:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e66b3c32-f828-4469-b4c5-05bdfe15cb4d</guid><dc:creator>leene99</dc:creator><description>&lt;p&gt;The problem is that the Type and Location set by the device and the values read from the application are opposite to each other.(in android, nrf toolbox)
Is the device wrong? Or Is the application wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97217?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2017 11:50:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c7b4e48-70ea-4f2e-87d0-6e339bb1b86d</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;This is not an answer. Please edit your question and include there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97208?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 22:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8af7e407-ec3b-44bd-baea-6d3bd302e1c2</guid><dc:creator>leene99</dc:creator><description>&lt;p&gt;but you get BLE_GLS_MEAS_TYPE_VEN_PLASMA and 0x10?
=&amp;gt; yes.&lt;/p&gt;
&lt;p&gt;Which application are you talking about?
=&amp;gt; old apple phone and The latest Android phones(nrf tool box)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97213?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 11:38:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a728b02d-4764-4763-9a69-193621feb6ec</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;This is not an answer. Please edit your question and include the information or add it as a comment to your question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97212?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 11:35:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4c5c866-507b-43f3-9d50-c3fb0a99419f</guid><dc:creator>leene99</dc:creator><description>&lt;p&gt;The problem is that the Type and Location set by the device and the values read from the application are opposite to each other.&lt;/p&gt;
&lt;p&gt;Is the device wrong? Is the application wrong? I want to know.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;------------------------------------------------------------------------------------------------------------------
// in device soure code
rec.meas.flags                          = BLE_GLS_MEAS_FLAG_TIME_OFFSET   |
                                              BLE_GLS_MEAS_FLAG_CONC_TYPE_LOC |
                                              BLE_GLS_MEAS_FLAG_SENSOR_STATUS;
                                              
rec.meas.type = BLE_GLS_MEAS_TYPE_CONTROL;         // 10
rec.meas.sample_location = BLE_GLS_MEAS_LOC_CONTROL;  // 4
-------------------------------------------------------------------------------------------------------------------

// in old version apple phone &amp;amp; current version android
type= Venous Plasma // 4 
location = reserved // 10
-------------------------------------------------------------------------------------------------------------------
// The value read from the application.
UUID 0x2A18 Value 0x0B 00 00 E0 07 02 0E 0E 00 0C 00 00 88 B1 4A 00 00

----------------------------------------------------------------------------------------------------------------------
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In addition, I checked other mobile phones.
It was normal in the latest version of apple phone.(nrf toolbox)
But there is a problem with the latest version of the Android phone.(nrf toolbox)&lt;/p&gt;
&lt;p&gt;In addition, when the meal(rec.context.meal) is set, the application dies.( apple phone )
I did not check it on Android.&lt;/p&gt;
&lt;p&gt;I think it  is not a problem with the device
I think it as a problem of the application.
Is my judgment correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97214?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 11:30:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf64d58e-2d41-4109-ac7a-27d3689b3923</guid><dc:creator>leene99</dc:creator><description>&lt;p&gt;Attach our source code. But I do not know if it will help you understand it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//my device =&amp;gt; nordic uart port 
0x0B 00 00 E0 07 02 0E 0E 00 0C 00 00 88 B1 0A 04 00 00

//my code ( insert variable Data via UART. )

static void read_glucose_measurement(uint8_t *data, uint8_t length)
{
	ble_gls_rec_t 	rec;
    uint32_t      	err_code;
	uint8_t			idx;

    // simulate the reading of a glucose measurement.   	
    idx = 0;
	rec.meas.flags                          = (data[idx++]);

	rec.meas.sequence_number				= data[idx++]*256;
	rec.meas.sequence_number				+= data[idx++];
	rec.meas.base_time.year                 = data[idx++]*256;
	rec.meas.base_time.year                 += data[idx++];
	rec.meas.base_time.month                = data[idx++];
    rec.meas.base_time.day                  = data[idx++];
    rec.meas.base_time.hours               	= data[idx++];
    rec.meas.base_time.minutes              = data[idx++];
    rec.meas.base_time.seconds              = data[idx++];

	if(rec.meas.flags&amp;amp;0x01)
	{
		rec.meas.time_offset				= data[idx++]*256;
		rec.meas.time_offset				+= data[idx++];
	}
	else
		rec.meas.time_offset				= 0;

	if(rec.meas.flags&amp;amp;0x02)
	{
		// mmol TEST
		//if(rec.meas.flags&amp;amp;BLE_GLS_MEAS_FLAG_UNITS_MOL_L);
		//else
		//	rec.meas.flags |= BLE_GLS_MEAS_FLAG_UNITS_MOL_L;
		
		if(rec.meas.flags&amp;amp;BLE_GLS_MEAS_FLAG_UNITS_MOL_L)
		{
			// mg/dl =&amp;gt; mmol/L =&amp;gt; mol/L
			rec.meas.glucose_concentration.exponent = -3;
	    	rec.meas.glucose_concentration.mantissa = data[idx++]*256;
			rec.meas.glucose_concentration.mantissa += data[idx++];
			rec.meas.glucose_concentration.mantissa	= (rec.meas.glucose_concentration.mantissa)/18.01;
		}
		else
		{
			// mg/dl =&amp;gt; Kg/L
			rec.meas.glucose_concentration.exponent = -5;
			rec.meas.glucose_concentration.mantissa = data[idx++]*256;
			rec.meas.glucose_concentration.mantissa += data[idx++];
		}

		rec.meas.type                           = data[idx++];
	    rec.meas.sample_location               	= data[idx++];
	}
	else
	{
		rec.meas.glucose_concentration.exponent	= 0;
		rec.meas.glucose_concentration.mantissa = 0;
		rec.meas.type 							= 0;
		rec.meas.sample_location 				= 0;
	}
	
	if(rec.meas.flags&amp;amp;0x08)
	{
		rec.meas.sensor_status_annunciation 	= data[idx++]*256;
		rec.meas.sensor_status_annunciation 	+= data[idx++];
	}
	else
		rec.meas.sensor_status_annunciation		= 0;

	
	// context 사용 
	if(rec.meas.flags&amp;amp;0x10)
	{
		rec.context.flags 					= data[idx++];
		
		if(rec.context.flags&amp;amp;0x80)
		{
			rec.context.extended_flags		= data[idx++]; 
		}
		else
			rec.context.extended_flags		= 0; 
		
		if(rec.context.flags&amp;amp;0x01)
		{
			rec.context.carbohydrate_id		= data[idx++]; 
			if(rec.context.flags&amp;amp;BLE_GLS_CONTEXT_FLAG_MED_L)
			{
				// 1unit =&amp;gt; 0.01cc, 1000cc =&amp;gt; 1L, 즉 1unit =&amp;gt; 10^-5 L
				rec.context.carbohydrate.exponent	= -5;
				rec.context.carbohydrate.mantissa	= data[idx++]*256; 
				rec.context.carbohydrate.mantissa	+= data[idx++]; 
			}
			else
			{
				// 1unit =&amp;gt; 1/22mg(=45.5ug), 즉 1unit =&amp;gt; 1/22*10^6KG
				rec.context.carbohydrate.exponent	= -8;
				rec.context.carbohydrate.mantissa	= data[idx++]*256;
				rec.context.carbohydrate.mantissa	+= data[idx++];
				rec.context.carbohydrate.mantissa	= (rec.context.carbohydrate.mantissa)*100/22;
			}	
		}
		else
		{
			rec.context.carbohydrate_id			= 0; 
			rec.context.carbohydrate.exponent	= 0;
			rec.context.carbohydrate.mantissa	= 0;
		}
		
		if(rec.context.flags&amp;amp;0x02)
		{
			rec.context.meal				= data[idx++]; 
		}
		else
			rec.context.meal				= 0; 

		if(rec.context.flags&amp;amp;0x04)
		{
			rec.context.tester_and_health	= data[idx++]; 
		}
		else
			rec.context.tester_and_health	= 0;

		if(rec.context.flags&amp;amp;0x08)
		{
			rec.context.exercise_duration	= data[idx++]*256; 
			rec.context.exercise_duration	+= data[idx++]; 
			rec.context.exercise_intensity	= data[idx++]; 
		}
		else
		{
			rec.context.exercise_duration	= 0; 
			rec.context.exercise_intensity	= 0; 
		}
		
		if(rec.context.flags&amp;amp;0x10)
		{
			rec.context.medication_id				= data[idx++]; 
			if(rec.context.flags&amp;amp;BLE_GLS_CONTEXT_FLAG_MED_L)
			{
				// 1unit =&amp;gt; 0.01cc, 1000cc =&amp;gt; 1L, 즉 1unit =&amp;gt; 10^-5 L
				rec.context.carbohydrate.exponent	= -5;
				rec.context.carbohydrate.mantissa	= data[idx++]*256; 
				rec.context.carbohydrate.mantissa	+= data[idx++];
			}
			else
			{
				// 1unit =&amp;gt; 1/22mg(=45.5ug), 즉 1unit =&amp;gt; 1/22*10^6KG
				rec.context.carbohydrate.exponent	= -8;
				rec.context.carbohydrate.mantissa	= data[idx++]*256; 
				rec.context.carbohydrate.mantissa	+= data[idx++]; 
				rec.context.carbohydrate.mantissa	= (rec.context.carbohydrate.mantissa)*100/22; 
			}	
		}
		else
		{
			rec.context.medication_id			= 0; 
			rec.context.carbohydrate.exponent	= 0; 
			rec.context.carbohydrate.mantissa	= 0;
		}

		if(rec.context.flags&amp;amp;0x40)
		{
			rec.context.hba1c.exponent	= -1; 
			rec.context.hba1c.mantissa	= data[idx++]*256; 
			rec.context.hba1c.mantissa	+= data[idx++]; 
		}
		else
		{
			rec.context.hba1c.exponent	= 0; 
			rec.context.hba1c.mantissa	= 0; 
		}
	}
	else
	{
		rec.context.flags 				= 0; 
		rec.context.extended_flags		= 0; 
		rec.context.carbohydrate_id		= 0; 
		rec.context.carbohydrate.exponent	= 0;
		rec.context.carbohydrate.mantissa	= 0; 
		rec.context.meal				= 0; 
		rec.context.tester_and_health	= 0;
		rec.context.exercise_duration	= 0; 
		rec.context.exercise_intensity	= 0; 
		rec.context.exercise_duration	= 0; 
		rec.context.exercise_intensity	= 0; 
		rec.context.hba1c.exponent		= 0; 
		rec.context.hba1c.mantissa		= 0; 
	}
		
    err_code = ble_gls_db_record_add(&amp;amp;rec);	

	m_racp_proc_mesumentRecords_reported = 0;
	m_racp_proc_contextRecords_reported = 0;
	m_racp_proc_records_reported_since_txcomplete = 0;
    if (err_code != NRF_SUCCESS)
    {
        // Do nothing.
    }	
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The setting of the device and the READ value of the application do not match(gls)</title><link>https://devzone.nordicsemi.com/thread/97209?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 10:43:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95942148-138c-429b-82ca-bee03fc37e74</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I don&amp;#39;t quite understand. Could you include some more code? You call ble_gls_glucose_new_meas() with&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rec.meas.type = BLE_GLS_MEAS_TYPE_CONTROL;
rec.meas.sample_location = BLE_GLS_MEAS_LOC_CONTROL;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but you get BLE_GLS_MEAS_TYPE_VEN_PLASMA and 0x10?&lt;/p&gt;
&lt;p&gt;Which application are you talking about? Could you explain a bit more?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>