Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/esp-zigbee-ncp/src/esp_ncp_zb.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static void esp_ncp_zb_bind_cb(esp_zb_zdp_status_t zdo_status, void *user_ctx)
};

typedef struct {
esp_zb_zdp_status_t zdo_status;
uint8_t zdo_status;
esp_ncp_zb_user_cb_t zdo_cb; /*!< A ZDO match desc request callback */
} ESP_NCP_ZB_PACKED_STRUCT esp_ncp_zb_bind_parameters_t;

Expand Down Expand Up @@ -291,7 +291,7 @@ static void esp_ncp_zb_zdo_scan_complete_handler(esp_zb_zdp_status_t zdo_status,
scan_data->count = count;

if (nwk_descriptor && count) {
memcpy(scan_data + sizeof(esp_ncp_zb_scan_parameters_t), nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t)));
memcpy(scan_data + 1, nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memcpy((uint8_t *)scan_data + sizeof(esp_ncp_zb_scan_parameters_t), nwk_descriptor, (count * sizeof(esp_zb_network_descriptor_t))); is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as you don't mess the base pointer, do what you want. I personally would never remember the precedence of the casting vs addition but I'm not an expert.

}

esp_ncp_noti_input(&ncp_header, output, outlen);
Expand Down