Skip to content

Instantly share code, notes, and snippets.

View alevy's full-sized avatar

Amit Levy alevy

View GitHub Profile
@alevy
alevy / ExampleView.vue
Created June 1, 2020 16:03
This is gross and doesn't compile cleanly, but it works!
<template>
<SubComponent
:myStream="myStream"
:me="me"
:room="room"
:participants="participants"
:chat="chat"
v-if="ready"
/>
</template>
@alevy
alevy / port_binding_design_doc.md
Created March 6, 2019 17:15
Port Binding Design Document

Network Security/Virtualization Design Document

This document describes the network security (and virtualization) goals for the 6LoWPAN stack on Tock.

Notably, this document does not encompass any discussion of BLE. Further, as the current 6LoWPAN stack only includes UDP as a transport layer, it does not include explicit discussion of TCP usage, though the design in this document should not preclude the use of this policy for TCP once implemented.

@alevy
alevy / sosp.rs
Created October 26, 2017 00:15
Capsule "Hello World" every second
//! Sample capsule for Tock course at SOSP. It handles an alarm to
//! sample the ambient light sensor.
use kernel::hil::time::{self, Alarm, Frequency};
use kernel::hil::sensors::{AmbientLight, AmbientLightClient};
pub struct Sosp<'a, A: Alarm + 'a> {
alarm: &'a A,
light: &'a AmbientLight,
}
@alevy
alevy / sosp.rs
Created October 26, 2017 00:14
Capsule "Hello World"
//! Sample capsule for Tock course at SOSP. It handles an alarm to
//! sample the ambient light sensor.
use kernel::hil::time::{self, Alarm, Frequency};
use kernel::hil::sensors::{AmbientLight, AmbientLightClient};
pub struct Sosp<'a, A: Alarm + 'a> {
alarm: &'a A,
light: &'a AmbientLight,
}
//! Sample capsule for Tock course at SOSP. It handles an alarm to
//! sample the ambient light sensor.
use kernel::hil::time::{self, Alarm, Frequency};
use kernel::hil::sensors::{AmbientLight, AmbientLightClient};
pub struct Sosp<'a, A: Alarm + 'a> {
alarm: &'a A,
light: &'a AmbientLight,
}
@alevy
alevy / accelerate.rs
Created August 18, 2017 03:55
Tock capsule "Hello World"
pub struct Accelerate;
impl Accelerate {
pub fn new() -> Accelerate {
Accelerate
}
pub fn start(&self) {
debug!("Hello World")
}
@alevy
alevy / accelerate.rs
Last active August 18, 2017 03:53
Tock capsule periodic accelerometer reading
use kernel::hil::time::{self, Alarm, Frequency};
use kernel::hil::sensors::{NineDof, NineDofClient};
pub struct Accelerate<'a, A: Alarm + 'a> {
alarm: &'a A,
ninedof: &'a NineDof
}
impl<'a, A: Alarm> Accelerate<'a, A> {
pub fn new(alarm: &'a A, ninedof: &'a NineDof) -> Accelerate<'a, A> {
@alevy
alevy / accelerate.rs
Last active August 18, 2017 03:52
Tock capsule periodic "Hello World"
use kernel::hil::time::{self, Alarm, Frequency};
pub struct Accelerate<'a, A: Alarm + 'a> {
alarm: &'a A
}
impl<'a, A: Alarm> Accelerate<'a, A> {
pub fn new(alarm: &'a A) -> Accelerate<'a, A> {
Accelerate {
alarm: alarm
@alevy
alevy / main.rs
Last active August 17, 2017 22:27
Rust Tock app that reports sensor data to `ble-env-sense` service
#![feature(alloc)]
#![no_std]
extern crate alloc;
extern crate tock;
use alloc::fmt::Write;
use tock::console::Console;
use tock::ipc::ble_ess::{self, ReadingType};
use tock::sensors::*;
@alevy
alevy / main.rs
Last active August 17, 2017 22:26
Rust Tock app that periodically samples the on-board sensors
#![feature(alloc)]
#![no_std]
extern crate alloc;
extern crate tock;
use alloc::fmt::Write;
use tock::console::Console;
use tock::sensors::*;