Skip to content

Commit

Permalink
Release ver_1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Unify Automated committed Nov 5, 2021
1 parent 9554f32 commit 1340478
Show file tree
Hide file tree
Showing 4,906 changed files with 37,764 additions and 32,337 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions applications/angel/release_notes.md
@@ -1,6 +1,8 @@

# ANGEL Release Notes

## [1.0.3] - Nov 2021

## [1.0.2] - Oct 2021
### Fixed
* Fixed to publish group capabilities correctly
Expand Down
4 changes: 3 additions & 1 deletion applications/dev_ui/dev_gui/release_notes.md
@@ -1,3 +1,5 @@
# Dev GUI Release Notes

## [1.0.2] - Oct 2021
## [1.0.3] - Nov 2021

## [1.0.2] - Oct 2021
2 changes: 2 additions & 0 deletions applications/image_provider/release_notes.md
@@ -1,6 +1,8 @@

# Image Provider Release Notes

## [1.0.3] - Nov 2021

## [1.0.2] - Oct 2021
### Changed
* Changed the example that demonstrates Firmware Update
Expand Down
2 changes: 2 additions & 0 deletions applications/upvl/release_notes.md
@@ -1,6 +1,8 @@

# UPVL Release Notes

## [1.0.3] - Nov 2021

## [1.0.2] - Oct 2021

## Known Bugs
1 change: 0 additions & 1 deletion applications/zigpc/CMakeLists.txt
Expand Up @@ -15,7 +15,6 @@ target_link_libraries(
zigpc_gateway
zigpc_net_mgmt
zigpc_group_mgmt
zigpc_node_state
zigpc_ucl
zigpc_smartstart
zigpc_stdin
Expand Down
1 change: 0 additions & 1 deletion applications/zigpc/components/CMakeLists.txt
Expand Up @@ -4,7 +4,6 @@ add_subdirectory(controller)
add_subdirectory(datastore)
add_subdirectory(diagnostics)
add_subdirectory(group_mgmt)
add_subdirectory(node_state)
add_subdirectory(ota_zigbee)
add_subdirectory(smartstart)
add_subdirectory(stdin)
Expand Down
@@ -1,6 +1,9 @@
find_program(ZAP_EXECUTABLE "zap" REQUIRED)
run_zap(zap/gen-templates.json)

set(Boost_USE_MULTITHREADED ON)
find_package(Boost REQUIRED)

add_library(
zigpc_attribute_management
${CMAKE_CURRENT_BINARY_DIR}/src/zigpc_attrmgmt_publish.c
Expand All @@ -10,7 +13,8 @@ add_library(
src/zigpc_attrmgmt_gateway.c
src/zigpc_attrmgmt_receive.c
src/zigpc_attrmgmt_reporting.cpp
src/zigpc_attrmgmt_send.cpp)
src/zigpc_attrmgmt_send.cpp
src/zigpc_attrmgmt_poll.cpp)

target_include_directories(
zigpc_attribute_management
Expand Down
Expand Up @@ -26,6 +26,9 @@ extern "C" {
static const unsigned int ZIGPC_ATTR_MGMT_DELAY_READ_ATTRIBUTES
= CLOCK_SECOND * 5;

static const unsigned int ZIGPC_ATTR_MGMT_POLL_PERIOD_MS
= CLOCK_SECOND; //1000ms

/**
* @brief Limit of Read Attribute Records to send per ZCL Message
*
Expand Down Expand Up @@ -80,6 +83,12 @@ static const uint16_t ZIGPC_ATTRMGMT_REPORT_INTERVAL_MAX_DEFAULT = 60;
*/
static const uint32_t ZIGPC_ATTRMGMT_REPORT_CHANGE_DEFAULT = 0x0000;

/**
* @brief Default poll list size. The maximum number of clusters that
* can be stoed in the poll list
*/
static const uint32_t ZIGPC_ATTRMGMT_DEFAULT_POLL_SIZE = 256;

/**
* attr_mgmt_evt
*
Expand All @@ -96,6 +105,7 @@ enum attr_mgmt_evt {
*
*/
ZIGPC_ATTR_MGMT_EVT_ATTR_UPDATE,
ZIGPC_ATTR_MGMT_EVT_CONFIGURE_RESPONSE,
ZIGPC_ATTR_MGMT_EVT_READ_ATTRIBUTES_COMMAND,
};

Expand Down Expand Up @@ -312,6 +322,24 @@ sl_status_t
bool is_read_response,
const zcl_frame_t *frame);

/**
* @brief zigpc_attrmgmt_receive_configure_response_frame
* Process a configure attribute response frame
* Accepts a ZCL frame for the response to a configure
* reports command. On a failed configure, adds the given EUI64,
* endpoint and cluster combination to the poll lis
*
* @param eui64 Device identifier.
* @param endpoint_id Device endpoint identifier
* @param cluster_id Cluster identifer of the source from
* @param frame ZCL Frame containing configure report response
*/
sl_status_t zigpc_attrmgmt_receive_configure_response_frame(
const zigbee_eui64_t eui64,
zigbee_endpoint_id_t endpoint_id,
zcl_cluster_id_t cluster_id,
const zcl_frame_t *frame);

#ifdef COMPILE_UNUSED_CODE

/**
Expand Down Expand Up @@ -350,6 +378,74 @@ sl_status_t
const zcl_cluster_id_t cluster_id,
const zcl_attribute_id_t attr_id,
const uint8_t *attr_value);

/**
* @brief zigpc_attrmgmt_get_poll_list_size
*
* Get the size of the current list we are polling
* with ReadAttributes
*
* @return the number of clusters on the list we are polling
**/
size_t zigpc_attrmgmt_get_poll_list_current_size();

/**
* @brief zigpc_attrmgmt_get_poll_list_Max_size
*
* Get the maximum size of the polling list
*
* @return the maximum number of clusters the poll list can contain
**/
size_t zigpc_attrmgmt_get_poll_list_max_size();

/**
* @brief zigpc_attrmgmt_send_poll_attributes
*
* Send a ReadAttribute command to the next entry in
* the polling list
*
* @return SL_STATUS_OK if the command could be sent properly
**/
sl_status_t zigpc_attrmgmt_send_poll_attributes();

/**
* @brief zigpc_attrmgmt_add_poll_entry
*
* Add a new entry to be polled by ReadAttribute commands
* Will be put at the end of the list
*
* @param eui64 - the eui64 of the node
* @param endpoint_id - the endpoint specified
* @param cluster_id - the cluster specified
*
* @return SL_STATUS_OK if the new entry could be added properly
**/
sl_status_t zigpc_attrmgmt_add_poll_entry(const zigbee_eui64_t eui64,
zigbee_endpoint_id_t endpoint_id,
zcl_cluster_id_t cluster_id);

/**
* @briefzigpc_attrmgmt_remove_poll_entry
*
* Remove a eui64, endpoint and cluster combination from the poll list
*
* @param eui64 - the eui64 of the node
* @param endpoint_id - the endpoint specified
* @param cluster_id - the cluster specified
*
* @return SL_STATUS_OK if the new entry could be removed properly
**/
sl_status_t zigpc_attrmgmt_remove_poll_entry(const zigbee_eui64_t eui64,
zigbee_endpoint_id_t endpoint_id,
zcl_cluster_id_t cluster_id);

/**
* @brief zigpc_attrmgmt_empty_poll_list
*
* Empty the polling list
**/
void zigpc_attrmgmt_empty_poll_list();

#ifdef __cplusplus
}
#endif
Expand Down
Expand Up @@ -16,6 +16,7 @@
/* Contiki include */
#include "process.h"
#include "sys/ctimer.h"
#include "sys/etimer.h"

