Fixed ACR issue. 02/184502/4
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 18 Jul 2018 09:15:07 +0000 (18:15 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Thu, 19 Jul 2018 12:33:03 +0000 (21:33 +0900)
- Added zb_zcl_ias_zone_type_e enum.
- Fixed typos.
- Added 'the' in front of noun
- Fixed the problem that uses wrong pointer

Change-Id: Ie50c8c0a110870b5dc78b29007423084ff7f8ba5

include/zigbee-zcl-type.h
include/zigbee-zdo_internal.h
include/zigbee.h
include/zigbee_private.h
lib/zbl-zcl.c
lib/zbl.c
test/main.c

index d58ec54..8e83734 100644 (file)
@@ -161,6 +161,28 @@ typedef enum {
 } zb_zcl_data_category_e;
 
 /**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_IAS_ZONE_CLUSTER_MODULE
+ * @brief Values of the ZoneType Attribute.
+ *
+ * @since_tizen 4.0
+ */
+typedef enum {
+       ZB_ZCL_IAS_ZONE_TYPE_STANDARD_CIE = 0x0000, /**< Zone type = Standard CIE, Alarm1 = System Alarm, Alarm2 = N/A */
+       ZB_ZCL_IAS_ZONE_TYPE_MOTION_SENSOR = 0x000d, /**< Zone type = Motion Sensor, Alarm1 = Intrusion indication, Alarm2 = Presence indication */
+       ZB_ZCL_IAS_ZONE_TYPE_CONTACT_SWITCH = 0x0015, /**< Zone type = Contact switch, Alarm1 = 1st portal Open-Close, Alarm2 = 2nd portal Open-Close */
+       ZB_ZCL_IAS_ZONE_TYPE_FIRE_SENSOR = 0x0028, /**< Zone type = Fire sensor, Alarm1 = Fire indication, Alarm2 : N/A */
+       ZB_ZCL_IAS_ZONE_TYPE_WATER_SENSOR = 0x002a, /**< Zone type = Water sensor, Alarm1 = Water overflow indication, Alarm2 = N/A */
+       ZB_ZCL_IAS_ZONE_TYPE_GAS_SENSOR = 0x002b, /**< Zone type : Gas Sensor, Alarm1 = CO indication, Alarm2 = Cooking indication */
+       ZB_ZCL_IAS_ZONE_TYPE_PERSONAL_EMERGENCY_SENSOR = 0x002c, /**< Zone type = Personal emergency Sensor, Alarm1 = Fall / Concussion, Alarm2 = Emergency button */
+       ZB_ZCL_IAS_ZONE_TYPE_MOVEMENT_SENSOR = 0x002d, /**< Zone type = Vibration or Movement Sensor, Alarm1 = Movement indication, Alarm2 = Vibration */
+       ZB_ZCL_IAS_ZONE_TYPE_REMOTE_CONTROL = 0x010f, /**< Zone type = Remote control, Alarm1 = Panic, Alarm2 = Emergency  */
+       ZB_ZCL_IAS_ZONE_TYPE_KEY_FOB = 0x0115, /**< Zone type : Key fob, Alarm1 = Panic, Alarm2 = Emergency */
+       ZB_ZCL_IAS_ZONE_TYPE_KEYPAD = 0x021d, /**< Zone type : Keypad, Alarm1 = Panic, Alarm2 = Emergency */
+       ZB_ZCL_IAS_ZONE_TYPE_STANDARD_WARNING_DEVICE = 0x0225, /**< Zone type = Standard Warning Device (e.g.,  Intruder Alarm Systems), Alarm1 = N/A, Alarm2 = N/A */
+       ZB_ZCL_IAS_ZONE_TYPE_INVALID = 0xffff, /**< Zone type : Invalid Zone Type, Alarm1 = N/A, Alarm2 = N/A */
+} zb_zcl_ias_zone_type_e;
+
+/**
  * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_MODULE
  * @brief ZCL Enumerations Description in Zigbee Cluster Library.
  * @since_tizen 4.0
index bf10b99..b6904b5 100644 (file)
@@ -345,7 +345,7 @@ int zb_zdo_unbind_req(
  * @param[out] app_cluster_list A concatenated, ordered list of the AppInputClusterList
  *                              and AppOutputClusterList, beginning with StartIndex,
  *                              from the Simple Descriptor.
- *                              This field shall only be included in the frame if the
+ *                              This field shall only be included if the
  *                              status field is equal to ZB_ZDP_STATUS_SUCCESS.
  * @param[out] user_data user data
  *
@@ -635,7 +635,7 @@ int zb_zdo_match_desc_req(
  *                    #ZB_ZDP_STATUS_INVALID_REQUEST_TYPE \n
  *                    #ZB_ZDP_STATUS_NO_DESCRIPTOR
  * @param[out] addr16 Network address for the request
- * @param[out] node_desc This field shall only be included in the frame if the
+ * @param[out] node_desc This field shall only be included if the
  *                       status field is equal to #ZB_ZDP_STATUS_SUCCESS.
  * @param[out] user_data user data
  *
@@ -729,7 +729,7 @@ int zb_zdo_node_desc_req(
  *                    #ZB_ZDP_STATUS_INVALID_REQUEST_TYPE \n
  *                    #ZB_ZDP_STATUS_NO_DESCRIPTOR
  * @param[out] addr16 Network address for the request
- * @param[out] power_desc This field shall only be included in the frame if the
+ * @param[out] power_desc This field shall only be included if the
  *                       status field is equal to #ZB_ZDP_STATUS_SUCCESS.
  * @param[out] user_data user data
  *
@@ -834,7 +834,7 @@ int zb_zdo_power_desc_req(
  *                    #ZB_ZDP_STATUS_NO_DESCRIPTOR
  * @param[out] addr16 Network address for the request
  * @param[out] length Length in bytes of the complex_desc field
- * @param[out] complex_desc This field shall only be included in the frame if the
+ * @param[out] complex_desc This field shall only be included if the
  *                          status field is equal to #ZB_ZDP_STATUS_SUCCESS.
  * @param[out] user_data user data
  *
@@ -946,7 +946,7 @@ int zb_zdo_complex_desc_req(
  *                    #ZB_ZDP_STATUS_NO_DESCRIPTOR
  * @param[out] addr16 Network address for the request
  * @param[out] len Length in bytes of the user_desc field
- * @param[out] user_desc This field shall only be included in the frame if the
+ * @param[out] user_desc This field shall only be included if the
  *                            status field is equal to #ZB_ZDP_STATUS_SUCCESS.
  * @param[out] user_data user data
  *
index b5a5375..ffe12b0 100644 (file)
@@ -609,27 +609,24 @@ int zb_ev_get_ias_ext_noti_zone_id(zb_event_data_h ev, unsigned char* zone_id);
 int zb_ev_get_enroll_request_src_ep(zb_event_data_h ev, zb_end_point* src_ep);
 
 /**
- * @brief Gets zone type of the enroll request.
+ * @brief Gets the zone type of the enroll request.
  * @since_tizen 4.0
  *
  * @param[in] ev Event data structure
- * @param[out] zone_type Zone type
- *
- *  0x0000 : Standard CIE / Alarm1 - System Alarm, Alarm2 - N/A\n
- *  0x000d : Motion Sensor / Alarm1 - Intrusion indication, Alarm2 - Presence indication\n
- *  0x0015 : Contact switch / Alarm1 - 1st portal Open-Close, Alarm2 - 2nd portal Open-Close\n
- *  0x0028 : Fire sensor / Alarm1 - Fire indication, Alarm2 - N/A\n
- *  0x002a : Water sensor / Alarm1 - Water overflow indication, Alarm2 - N/A\n
- *  0x002b : Gas Sensor / Alarm1 - CO indication, Alarm2 - Cooking indication\n
- *  0x002c : Personal emergency Sensor / Alarm1 - Fall / Concussion, Alarm2 - Emergency button\n
- *  0x002d : Vibration or Movement Sensor / Alarm1 - Movement indication, Alarm2 - Vibration\n
- *  0x010f : Remote control / Alarm1 - Panic, Alarm2 - Emergency\n
- *  0x0115 : Key fob / Alarm1 - Panic, Alarm2 - Emergency\n
- *  0x021d : Keypad / Alarm1 - Panic, Alarm2 - Emergency\n
- *  0x0225 : Standard Warning Device (see. EN 50131 European Standards Series for Intruder Alarm Systems)
- *           / Alarm1 - N/A, Alarm2 -N/A\n
- *  0x8000~0xfffe : Reserved for manufacturer specific types / Alarm1 - N/A, Alarm2 - N/A\n
- *  0xffff : Invalid Zone Type / Alarm1 - N/A, Alarm2 - N/A\n
+ * @param[out] zone_type Zone type \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_STANDARD_CIE \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_MOTION_SENSOR \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_CONTACT_SWITCH \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_FIRE_SENSOR \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_WATER_SENSOR \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_GAS_SENSOR \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_PERSONAL_EMERGENCY_SENSOR \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_MOVEMENT_SENSOR \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_REMOTE_CONTROL \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_KEY_FOB \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_KEYPAD \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_STANDARD_WARNING_DEVICE \n
+ *                                 #ZB_ZCL_IAS_ZONE_TYPE_INVALID
  *
  * @return 0 on success, otherwise a negative error value.
  * @retval #ZIGBEE_ERROR_NONE Successful
@@ -638,13 +635,14 @@ int zb_ev_get_enroll_request_src_ep(zb_event_data_h ev, zb_end_point* src_ep);
  *
  */
 int zb_ev_get_enroll_request_zone_type(zb_event_data_h ev,
-               unsigned short* zone_type);
+               zb_zcl_ias_zone_type_e* zone_type);
+
 /**
- * @brief Gets manufacturer code of the enroll request.
+ * @brief Gets the manufacturer code of the enroll request.
  * @since_tizen 4.0
  *
  * @param[in] ev Event data structure
- * @param[out] mfg_code Manufacture code
+ * @param[out] mfg_code Manufacturer code
  *
  * @return 0 on success, otherwise a negative error value.
  * @retval #ZIGBEE_ERROR_NONE Successful
@@ -1632,30 +1630,30 @@ int zb_simple_desc_set_out_clusters(zb_zdo_simple_desc_h handle,
  *                    #ZB_ZDP_STATUS_DEVICE_NOT_FOUND
  * @param[out] remote_dev_addr64 64-bit address for the remote device
  * @param[out] remote_dev_addr16 16-bit address for the remote device
- * @param[out] assoc_dev_len The number of items in the 16-bit short addresses to follow.
+ * @param[out] assoc_dev_len The number of items in the 16-bit short addresses #assoc_dev_addr_list.
  *                           If the RequestType in the request is Extended Response
  *                           and there are no associated devices on the Remote Device,
  *                           this field shall be set to 0.
  *                           If an error occurs or the RequestType in the request is
  *                           for a Single Device Response, this field shall not
- *                           be included in the frame.
+ *                           be included.
  * @param[out] start_idx Starting index into the list of associated devices for this
  *                       report. If the RequestType in the request is Extended Response
  *                       and there are no associated devices on the Remote Device,
- *                       this field shall not be included in the frame.
+ *                       this field shall not be included in the ZigBee data frame.
  *                       If an error occurs or the RequestType in the request is
  *                       for a Single Device Response, this field shall not
- *                       be included in the frame.
+ *                       be included.
  * @param[out] assoc_dev_addr_list A list of 16-bit addresses, one corresponding to each
  *                               associated device to Remote Device; The number of 16-bit
  *                               network addresses contained in this field is specified
  *                               in the NumAssocDev field.
  *                               If the RequestType in the request is Extended Response
  *                               and there are no associated devices on the Remote Device,
- *                               this field shall not be included in the frame.
+ *                               this field shall not be included in the ZigBee data frame.
  *                               If an error occurs or the RequestType in the request is
  *                               for a Single Device Response, this field shall not
- *                               be included in the frame.
+ *                               be included.
  * @param[out] user_data user data
  *
  * @see zb_zdo_nwk_addr_req()
@@ -1882,7 +1880,7 @@ int zb_zdo_active_ep(zb_zigbee_h handle, zb_nwk_addr addr16, zb_zdo_active_ep_cb
  * @param[out] addr16 Network address for the request
  * @param[out] len Length in bytes of the simple descriptor to follow
  * @param[out] desc Simple descriptor structure this filed shall only be included
- *                  in the frame if the status field is equal to #ZB_ZDP_STATUS_SUCCESS
+ *                  if the status field is equal to #ZB_ZDP_STATUS_SUCCESS
  * @param[out] user_data user data
  *
  * @see zb_zdo_simple_desc_req()
@@ -2154,7 +2152,7 @@ int zb_read_attr_status_record_set_status(
  * @details The attribute data type field shall contain the data type of the attribute
  * in the same read attributes status record.
  *
- * This field shall only be included in #zb_zcl_data_type_e if the associated status
+ * This field shall only be included if the associated status
  * field contains a value of #ZB_ZCL_STATUS_SUCCESS.
  *
  * @since_tizen 4.0
index 07dcd2e..5741a91 100644 (file)
@@ -55,6 +55,115 @@ typedef enum {
 } zb_event_ext_e;
 
 /**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
+ * @brief Sets status to a reporting configuration response record.
+ * @details If the attribute is not implemented on the sender or receiver of the command,
+ * whichever is relevant (depending on direction), the result shall be set to
+ * #ZB_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE.
+ *
+ * If the attribute is supported, but is not capable of
+ * being reported, this field shall be set to #ZB_ZCL_STATUS_UNREPORTABLE_ATTRIBUTE.
+ *
+ * Otherwise, this field shall be set to #ZB_ZCL_STATUS_SUCCESS.
+ *
+ * If the status field is not set to #ZB_ZCL_STATUS_SUCCESS, all fields except the
+ * direction and attribute identifier fields shall be omitted.
+ *
+ * @since_tizen 4.0
+ *
+ * @param[in] handle The handle of write attribute status record
+ * @param[in] status status @see #zb_zcl_status_e
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #ZIGBEE_ERROR_NONE Successful
+ * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see zb_zcl_global_config_report_write_cb()
+ * @see zb_report_config_response_record_clone()
+ * @see zb_report_config_response_record_destroy()
+ * @see zb_report_config_response_record_get_status()
+ * @see zb_report_config_response_record_get_dir()
+ * @see zb_report_config_response_record_get_id()
+ * @see zb_report_config_response_record_set_status()
+ * @see zb_report_config_response_record_set_dir()
+ * @see zb_report_config_response_record_set_id()
+ */
+int zb_report_config_response_record_set_status(
+               zb_zcl_report_config_response_record_h handle,
+               zb_zcl_status_e status);
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
+ * @brief Sets the direction to a reporting configuration response record.
+ * @details The direction field specifies whether values of the attribute are reported
+ * (0x00), or whether reports of the attribute are received (0x01).
+ *
+ * If this value is set to 0x00, then the attribute data type field, the minimum
+ * reporting interval field, the maximum reporting interval field and the reportable
+ * change field are included in the payload, and the timeout period field is omitted. If
+ * this value is set to 0x01, then the timeout period field is included in the payload,
+ * and the attribute data type field, the minimum reporting interval field, the
+ * maximum reporting interval field and the reportable change field are omitted.
+ *
+ * All other values of this field are reserved.
+ *
+ * @since_tizen 4.0
+ *
+ * @param[in] handle The handle of write attribute status record
+ * @param[out] dir direction 00 : #ZB_ZCL_CLIENT_TO_SERVER \n
+ *                           01 : #ZB_ZCL_SERVER_TO_CLIENT \n
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #ZIGBEE_ERROR_NONE Successful
+ * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see zb_zcl_global_config_report_write_cb()
+ * @see zb_report_config_response_record_clone()
+ * @see zb_report_config_response_record_destroy()
+ * @see zb_report_config_response_record_get_status()
+ * @see zb_report_config_response_record_get_dir()
+ * @see zb_report_config_response_record_get_id()
+ * @see zb_report_config_response_record_set_status()
+ * @see zb_report_config_response_record_set_dir()
+ * @see zb_report_config_response_record_set_id()
+ */
+int zb_report_config_response_record_set_dir(
+               zb_zcl_report_config_response_record_h handle,
+               zb_zcl_fc_direction_e dir);
+
+/**
+ * @ingroup CAPI_NETWORK_ZIGBEE_ZCL_REPORTING_CONFIG_RESPONSE_RECORD_MODULE
+ * @brief Sets the attribute identifier to a reporting configuration response record.
+ * @details The attribute identifier field is 16 bits in length and shall contain the
+ * identifier of the attribute that the reporting configuration details apply to.
+ *
+ * @since_tizen 4.0
+ *
+ * @param[in] handle The handle of write attribute status record
+ * @param[out] id Attribute identifier
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #ZIGBEE_ERROR_NONE Successful
+ * @retval #ZIGBEE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ZIGBEE_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @see zb_zcl_global_config_report_write_cb()
+ * @see zb_report_config_response_record_clone()
+ * @see zb_report_config_response_record_destroy()
+ * @see zb_report_config_response_record_get_status()
+ * @see zb_report_config_response_record_get_dir()
+ * @see zb_report_config_response_record_get_id()
+ * @see zb_report_config_response_record_set_status()
+ * @see zb_report_config_response_record_set_dir()
+ * @see zb_report_config_response_record_set_id()
+ */
+int zb_report_config_response_record_set_id(
+               zb_zcl_report_config_response_record_h handle,
+               zb_attribute_id id);
+
+/**
  * @brief Called after getting end-device information.
  *
  * @since_tizen 4.0
index 6fe67b6..871b49f 100644 (file)
@@ -771,7 +771,7 @@ API int zb_report_config_record_get_change(
 
                temp = calloc(len, sizeof(char));
                RETV_IF(NULL == temp, ZIGBEE_ERROR_OUT_OF_MEMORY);
-               memcpy(value, h->change, len);
+               memcpy(temp, h->change, len);
                *type = h->type;
                *count = len;
                *value = temp;
index a8c9931..099a840 100644 (file)
--- a/lib/zbl.c
+++ b/lib/zbl.c
@@ -241,7 +241,7 @@ API int zb_ev_get_enroll_request_src_ep(zb_event_data_h ev, unsigned char* src_e
 }
 
 API int zb_ev_get_enroll_request_zone_type(zb_event_data_h ev,
-       unsigned short* zone_type)
+       zb_zcl_ias_zone_type_e * zone_type)
 {
        zb_event_data_s *event = ev;
        zb_event_ias_enroll_request_s* ias_enroll_request = NULL;
index 87ac927..e0ed940 100644 (file)
@@ -459,7 +459,7 @@ static void _zb_event_cb(zb_nwk_addr addr16, zb_ieee_addr addr64, zb_event_e e,
        case ZB_ZCL_IAS_ZONE_ENROLL_REQUEST_EVENT:
        {
                /*zb_nwk_addr addr16;*/
-               unsigned short zone_type;
+               zb_zcl_ias_zone_type_e zone_type;
                unsigned char ep, mfg_code;
                msg("IAS Zone Request Received\n");