Added missing check-feature routine
authorsaerome.kim <saerome.kim@samsung.com>
Mon, 8 May 2017 11:28:21 +0000 (20:28 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Thu, 11 May 2017 09:07:21 +0000 (18:07 +0900)
Change-Id: I46a266a69d920719959dfb647506eb7d25dfea4c
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
lib/zbl_zcl.c

index fda930379fd63a61f71f5a31fa5e7f7b14a5a9aa..bdbd0af78c7032fe2fa892b9b02ecc5f46dd15e0 100644 (file)
@@ -409,6 +409,7 @@ static unsigned char analog_discrete_thresholds[] = {
 API int zb_get_analog_or_discret(unsigned char type)
 {
        int index = 0;
+       CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
        unsigned char var = analog_discrete_thresholds[index];
 
        while (var < type && var < 0xFF) {
@@ -422,7 +423,10 @@ API int zb_get_analog_or_discret(unsigned char type)
 API int zb_get_data_size(unsigned char type)
 {
        int i;
-       int count = (int)(sizeof(attribute_sizes) / 2);
+       int count;
+       CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
+
+       count = (int)(sizeof(attribute_sizes) / 2);
        for (i = 0; i < count; i++) {
                if (attribute_sizes[i].type == type)
                        return attribute_sizes[i].size;
@@ -1443,6 +1447,7 @@ API int zb_get_id_from_read_report_config_record(read_report_config_record_h han
                unsigned short *id)
 {
        struct read_reporting_configuration_record_s *h = handle;
+       CHECK_FEATURE_SUPPORTED(ZIGBEE_FEATURE);
        RETV_IF(NULL == h, ZIGBEE_ERROR_INVALID_PARAMETER);
        *id = h->id;
        return ZIGBEE_ERROR_NONE;