/* Logger includes */
#include "sl_log.h"
Expand Down Expand Up @@ -85,8 +86,12 @@ PROCESS(attribute_management_process, "attribute_management_process");

PROCESS_THREAD(attribute_management_process, ev, data)
{
static struct etimer zigpc_attrmgmt_poll_timer;

PROCESS_BEGIN();

etimer_set(&zigpc_attrmgmt_poll_timer, ZIGPC_ATTR_MGMT_POLL_PERIOD_MS);

while (1) {
sl_status_t status = SL_STATUS_INVALID_TYPE;

Expand Down Expand Up @@ -138,7 +143,22 @@ PROCESS_THREAD(attribute_management_process, ev, data)
receive_data->cluster_id,
receive_data->is_read_response,
&receive_data->frame);
} else if (ev == ZIGPC_ATTR_MGMT_EVT_CONFIGURE_RESPONSE) {
const zigpc_attrmgmt_on_frame_receive_t *receive_data
= (zigpc_attrmgmt_on_frame_receive_t *)data;

status = zigpc_attrmgmt_receive_configure_response_frame(
receive_data->eui64,
receive_data->endpoint_id,
receive_data->cluster_id,
&receive_data->frame);
} else if ((ev == PROCESS_EVENT_TIMER)
&& (data == &zigpc_attrmgmt_poll_timer)) {
status = zigpc_attrmgmt_send_poll_attributes();

etimer_reset(&zigpc_attrmgmt_poll_timer);
}

// must be freed!
// allocated in zigpc_attrmgmt_process_send_event())
if ((data != NULL) && (ev < PROCESS_EVENT_NONE)) {
Expand Down Expand Up @@ -168,6 +188,7 @@ sl_status_t node_send_report_config_cmd(const zigbee_node_t node)
}
return status;
}

#ifdef COMPILE_UNUSED_CODE
sl_status_t update_attribute_from_report(const attribute_report_t report)
{
Expand Down
Expand Up @@ -48,6 +48,27 @@ void zigpc_attrmgmt_callback_on_attribute_frame(
}
}

