Skip to content

Commit

Permalink
rust, osdpctl: Add copyright header
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Feb 13, 2024
1 parent 9be1624 commit ae80e22
Show file tree
Hide file tree
Showing 24 changed files with 120 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osdpctl/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use anyhow::bail;
use anyhow::Context;
use configparser::ini::Ini;
Expand Down
5 changes: 5 additions & 0 deletions osdpctl/src/cp.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use std::{thread, time::Duration};

use crate::config::CpConfig;
Expand Down
5 changes: 5 additions & 0 deletions osdpctl/src/daemonize.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use anyhow::Context;
use daemonize::Daemonize;
use std::path::Path;
Expand Down
5 changes: 5 additions & 0 deletions osdpctl/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

mod config;
mod cp;
mod daemonize;
Expand Down
5 changes: 5 additions & 0 deletions osdpctl/src/pd.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use std::{thread, time::Duration};

use crate::config::PdConfig;
Expand Down
5 changes: 5 additions & 0 deletions rust/examples/cp.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use libosdp::{
channel::{OsdpChannel, UnixChannel},
ControlPanel, OsdpError, OsdpFlag, PdInfo,
Expand Down
5 changes: 5 additions & 0 deletions rust/examples/pd.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use libosdp::{
channel::{OsdpChannel, UnixChannel},
OsdpError, OsdpFlag, PdCapEntity, PdCapability, PdId, PdInfo, PeripheralDevice,
Expand Down
5 changes: 5 additions & 0 deletions rust/src/channel/memory_channel.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use alloc::sync::Arc;
use ringbuf::HeapRb;

Expand Down
5 changes: 5 additions & 0 deletions rust/src/channel/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

//! The OSDP specification defines that communication between OSDP devices
//! happen over an RS-485 connection. For testing and development purpose this
//! can be limiting so LibOSDP defines a notion called "Channel" which is a
Expand Down
5 changes: 5 additions & 0 deletions rust/src/channel/unix_channel.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

//! OSDP unix channel

use super::Channel;
Expand Down
5 changes: 5 additions & 0 deletions rust/src/cp.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

//! The CP is responsible to connecting to and managing multiple PDs. It is able
//! to send commands to and receive events from PDs.

Expand Down
5 changes: 5 additions & 0 deletions rust/src/file.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

//! OSDP provides a means to send files from CP to a Peripheral Device (PD).
//! This module adds the required components to achieve this effect.

Expand Down
5 changes: 5 additions & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

#![cfg_attr(not(feature = "std"), no_std)]
//! # LibOSDP - Open Supervised Device Protocol Library
//!
Expand Down
5 changes: 5 additions & 0 deletions rust/src/pd.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

//! OSDP specification defines end-point devices as PDs. These devices are
//! responsible for controlling various hardware peripherals (such as LEDs,
//! buzzers, Displays, GPIOs, etc.,) and exposing them in a portable manner to
Expand Down
5 changes: 5 additions & 0 deletions rust/src/types/commands.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

//! CP interacts with and controls PDs by sending commands to it. These commands
//! are specified by OSDP specification. This module is responsible to handling
//! such commands though [`OsdpCommand`].
Expand Down
5 changes: 5 additions & 0 deletions rust/src/types/events.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

//! OSDP PDs have to send messages to it's controlling unit - CP to intimate it
//! about various events that originate there (such as key press, card reads,
//! etc.,). They do this by creating an "event" and sending it to the CP. This
Expand Down
5 changes: 5 additions & 0 deletions rust/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

///! OSDP Command and Event Types
///!
///! This module is responsible to creating various types that can move between
Expand Down
5 changes: 5 additions & 0 deletions rust/src/types/pdcap.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use core::str::FromStr;

use crate::OsdpError;
Expand Down
5 changes: 5 additions & 0 deletions rust/src/types/pdid.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use super::ConvertEndian;

/// PD ID information advertised by the PD.
Expand Down
5 changes: 5 additions & 0 deletions rust/src/types/pdinfo.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use alloc::ffi::CString;

use crate::channel::OsdpChannel;
Expand Down
5 changes: 5 additions & 0 deletions rust/tests/commands.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use std::{sync::MutexGuard, thread, time};

use libosdp::{
Expand Down
5 changes: 5 additions & 0 deletions rust/tests/common/device.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use std::{
sync::{mpsc::Receiver, Arc, Mutex, MutexGuard},
thread, time,
Expand Down
5 changes: 5 additions & 0 deletions rust/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

pub mod device;
pub mod threadbus;

Expand Down
5 changes: 5 additions & 0 deletions rust/tests/common/threadbus.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Copyright (c) 2023-2024 Siddharth Chandrasekaran <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0

use multiqueue::{BroadcastReceiver, BroadcastSender};
use std::{
collections::hash_map::DefaultHasher,
Expand Down

0 comments on commit ae80e22

Please sign in to comment.