Zigbee example: add rcp and gateway

* provide Zigbee rcp and Zigbee gateway example
 * minor comment fix for light example
This commit is contained in:
likunqiao
2021-12-16 17:42:19 +08:00
committed by bot
parent 637716b310
commit 8c577cd208
33 changed files with 723 additions and 80 deletions
@@ -35,8 +35,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "esp_zb_switch.h"
#include "esp_log.h"
#include "esp_zb_switch.h"
/**
* @note Make sure set idf.py menuconfig in zigbee component as zigbee end device!
@@ -284,12 +284,14 @@ void zboss_signal_handler(zb_uint8_t bufid)
void app_main()
{
zb_ret_t zb_err_code;
zb_ieee_addr_t g_ieee_addr;
zb_esp_platform_config_t config = {
.radio_config = ZB_ESP_DEFAULT_RADIO_CONFIG(),
.host_config = ZB_ESP_DEFAULT_HOST_CONFIG(),
};
/* initialize Zigbee stack */
ESP_ERROR_CHECK(zb_esp_platform_config(&config));
/* initialize Zigbee stack. */
ZB_INIT("light_switch");
esp_read_mac(g_ieee_addr, ESP_MAC_IEEE802154);
zb_set_long_address(g_ieee_addr);
zb_set_network_ed_role(IEEE_CHANNEL_MASK);
zb_set_nvram_erase_at_start(ERASE_PERSISTENT_CONFIG);
zb_set_ed_timeout(ED_AGING_TIMEOUT_64MIN);
@@ -34,9 +34,10 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "switch_driver.h"
#include "zboss_api.h"
#include "zboss_api_zcl.h"
#include "zb_ha.h"
#include "switch_driver.h"
/* Zigbee configuration */
#define IEEE_CHANNEL_MASK (1l << 13) /* ZigBee default setting is channel 13 for light example usage */
@@ -60,3 +61,12 @@ typedef struct {
zb_zcl_on_off_attrs_t on_off_attr;
light_switch_bulb_params_t bulb_params;
} switch_device_ctx_t;
#define ZB_ESP_DEFAULT_RADIO_CONFIG() \
{ \
.radio_mode = RADIO_MODE_NATIVE, \
}
#define ZB_ESP_DEFAULT_HOST_CONFIG() \
{ \
.host_connection_mode = HOST_CONNECTION_MODE_NONE, \
}
@@ -0,0 +1,17 @@
## IDF Component Manager Manifest File
dependencies:
espressif/esp-zboss-lib: "~=0.0.4"
## Required IDF version
idf:
version: ">=4.1.0"
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"
# # For 3rd party components:
# username/component: ">=1.0.0,<2.0.0"
# username2/component2:
# version: "~1.0.0"
# # For transient dependencies `public` flag can be set.
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
@@ -35,11 +35,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "switch_driver.h"
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include "freertos/queue.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "switch_driver.h"
/**
* @brief: