This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The setting of the device and the READ value of the application do not match(gls)

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?)

// in device rec.meas.type = BLE_GLS_MEAS_TYPE_CONTROL ;//=> 10 rec.meas.sample_location = BLE_GLS_MEAS_LOC_CONTROL ;//=> 4

// in application => type= Venous Plasma // 4 location = reserved // 10

UUID 0x2A18 Value 0x0B 00 00 E0 07 02 0E 0E 00 0C 00 00 88 B1 4A 00 00

Parents
  • Attach our source code. But I do not know if it will help you understand it.

    //my device => 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&0x01)
    	{
    		rec.meas.time_offset				= data[idx++]*256;
    		rec.meas.time_offset				+= data[idx++];
    	}
    	else
    		rec.meas.time_offset				= 0;
    
    	if(rec.meas.flags&0x02)
    	{
    		// mmol TEST
    		//if(rec.meas.flags&BLE_GLS_MEAS_FLAG_UNITS_MOL_L);
    		//else
    		//	rec.meas.flags |= BLE_GLS_MEAS_FLAG_UNITS_MOL_L;
    		
    		if(rec.meas.flags&BLE_GLS_MEAS_FLAG_UNITS_MOL_L)
    		{
    			// mg/dl => mmol/L => 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 => 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&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&0x10)
    	{
    		rec.context.flags 					= data[idx++];
    		
    		if(rec.context.flags&0x80)
    		{
    			rec.context.extended_flags		= data[idx++]; 
    		}
    		else
    			rec.context.extended_flags		= 0; 
    		
    		if(rec.context.flags&0x01)
    		{
    			rec.context.carbohydrate_id		= data[idx++]; 
    			if(rec.context.flags&BLE_GLS_CONTEXT_FLAG_MED_L)
    			{
    				// 1unit => 0.01cc, 1000cc => 1L, 즉 1unit => 10^-5 L
    				rec.context.carbohydrate.exponent	= -5;
    				rec.context.carbohydrate.mantissa	= data[idx++]*256; 
    				rec.context.carbohydrate.mantissa	+= data[idx++]; 
    			}
    			else
    			{
    				// 1unit => 1/22mg(=45.5ug), 즉 1unit => 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&0x02)
    		{
    			rec.context.meal				= data[idx++]; 
    		}
    		else
    			rec.context.meal				= 0; 
    
    		if(rec.context.flags&0x04)
    		{
    			rec.context.tester_and_health	= data[idx++]; 
    		}
    		else
    			rec.context.tester_and_health	= 0;
    
    		if(rec.context.flags&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&0x10)
    		{
    			rec.context.medication_id				= data[idx++]; 
    			if(rec.context.flags&BLE_GLS_CONTEXT_FLAG_MED_L)
    			{
    				// 1unit => 0.01cc, 1000cc => 1L, 즉 1unit => 10^-5 L
    				rec.context.carbohydrate.exponent	= -5;
    				rec.context.carbohydrate.mantissa	= data[idx++]*256; 
    				rec.context.carbohydrate.mantissa	+= data[idx++];
    			}
    			else
    			{
    				// 1unit => 1/22mg(=45.5ug), 즉 1unit => 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&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(&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.
        }	
    }
    
  • @Dear Petter Myhre, This is JH Jang who is a coworker with leene99.

    The situation is like the followings:   - In an Android app, the received packet is from the Nordic is "0B 00 00 E0 07 02 0E 0E 00 0C 00 00 88 B1 4A 00 00". The meter'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.

    So, the question is how can translates it which is Type and Location value in an application.

    What app is correct? The Android or the iPhone? If not all, is the SDK wrong? Please checks this issue.

    Thank you from JH Jang.

Reply
  • @Dear Petter Myhre, This is JH Jang who is a coworker with leene99.

    The situation is like the followings:   - In an Android app, the received packet is from the Nordic is "0B 00 00 E0 07 02 0E 0E 00 0C 00 00 88 B1 4A 00 00". The meter'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.

    So, the question is how can translates it which is Type and Location value in an application.

    What app is correct? The Android or the iPhone? If not all, is the SDK wrong? Please checks this issue.

    Thank you from JH Jang.

Children
No Data
Related