mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-17 23:39:58 +00:00
This is a simple application demonstrating a Bluetooth mesh multi-element node. Each element has a mesh onoff client and server model which controls one of the 4 sets of buttons and LEDs . Prior to provisioning, an unprovisioned beacon is broadcast that contains a UUID. Each button controls the state of its corresponding LED and does not initiate any mesh activity. The models for button 1 and LED 1 are in the node's root element. The 3 remaining button/LED pairs are in elements 1 through 3. Assuming the provisioner assigns 0x100 to the root element, the secondary elements will appear at 0x101, 0x102 and 0x103. After provisioning, the button clients must be configured to publish and the LED servers to subscribe. If a LED server is provided with a publish address, it will also publish its status on an onoff state change. If a button is pressed only once within a 1 second interval, it sends an "on" message. If it is pressed more than once, it sends an "off" message. The buttons are quite noisy and are debounced in the button_pressed() interrupt handler. An interrupt within 250ms of the previous is discarded. This might seem a little clumsy, but the alternative of using one button for "on" and another for "off" would reduce the number of onoff clients from 4 to 2.
35 lines
1.3 KiB
YAML
35 lines
1.3 KiB
YAML
# Licensed to the Apache Software Foundation (ASF) under one
|
|
# or more contributor license agreements. See the NOTICE file
|
|
# distributed with this work for additional information
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
# to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance
|
|
# with the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing,
|
|
# software distributed under the License is distributed on an
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
# KIND, either express or implied. See the License for the
|
|
# specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
pkg.name: apps/blemesh_models_example_1
|
|
pkg.type: app
|
|
pkg.description: Sample application for BLE Mesh node with on/off model on nRF52840pdk
|
|
pkg.author: "Michał Narajowski <[email protected]>"
|
|
pkg.homepage: "http://mynewt.apache.org/"
|
|
pkg.keywords:
|
|
|
|
pkg.deps:
|
|
- "@apache-mynewt-core/kernel/os"
|
|
- "@apache-mynewt-core/sys/console/full"
|
|
- "@apache-mynewt-core/sys/log/full"
|
|
- "@apache-mynewt-core/sys/stats/full"
|
|
- nimble/controller
|
|
- nimble/host
|
|
- nimble/host/services/gap
|
|
- nimble/host/services/gatt
|
|
- nimble/transport/ram
|