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

  • I don't quite understand. Could you include some more code? You call ble_gls_glucose_new_meas() with

    rec.meas.type = BLE_GLS_MEAS_TYPE_CONTROL;
    rec.meas.sample_location = BLE_GLS_MEAS_LOC_CONTROL;
    

    but you get BLE_GLS_MEAS_TYPE_VEN_PLASMA and 0x10?

    Which application are you talking about? Could you explain a bit more?

  • 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.
        }	
    }
    
  • The problem is that the Type and Location set by the device and the values read from the application are opposite to each other.

    Is the device wrong? Is the application wrong? I want to know.

    ------------------------------------------------------------------------------------------------------------------
    // 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 & 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
    
    ----------------------------------------------------------------------------------------------------------------------
    

    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)

    In addition, when the meal(rec.context.meal) is set, the application dies.( apple phone ) I did not check it on Android.

    I think it is not a problem with the device I think it as a problem of the application. Is my judgment correct?

  • This is not an answer. Please edit your question and include the information or add it as a comment to your question.

  • but you get BLE_GLS_MEAS_TYPE_VEN_PLASMA and 0x10? => yes.

    Which application are you talking about? => old apple phone and The latest Android phones(nrf tool box)

Related