We have a new power management system and those samples have been
written for specific boards and using the application based power
management subsystem. We are getting new tests/samples that are generic
with the new subsystem, so remove those in favor of the new ones.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This sample is linking the 'app' with 'subsys__bluetooth', which will
add zephyr/subsys/bluetooth to the include path of the app. But this
is unnecessary as the app already has this path on it's include path.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
If Server receives re-transmitted message then it will not
transmit corresponding publish message for it.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Added app_gpio.c & no_transition_work_handler.c to reduce
burden on main.c. It will simplify & help to understand
overall architecture.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Simplified algorithm behind states binding & target values calculation.
This has improved code readability.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Set BOARD variable in CMakeLists.txt for DMIC Sample App
Since this sample app is for intel_s1000_crb, setting BOARD
in CMakeLists.txt will eliminate the need to specify in
cmake command line every time during build.
Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
Move to latest cmake version with many bug fixes and enhancements.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
After this fix each LED will blink 5 times. Previously
LED_0 has been blining 6 times while others 5 times.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
STM32 uart Kconfig instance flags were not following
same naming scheme than other drivers (i2c, spi, ..)
Update driver to use UART_X instead of UART_STM32_PORT_X
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Now if Server receives re-transmitted messages from client then
it will not get completely ignored but respective GET & Publish
message will get release from Server side.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
As per Mesh Model Specification,
when a Server receives a Set message or a Set Unacknowledged message,
it shall set the state to the target field of the message,
unless the message has the same values for the SRC, DST, and TID
fields as the previous message received within the last 6 seconds.
This commit take care of this requirement.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
This commit's implementation update Vendor Model dummy response
value in vnd_get() instead of vnd_set_unack().
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Removed bug which get introduced by PR:9521. Because of it
not able to save App's variable on SoC flash.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
The Code need to be align after introduction of stream codec to
setting serialization subsystem.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Corrected state binding. With this commit Light Lightness
actual state would not cross its upper & lower limit.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Function names should have a verb as the last component.
As per this standard, rename some fuunctions names.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Due to recent changes some bugs had introduced in Gen. Level Move
GET & Publish functionalities. Now separatly introduced
gen_level_move_get() and gen_level_move_publisher() to resolved it.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
In Gen. OnOff Unack handler, gen_onoff_publisher(model) was
misplaced previously & now it is set to proper location.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
If transition time is not equal to Zero then & then only values
related to transition get calculated.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
If the first name is longer than HELLO_MAX sending would fail due to
there not being sufficient MIC space (or worse overrun the net_buf).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This code was still incorrectly causing corrupt strings to be
generated. Now it should be correct.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now if Gen. OnOff state set by client as '1' with some
transition time then value of Lightness will not jump to default
or last value instantly instead it would gradually increase during
that transition period.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Create independent function handlers for some Servers. This
would not initiate state binding if current state is equal to
Client requested state.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Inverse logic for onoff state while driving LED GPIO. For LED light on
GPIO pin is 0, 1 for LED light off.
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
System Power Management is only supported in Tickless Idle mode.
This patch modifies Kconfig dependencies to ensure System Power
Management option selects Tickless Idle one.
Fixes: #11046
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit will take back changes made by previous commit
i.e. fad8ff39c3.
This is beacause k_sleep() based delay is not behaving as
expected while testing & take more time than expected.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
This adds common option to disable support for LE Data Length Update
procedure in controller and host.
This will reduce flash usage by compiling out le_data_len_change
event handler that will never be called if controller has been
compiled with BT_CTLR_DATA_LENGTH option disabled.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds common option to disable support for PHY Update
procedure in controller and host.
This will reduce flash usage by compiling out le_phy_update_complete
event handler that will never be called if controller has been
compiled with BT_CTLR_PHY option disabled.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
With this commit now it is simple to understand flow of logic when
NODE receives any message & how it proceed things one by one.
Plus NODE will immediately send GET status to Client instead of
waiting for things which has less priority.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
The show_sensors_data() function tries to access val[2] when
outputting the Z-axis value, so the array must have at least three
elements. This also triggered Coverity CID 189741.
Fixes#11482
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This comparison was always supposed to be > rather than >=. Fixing
this also fixes Coverity CID 189740.
Fixes#11483
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There are a small handful of samples that still utilize <board.h>
include, to minimize the use of <board.h> to these specific cases and
allow us to remove adding the board dir to the top level include search
path, we explicitly in each sample add the specific board dir it needs.
For the microbit cases these could be replaced by DTS support in the
future when the pwm_nrf5_sw supports DTS.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Now states which are bound have single timer that means
means for lightness variation there is one timer & for
temperature variation there is one timer.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Corrected mapping of message handler for Generic
Move Set, Generic Move Set Unack, Light CTL Set &
Light CTL Set Unack.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Removed extra blank line. Add new
bound_states_transition_type_reassignment() function in
transition.c to improve code readability & understanding.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
This edition would improve by default mesh network
performance. This is after testing with nRFMesh app
from Nordic Semiconductor.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
We should let drivers or board code include soc.h directly so we can keep
board.h to local info for board specific code.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
These changes were obtained by running a script created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:
1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
#define X Y)
3. Check if that name is also the name of a Kconfig option
3.a If it is, then do nothing
3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
(.c, .h, .ld)
Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.
Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
All labels containing "_<8-hex-digits>_" or "16550_<3or6-hex-digits>_"
in their names, assumed to be generated by the extracting script,
are updated with the DT_ prefix, to reflect the recent changes made
to the script.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Patch introduces sensor model to mesh badge application. Along with
model definition a sensor get message is implemented and handled on
server.
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
This patch introduces new screen to mesh_badge application. Sensor
screen shows measurements from board sensors updated every 2 seconds.
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
Change the label GPIO_KEYS_BUTTON_0_GPIO_CONTROLLER that is generated
for the DT node directly to the corresponding one generated through
the "sw0" alias (i.e. SW0_GPIO_CONTROLLER) to make it consistent with
other DT related labels used in this code (SW0_* and LED?_*).
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The way the code is structured the buffer is always guaranteed to be
large enough, however perform explicit termination anyway to avoid
Coverity warnings.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The DTS changes introduced in 7ae220c845
changes the naming of GPIO related macros. This updates the usage
of previous macros via DTS fixup.
Fixes#10993
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the GPIO info for the buttons into the dts, this lets us match what
all other boards are doing. Update some sample & test code to use the
dts generated SW0_GPIO_CONTROLLER define instead of SW0_GPIO_NAME.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We don't need board.h, but by including it we would end up picking up
stdio.h from somewhere which we need for sprintf. So just included
stdio.h and drop board.h
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Defined common publisher i.e. gen_level_publisher() for
all three gen. level related messahe handlers.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.
This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.
Signed-off-by: Reto Schneider <code@reto-schneider.ch>
Add a new "heartbeat" message so that number of hops between nodes can
be discovered. Also add a statistics page which can be toggled using a
long key press, showing local information and the top message senders.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If user aggresively vary the state then previous mechanism
failed to publish status of other bounded states since it
has to publish multiple things back to back.
This PR repair the things.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
If transition is in process, then as per current implementation bound
states only respond with Present value. But with this commit, now
bound states too would respond with present, target & remaining time
values in status response.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Redefine opcode values for Vendor Model to mimic like
Generic OnOff Server opcode values for sake of convenience.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Now in case of Generic Delta handler, if message with same TID
received after 6 seconds with same source address would consider
as new transaction instead of ignoring it.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
With this commit it is now possible to save some Mesh Model
Servers State on SoC flash. This impacts initialization &
state binding after NODE reset & that is why some additional
modification has done as per requirements & removed some
code & comments which are redundant as per current
implementation.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
In general, Bluetooth Mesh provisioning process could be failed
because of any reason. Using some h/w interrupt we can call
bt_mesh_reset() or something which will push device into factory
reset mode.
But with some actual products it is not always possible or feasible
to add extra h/w to achieve this goal.
This commit adds facility to push device into factory reset mode
using power reset. As per current implementation user have to
do 5 times reset so that gap between two consecutive reset
should not exceed 7 seconds.
Co-authored-by: Laczen JMS <laczenjms@gmail.com>
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
With this commit, IUT will send additional status responses
whenever required as per PTS requirements.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Separately defined functions for Servers. This would help
to send extra status responses whenever required.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.
Avoid short abbriviations and using full names for fs.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The Zephyr configuration system uses many different files in many
different formats. It makes it a lot easier for users to understand
what these files do if when we use the correct file extensions.
To this end we rename the dts.fixup files to the correct file
extension '.h'.
This is a breaking change for out-of-tree fixup files. Such files will
be detected and given an appropriate error message.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Every board that uses dts-enabled gpio drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_GPIO_DEVICE and
HAS_DTS_GPIO.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Every board that uses dts-enabled i2c drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_I2C_DEVICE and
HAS_DTS_I2C.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Adds a board-specific dts overlay and fixup file to the arduino_101
environmental sensing sample, in preparation for making the sensor
drivers require dts.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The Kconfig option CONFIG_BUILD_TIMESTAMP became unused when
BUILD_VERSION was introduced, but it's option and parts of it's
implementation was not completely cleaned from the repository.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.
The only directory excluded directory was ext/* since it contains
only imported code.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
As per PTS, IUT is expected to return success for the
Range Get messages (Light Lightness Range Get for
MMDL/SR/LLNS/BI-01-C, Light CTL Temperature Range Get
for MMDL/SR/LCTLS/BI-01-C). This commit take care of
this issue.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Now if transition (instantaneous or non-instantaneous) is due
to delta level, then state binding would be as per it.
This is as per 3.3.2.2.3 of Bluetooth Mesh Model
Specification.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Corrected spelling mistakes for content of enum defined in
transition.h & renamed some functions. Corrected comments
in main.c
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
With this it is possible to get proper target value & remaining
time in status response from Servers when transition in progress.
If transition is not in progress then those things would not
get integrate into status response. This is as per Bluetooth
Mesh Model specification.
It is inspired concept from Bluetooth Mesh Developer study
Guide.
Also updated Transition Time (TT) related parameter calculation.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Added Generic Default Transition Time Server & Client
Models names in list of Models supported by this App.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
This commit updates the power_mgr sample to use the dts-generated
defines instead of the aliases in board.h.
Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
This commit updates the onoff-app sample to use the dts-generated
defines instead of the aliases in board.h.
Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
This commit updates the onoff_level_lightning_vnd_app sample
to use the dts-generated defines instead of the aliases in board.h.
Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
I removed GPIO configuration from board files and enabled them
as default in driver Kconfig file. All boards had GPIO ports
enabled that is why I decided to enable it by default.
Power management example was changed to use new driver.
Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
With the recent changes to identity address handling the local
identity address is only guaranteed to be available once
settings_load() has been called. Move the initialization of dev_uuid
to the appropriate place.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.
Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.
To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.
This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.
The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Added transition time support. Now if NODE received optional
parameters then they would get entertained by it.
Added two new models that is Generic Default Transition Time
Server & Client resp. to complete overall architecture to
support newly introduced architecture.
With this it was possible to implement
gen_move_set/gen_move_set_unack message handlers.
Removed redundancy from App & revised overall implementation.
Fixed Bugs. Upgraded coding style. Added & replaced comments to
improve code readability. Improved printk messages.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Added time stamp based message filtering as per Bluetooth Mesh
Developer study guide for each Server. Now even if message
source address & TID is same even after 6 seconds then
that will get proceed otherwise will get ignored.
Coding style improvements.
If particular Server model receive Prohibited values as per
Mesh Model Specification then that message will not get entertained.
Now proper status code will get send if user upgrade
light_lightness_range_state & light_ctl_temperature_range_state.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Upgraded state binding algorithm & created separated
file for it. Moved light_default_status_init() from
device_composition.c to main.c. Shorten variables names
defined in struct light_lightness_state.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Fixing the min max range validation where condtions on
upper and lower bound are logically 'ANDed'. Fixing it
by logical ORing the result.
CID: 18325, 18326
Fixes Issue #9289
Fixes Issue #9290
Signed-off-by: Subramanian Meenakshi Sundaram <subbu147@gmail.com>
Make it possible to have multiple identity addresses as an LE
peripheral. For central role only the default identity is supported
for now. This also extends the flash storage in a backward compatible
way.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
CMake has several prototypes/signatures for the function
'target_link_libraries'. This commit migrates the usage of
'target_link_libraries' on Zephyr CMake libraries from the old 'plain'
signature to the new '<PRIVATE|PUBLIC|INTERFACE>' signature.
For technical reasons the two signatures can not be mixed. Each
library must exclusively use either the old or new signature.
The 'old' plain signature is equivalent to using the PUBLIC
signature. Migrating to use 'PUBLIC' is therefore expected to be a
safe change.
After the migration it will be possible to use the PRIVATE and
INTERFACE signatures on Zephyr CMake libraries. This is useful for
instance to fix issue 8438.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The Mesh specification doesn't support more than 32 transport layer
segments, the way the number was so far derived from the advertising
buffer count could result in a highre numbe than 32, thereby wasting
memory. Make the number of supported segments build-time configurable
through a new BT_MESH_TX_SEG_MAX configuration option.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Do not enter Low Power states once the test execution is done. This
is needed to avoid the flashing issues which were seen when system
is in deep sleep states.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Removed redundant and unused config options from conf files.
Added separate files for handing power management and device
handling functions.
Added the PM policy based on the next timeout event instead of
simply advancing to the next power state.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
If temperature value are out of range which is from 0x0320
to 0x4E20 then no relevant get message handler will execute.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Added extra case under state binding's switch statement for
Lightness i.e DELTA_LEVEL. Also upgrade binding between
1. root element's LEVEL state & Light Lightness Actual state.
2. Light Lightness Linear state & Light Lightness Actual state.
3. Light CTL lightness state & Light Lightness Actual state
This is as per Bluetooth Mesh Model Specification 3.3.2.2.3.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Now on reboot, NODE as client do not start message publishing
with TID = 1. Instead of that it would start with any random value
from 0 to 255.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Improved code readability by declaring some pre-processor
definitions in device_composition.c
Remove model_instance variable from some structures define in
device_composition.h & its relevant code.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Update Vendor model message handlers & make it to work as per
TID like other Models defined by SIG. Removed union based data
extraction mechanism.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Updated state Binding as per PTS test requirements. Now if
gen_onoff_server & gen_onpowerup_server received Prohibited values
then they will not react on it further. Plus make necessary changes
wherever required for message handlers as per Mesh Model
Specification which is mostly regarding to default & range values.
Now right Status code would get publish in response to set lightness
& temperature range. Also upgrade Message handler
gen_delta_set_unack() algorithm as per PTS requirements.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Removed redundancy from state binding & make it simplified.
Avoid partial state binding in case of state_binding() function
get called with invalid or IGNORE arguments.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Changes buffer length for all GET handlers as per patter of
< 2 + parameters length (in bytes) + 4 >
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
This patched improved architecture of already implemented Vendor
Model. Now there are 4 separate opcodes for Vendor viz;
get, set, set_unack & status. This helps to setup
<command + response> mechanism.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Removed TID implementations wherever it is not required as per
Bluetooth SIG Mesh Model Specification. Removed unnecessary
comments. Add status code value to get publish along with
Light Lightness range status message.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Update message handlers & correct nubmber of bytes that every
handlers should fetch for their further processing as per
Bluetooth SIG Mesh Model Specification.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Make corrections in state binding of Servers as per Mesh Model
Specifications. Previously, when OnPowerUp state equal to 0x02,
then Light Lightness actual state was not assign to last power
down value. Plus when Generic OnOff state changes by client,
then Light Lightness Actual state value get assigned as Light
Lightness Last value instead of default one.
All these issues has fixed here.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
This is a application demonstrating a Bluetooth mesh node in
which Root element has following models
- Generic OnOff Server
- Generic OnOff Client
- Generic Level Server
- Generic Level Client
- Generic Power OnOff Server
- Generic Power OnOff Setup Server
- Generic Power OnOff Client
- Light Lightness Server
- Light Lightness Setup Server
- Light Lightness Client
- Light CTL Server
- Light CTL Setup Server
- Light CTL Client
- Vendor Model
And Secondary element has following models
- Generic OnOff Server
- Generic OnOff Client
- Generic Level Server
- Generic Level Client
- Light CTL Temperature Server
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
With updates to bt_gatt_notify and bt_gatt_indicate it is now possible
to pass the Characteristic attribute instead of its value which makes
the code able to verify if attribute properties are set correctly.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Test ArgonKey board. It provides an example of how to test
all the sensors on-board. It currently enables by default
following sensors:
LPS22HB pressure/temp
HTS221 humidity
LSM6DSL accel/gyro plus LIS2MDL magn connected to it.
VL53L0x proximity
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Minimal driver for ILI9340 LCD display driver including support
for adafruit 2.2" LCD display (1480)
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
Use zephyr-app-commands for portability instead of assuming Make and
Unix, and add a missing "run" goal.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
This ensures the every characteristic has a value attribute declared
with the same UUID since the old macro did not declare the value the
application would normally have to declare one itself using a different
UUID which is not allowed.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Keeping the model struct same sized, change the element pointer to two
indexes, and add a flags member that will be used to track pending
storage actions.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add hardware dependencies and filters to make sure we do not explode if
for example we try to build a sample/test using rtc when the platform
does not support that.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This test prints out to the console, when testing on real hardware,
parse output and compare to what we are expecting to avoid timeouts.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Some device include a temperature sensor, usually used as a
companion for helping in drift compensation, that measure the
die temperature. This temperature IS NOT related to the the
ambient temperature, hence a clean separation between the two
is required.
This commit introduces a clean separation between the two
types of temperature leaving the old deprecated definition
still there.
The list of current drivers that read the die (and not the ambient)
temperature is the following:
- adxl362
- bma280
- bmg160
- bmi160
- fxos8700
- lis3mdl
- lsm6ds0
- lsm6dsl
- lsm9ds0
- mpu6050
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Convert the mesh code to use the new net_buf_siple APIs. This has the
benefit of saving 4 bytes off the stack due to the not needed pointer.
Also update the publication context helpers to map to the new
net_buf_simple API in an intuitive way.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Application should normally declare a bt_uuid with proper type and then
use bt_uuid_cmp.
Fixes#5162
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Two docs listed in the Samples an Demos TOC had the same title displayed
in the board-specific samples section, "Power Management Demo". Give
both sample docs a more specific title.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Based on the discussion in #5693, the reason why humidity was defined
in milli-percent was likely following Linux which defines it as such
in its sensor subsystem:
http://elixir.free-electrons.com/linux/latest/source/Documentation/ABI/testing/sysfs-bus-iio#L263
However, Linux defines temperature in milli-degrees either, but
Zephyr uses degrees (similarly for most other quantities). Typical
sensor resolution/precision for humidity is also on the order of 1%.
One of the existing drivers, th02.c, already returned values in
percents, and few apps showed it without conversion and/or units,
leading to confusing output to user like "54500".
So, switching units to percents, and update all the drivers and
sample apps.
For few drivers, there was also optimized conversion arithmetics
to avoid u64_t operations. (There're probably more places to
optimize it, and temperature conversion could use such optimization
too, but that's left for another patch.)
Fixes: #5693
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
A few lines earlier the code bails out in case len is 0. Checking for
buf->len < 1 is the same as checking for buf->len == 0. Since len is
guaranteed to be > 0 here the check len > buf->len implicitly checks
for buf->len == 0, i.e. the second test can be removed.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Depending on a path inside the Zephyr tree to determine if we are a test
does not scale. Also some samples were marked as TEST while they are
not, just to get some options defined for tests.
Idenitfying a test will be addressed in another patch introducing
CONFIG_TEST.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Remove build_only and add harness type needed for the sample/test to
allow running with sanitycheck and on devices once we have harness
support.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
It is only necessary to link with subsys__bluetooth if the path
"subsys/bluetooth" is needed as an include directory. None of the
samples have this need.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Steve Brown <sbrown@cortland.com>
---
The updates to BlueZ' meshctl have not been submitted.
I am submitting this PR only for review. It could be committed
after the patches for the meshctl commands are applied.
Increase sleep time for main thread (1 sec to 1 minute) to keep SOC
in Low Power State for longer time. Currently nrf SOC is entering into
low power state and exiting immedately after 1 sec.
With this change SOC will wake stay in Low Power State till GPIO is
pressed or sleep time expired (whichever is earlier).
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
For an unknown reason, various samples in KBuild were including
Makefile.test, this had some desired benefits, one of which is that
the popular BOOT_BANNER appears. The CMake-equivalent of including
Makefile.test is setting the flag IS_TEST. This commit reverts the
behaviour of the samples back to how it was pre-cmake.
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.
Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.
This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.
For users that just want to continue their work with minimal
disruption the following should suffice:
Install CMake 3.8.2+
Port any out-of-tree Makefiles to CMake.
Learn the absolute minimum about the new command line interface:
$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..
$ cd build
$ make
PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
This sample tesecase provides sample code :-
1. Triggers Low Power tasks into nrf52 SOC (CONST LAT and LOW PWR)
2. Triggers System Off state.
3. Wake up device through port Event by GPIO (Button 1).
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
The code was causing only one byte of data to be placed in timeout
instead of sizeof(timeout) as intended.
Coverity-CID: 170744
Fixes#4057
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.
Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Upcoming memory protection features will be placing some additional
constraints on kernel objects:
- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.
Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.
It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.
There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.
k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The worst-case maximum number of CCC entries we need is actually
MAX_CONN + MAX_PAIRED. Provide a helper define for it and use it
whenever appropriate.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This adds bt_gatt_register_service using bt_gatt_service which contains
the attribute array that is then added to the database saving a pointer
in each and every attribute declared.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
GAP is mandatory service and now that the db can only be build
dynamically there is no reason to keep the applications registering it.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Removes CONFIG_BLUETOOTH_GATT_DYNAMIC_DB in preparation to the
introduction of bt_gatt_unregister.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The state machine of the game assumes that the user needs to
explicitly re-select multiplayer game when disconnected. We need to
therefore make sure that advertising stays off as soon as the first
connection happens.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Occasionally the sound might stay enabled for the restart timeout (2
seconds) if the ball would hit the wall right before missing the
paddle. Ensure that it's disabled whenever the game ends.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The buttons on the microbit cause quite easily "ghost" key presses.
Add a simple filter that ignores button presses from the same button
that happen less than 100ms from each other.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The stuff that the GPIO button callback does (in particular the printk
calls) requires more stack space from the ISR stack. Increase it to 1k
from the default 640.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add beeps whenever the ball hits the walls or the paddle. Requires a
piezo buzzer connected to pin 0.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add initial draft of a pong game using the display on the micro:bit
and its two buttons. This draft only supports a solo game where the
ball bounces from the "roof" and lets the player play against himself.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.
Jira: ZEP-2051
Change-Id: I08c682bfc0b80dfa88de859e90a011bcd2db2762
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add a sample demonstrating sound output using PWM to a piezo buzzer
connected to the external edge connector port P0.
Change-Id: I8c0902fd935f2eb3b9979476a7540e7a0216ca63
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Both the string and image rendering may want to take advantage of
scrolling and sequential display capabilities. Consolidate the APIs so
that there's a single one for images (mb_display_image) and a single
one for strings (mb_display_print). Both take a duration parameter for
the per-frame duration as well as a mode parameter which specifies
sequential vs scrolling behavior as well as an optional looping flag.
Change-Id: Ia092d771e3f1b94afd494c7544dab988161c539e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.
Change-Id: Ib2d9b1cc4144bd84b1b89691a80dffd99212289d
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Add a new mb_display_print() API which takes printf-style parameters
and outputs scrolling text instead of one character at a time. The
existing mb_display_str() API is renamed to mb_display_string() for
consistency, and now also takes printf-style parameters.
Change-Id: I59c42bcd74c62f05ecb6d097dc808b9e5c1984c5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Adds a simple driver to access the 5x5 LED display found on BBC
micro:bit boards. The display is so limited that no effort is done to
try to integrate with the existing console (which would likely make
the display unusable). Instead, dedicated mb_display_* APIs are added
that are specific to this display.
References:
https://www.microbit.co.uk/device/screenhttps://lancaster-university.github.io/microbit-docs/ubit/display/
Jira: ZEP-1990
Change-Id: I431b5b358b5f07592a60d3aed87eaab6ac20ce25
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>