When building the osdsp control_panel sample we get the following
compile error:
subsys/mgmt/osdp/src/osdp_cp.c:993:10: error: implicit declaration of
function 'osdp_cp_send_command_keyset'
Fix by adding ifdef protection around the call to
osdp_cp_send_command_keyset
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When waiting for data from CP, the data timeout check must happen before
no-data check. If not, a partial packet may endlessly hold PD in
"wait-for-data" state, while the PD keeps reporting status as online
till another packet is received.
Fix this my moving no-data check below the timeout check.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
All OSDP packets must start with a mark byte (0xFF) followed by a Start
of Message byte (0x53). Skip all bytes received until such a sequence is
seen to to avoid waking up the refresh thread needlessly.
Also, refactor osdp_uart_isr() to reduce number of local variables.
Fixes: #28168 Coverity-ID: 214218
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Minimize number of exported methods by unifying all osdp_cp_send_cmd_*()
as osdp_cp_send_command().
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
OSDP secure channel require a truly random number generator
source. Make this dependency explicit.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This patch adds Secure Channel capabilities to osdp Control Panel and
Peripheral Device modes.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.
Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
osdp_build_ctx() was returning fixed NULL and the subsequent code did
not check if ctx was NULL due to osdp_build_ctx() failures. Fix both
these issues.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
CP/PD mode selection is the most frequently looked-for/changed key in
Kconfig. Making that as the first entry for ease of use.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
OSDP subsys was doing a `select SERIAL` in its Kconfig. But this has
other unintended side effects. Change this to
`imply SERIAL_SUPPORT_INTERRUPT`.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Some of the names used in `struct osdp_cmd` where directly as in the
specification. Initially it appealed to keep them like that but with
time, a little more consistent naming of members helps if you haven't
read the specification document very recently.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Add a OSDP CP mode sample that sends out a periocic command to a
connected PD. It also demosnstrates key press and card read callback
registration.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Following the PD mode implementation (9a91b4ad), this patch adds support
for CP mode of operation in OSDP.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Some PD init sequence and other methods are useful in CP mode as well.
This patch refactors those methods to osdp_*(), moves them to common
source files and and exposes them from osdp_common.h.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
SERIAL_HAS_DRIVER and UART_INTERRUPT_DRIVEN should be selected by the
driver. If something needs is should dependson these options.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
TEST_RANDOM_GENERATOR should not be used in subsystems because it does
not generate truly random numbers. This is indented to be used only
for tests purpose.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
-Wimplicit-fallthrough=2 requires a fallthrough comment or a compiler
to tells gcc that this happens intentionally.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Open Supervised Device Protocol (OSDP) describes the communication
protocol for interfacing one or more Peripheral Devices (PD) to a
Control Panel (CP). The PDs are slave devices that waits for commands
from a CP. The communication happens over a RS485 multi-drop connection
with specification for a secure channel communication.
This patch adds initial support for OSDP in PD mode without secure
channel.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>