void zigpc_attrmgmt_callback_on_configure_response_frame(
const zigpc_gateway_on_attribute_reported_t *received_data)
{
if (received_data != NULL) {
zigpc_attrmgmt_on_frame_receive_t ev;

memcpy(ev.eui64, received_data->eui64, ZIGBEE_EUI64_SIZE);
ev.endpoint_id = received_data->endpoint_id;
ev.cluster_id = received_data->cluster_id;
ev.frame.size = received_data->frame.size;
memcpy(ev.frame.buffer,
received_data->frame.buffer,
received_data->frame.size);

zigpc_attrmgmt_process_send_event(
ZIGPC_ATTR_MGMT_EVT_CONFIGURE_RESPONSE,
(void *)&ev,
sizeof(zigpc_attrmgmt_on_frame_receive_t));
}
}

void zigpc_attrmgmt_callback_on_attr_report(void *data)
{
if (data != NULL) {
Expand All @@ -65,6 +86,14 @@ void zigpc_attrmgmt_callback_on_attr_read_response(void *data)
}
}

void zigpc_attrmgmt_callback_on_configure_response(void *data)
{
if (data != NULL) {
zigpc_attrmgmt_callback_on_configure_response_frame(
(const zigpc_gateway_on_attribute_reported_t *)data);
}
}

sl_status_t attr_mgmt_gateway_init_observer(void)
{
sl_status_t result;
Expand All @@ -77,6 +106,12 @@ sl_status_t attr_mgmt_gateway_init_observer(void)
result = zigpc_gateway_register_observer(
ZIGPC_GATEWAY_NOTIFY_READ_ATTRIBUTE_RESPONSE,
zigpc_attrmgmt_callback_on_attr_read_response);

if (result == SL_STATUS_OK) {
result = zigpc_gateway_register_observer(
ZIGPC_GATEWAY_NOTIFY_CONFIGURE_REPORTING_RESPONSE,
zigpc_attrmgmt_callback_on_configure_response);
}
}

return result;
Expand Down
Expand Up @@ -25,12 +25,27 @@
#define ZIGPC_ATTRMGMT_INT_HPP

#include <vector>
#include <list>

#include "sl_status.h"

#include "zcl_attribute_info.h"
#include "zcl_definitions.h"

#define ZCL_CONFIGURE_STATUS_RESPONSE_SIZE 4

typedef uint8_t configure_response_buffer_t[ZCL_CONFIGURE_STATUS_RESPONSE_SIZE];

/**
* @brief the structure representing a configure reporting
* response frame
**/
typedef struct {
uint8_t status; /**the status if the report was configured*/
uint8_t direction; /**the direction of the report (to client or server)*/
uint16_t attribute_id; /**the attribute id of the report*/
} zigpc_attrmgmt_configure_status_record_t;

/**
* @brief Build list of ZCL Configure Report Records for a given cluster.
*
Expand Down Expand Up @@ -86,6 +101,51 @@ sl_status_t zigpc_attrmgmt_send_split_read_cmds(
zcl_cluster_id_t cluster_id,
const std::vector<zcl_attribute_id_t> &attr_ids);

/**
* @brief zigpc_attrmgmt_get_next_poll_entry
* Get the next poll entry to be sent
*
* @param eui64 reference to store eui64 of next entry
* @param endpoint_id reference to store endpoint of next entry
* @param cluster_id reference to store cluster of next entry
*
* @return SL_STATUS_OK if the information could be retrieved.
* SL_STATUS_EMPTY if no entries in the poll list, SL_STATUS_FAIL
* if some other error occurred
*/
sl_status_t
zigpc_attrmgmt_get_next_poll_entry(zigbee_eui64_uint_t &eui64,
zigbee_endpoint_id_t &endpoint_id,
zcl_cluster_id_t &cluster_id);

/**
* @brief zigpc_attrmgmt_buffer_to_configure_status
* Extract a configure report status record from a
* buffer of 4 bytes
*
* @param buffer 4-byte buffer where the record is stored
* @param record destination reference to copy record
*
* @return SL_STATUS_OK if the operation could complete
*/
sl_status_t zigpc_attrmgmt_buffer_to_configure_status(
const configure_response_buffer_t buffer,
zigpc_attrmgmt_configure_status_record_t &record);

/**
* @brief zigpc_attrmgmt_buffer_to_configure_status_list
* Extracts a series of records from a buffer of bytes
*
* @param buffer buffer of bytes containing configure status records
* @param buffer_len the length of the above buffer
* @param record_list the reference to the list to store the records
*
* @return SL_STATUS_OK if the buffer could be properly read
*/
sl_status_t zigpc_attrmgmt_buffer_to_configure_status_list(
const uint8_t *buffer,
size_t buffer_len,
std::list<zigpc_attrmgmt_configure_status_record_t> &record_list);
#endif //ZIGPC_ATTRMGMT_INT_HPP

/** @} end attribute_management_int */
/** @} end attribute_management_int */

0 comments on commit 1340478

Please sign in to comment.