If a result callback is not specified for gatt_write_char() it is
assumed that Write Command will be used. This is not valid for
Characteristic Descriptors, which only support Write Request.
According to HTS 1.0 (Table 3.1, and Sections 3.1.1.4 and 3.2), the
Temperature Type Characteristic is optional. The only restriction is
that it shall not be present if the Temperature Type is non-static, for
which case the "Temperature Type" field shall be present on the
Temperature Measurement Characteristic value.
Given there is no default value specified when the Temperature Type is
static and unknown, the "Type" entry for MeasurementReceived() on the
Thermometer API was made optional.
The probe() function for GATT profiles should be transport agnostic.
There is a btd_device_get_primaries() method which can be used to return
a list of discovered GATT Primary Services, and it works for BR/EDR and
LE. It is already used for Proximity, for instance.
device_services_from_record() is BR/EDR specific and should not be used
by GATT profile code.
It also fixes a memory leak, given device_services_from_record() returns
a heap allocated GSList.
Time stamp value is an optional field provided in the measure, so next
value in the array will start in a different index depending if the time
stamp was provided or not. This patch check this case and update the
index to a proper value in the byte array before reading the temperature
type value.
This patch checks the GATT server is connected before doing any GATT
transaction. If it isn't, we abort the operation to avoid the NULL
pointer deference problem.
audio/avrcp.c: In function 'avrcp_unregister':
audio/avrcp.c:1253: error: implicit declaration of function 'g_slist_free_full'
thermometer/thermometer.c: In function 'destroy_char':
thermometer/thermometer.c:79: error: implicit declaration of function 'g_slist_free_full'