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

GATT client on s120 how to read characteristic value

I use multilink_central example and try get information about discivered service:

		APPL_LOG("[CLIENT_LOG]: Count of services: %d\r\n", p_client->srv_db.srv_count);
		APPL_LOG("[CLIENT_LOG]: Prim Serv id: %d\r\n", p_client->srv_db.services[0].srv_uuid.uuid);

		APPL_LOG("[CLIENT_LOG]:Prim handle range start= %04X\r\n",p_client->srv_db.services[0].handle_range.start_handle);
		APPL_LOG("[CLIENT_LOG]:Prim handle range end= %04X\r\n\r\n",p_client->srv_db.services[0].handle_range.end_handle);
		APPL_LOG("[CLIENT_LOG]:Characteristics count = %02X\r\n\r\n",p_client->srv_db.services[0].char_count);
		for(uint8_t i=0; i<p_client->srv_db.services[0].char_count; i++)
		{
			APPL_LOG("[CLIENT_LOG]:Characteristic's number %d cccd = %04X\r\n",i,p_client->srv_db.services[0].charateristics[i].cccd_handle);
			APPL_LOG("[CLIENT_LOG]:Characteristic's number %d uuid = %04X\r\n",i,p_client->srv_db.services[0].charateristics[i].characteristic.uuid.uuid);
			APPL_LOG("[CLIENT_LOG]:Characteristic's number %d value = %04X\r\n\r\n",i,p_client->srv_db.services[0].charateristics[i].characteristic.handle_value);					
		}

All values ​​are valid ( service uuid, characteristics count, characteristics cccd and uuid ) except the characteristic values.

I also do not understand the concept of working with client_handling API - there is no function to read and write characteristics value. Should I add wrapper functions around sd_ble_gattc_char_values_red() and sd_ble_gattc_char_values_write() to change the GATT service values?

Related