SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Brillo/Weave Part 2: Deep Dive
Open IoT Summit
Bruce Beare
April 2016
Acknowledgements…
Thank you to Google for the wonderful code labs and sample code.
Many of the examples and pictures are taken directly from the source
tree, code labs or screen shots of Google tools.
Deep Dive into Brillo* and Weave*
– Code Structure (was covered in the Intro presentation)
– Hardware Access Layer
– Code Labs
– Monitoring and Analytics
– Logging
Brillo* / Android* - HAL Structure
HALs are:
• Defined by Google* header files
• Common with Android (mostly)
• Not all implemented or required (yet)
hardware/libhardware/include/hardware:
activity_recognition.h bt_rc.h input.h
audio_alsaops.h bt_sdp.h keymaster0.h
audio_effect.h bt_sock.h keymaster1.h
audio.h camera2.h keymaster_common.h
audio_policy.h camera3.h keymaster_defs.h
bluetooth.h camera_common.h lights.h
boot_control.h camera.h local_time_hal.h
bt_av.h consumerir.h memtrack.h
bt_common_types.h fb.h nfc.h
bt_gatt_client.h fingerprint.h nfc_tag.h
bt_gatt.h fused_location.h power.h
bt_gatt_server.h gatekeeper.h qemud.h
bt_gatt_types.h gps.h qemu_pipe.h
bt_hf_client.h gralloc.h radio.h
bt_hf.h hardware.h sensors.h
bt_hh.h hdmi_cec.h sound_trigger.h
bt_hl.h hw_auth_token.h tv_input.h
bt_mce.h hwcomposer_defs.h vibrator.h
bt_pan.h hwcomposer.h
WiFi HAL
• Largely handled by wpa_supplicant
• Requires NL802.11 support
• Responsible for initialization
• Performs station/AP mode switching
• Brillo* specific HAL
hardware_brillo/wifi_driver_hal.h
typedef enum {
WIFI_MODE_STATION = 0,
WIFI_MODE_AP = 1
} wifi_driver_mode;
typedef struct wifi_driver_device {
hw_device_t common;
/**
* Initialize the driver. Network devices may or may not appear as
* a result.
*
* @return WIFI_SUCCESS if successful, or appropriate wifi_driver_error.
*/
wifi_driver_error (* wifi_driver_initialize)();
/**
* Start up the device in a specified mode. It is guaranteed that the
* wifi_driver_initialize function has been called prior to this. This
* function can be called multiple times to switch between modes.
*
* @param mode mode to start the driver up in.
* @param wifi_device_name_buf name of the device created (on success).
* @param wifi_device_name_size number of bytes available in device_name.
*
* @return WIFI_SUCCESS if successful, or appropriate wifi_driver_error.
*/
wifi_driver_error (* wifi_driver_set_mode)(wifi_driver_mode mode,
char* wifi_device_name_buf,
size_t wifi_device_name_size);
} wifi_driver_device_t;
Low-Speed Bus Interface Libraries
libupm
• High level implementations for many sensors
• C++ Class bindings
• Easy to use, modify, extend
• http://iotdk.intel.com/docs/master/upm/
libmraa
• I/O and bus access library
• Architecture Independant
• Supports many boards
• Bindings for C++, Python*, Java*, JavaScript
• http://iotdk.intel.com/docs/master/mraa/
C API Modules C++ API Classes
gpio Gpio class
i2c I2c class
aio Aio class
pwm Pwm class
spi Spi class
uart Uart class
common common
Supported platforms
Intel® Galileo Gen 1 - Rev D
Intel® Galileo Gen 2 - Rev H
Intel® Edison kit
Intel® NUC DE3815tykhe
Intel® Expansion Kit with Minnowboard MAX*
Raspberry Pi*
Banana Pi*/Pro
Beaglebone Black*
Intel® NUC NUC5i5MYBE
FTDI FT4222H
HAL Structure with libmraa, libupm
Application Daemons:
• Receive getter/setter requests via Weave
[binder as the internal transport]
• Are MAC access controlled via SELinux
• Instantiate libupm classes to implement a
particular sensor or device
• May call directly into libmraa for direct access
to pins and busses
• May make system calls directly for access to
non-mraa devices
Linux Kernel (access via /sys)
Hardware (i2c, i2s, i2o, gpio, pwm, ...)
libmraa
libupm
sensors lights display buttons motors steppers
Sensor
Daemon
Peripheral
Daemon
App DaemonApp DaemonApp Daemon
weaveweave weave
HAL
Sensor Service and HAL
A single process talks to the sensor HAL
• Race and bus issues are handled within the HAL
(libmraa and libupm can mutex if required)
• The HAL can talk either via libmraa, libupm... or
directly to the kernel
• The HAL upper layer is defined by:
hardware/libhardware/include/hardware/*.h
• The HAL lower layer is implemented by:
sensors.<device>.so and any code that is called by
the dynamic library.
Linux Kernel (access via /sys)
Hardware (i2c, i2s, i2o, gpio, pwm, ...)
libmraa.so
libupm.so
sensors buttons
Sensor Service
sensors.edison.so
binder.so
bionic.so
Intel’s Sensor HAL
• The i2c bus is auto-detected by libmraa
• The main thread sleeps if there is no event
available (power consumption friendly)
• Each activated sensor has a thread which
• periodically reads data from the sensor
• writes it to a pipe connected to the main
thread
Adding a sensor is very simple
• Just add a new file with the new Sensor
class and include it in Android.mk.
• Selection of the supported sensors can be
done at build time
poll(), read() - loop
Accelerometer
Thread
read_from_sensor()
write_to_pipe()
sleep(delay)
…
Light Thread
sleep(delay)
read_from_sensor()
write_to_pipe()
event
fifo
Sensor Client Sensor Client Sensor Client
Sensor Service
(daemon)
WeaveWeave* Weave
Peripheral Manager
• Arbitrate access to busses and pin multiplexers across processes
• SELinux security model for bus/device access
• Increase re-use of peripheral HALs
• Utilize Pin names for functions rather than board specific numbers
• Loadable (pluggable) HALs for specific devices
• ABI Stability, consistency and future sharing with Android
The Peripheral manager is likely to replace libmraa ... stay tuned
Other HALs in use by Brillo*
Audio HAL
• Android* Audio HAL, we support USB, I2S audio
Bluetooth* HAL
• Able to scan and advertise... waiting for Google* to complete the BT
framework.
Lights & Notification HAL
• Android Lights/notification, generally just turn on/off a GPIO
Storage HAL
• Direct access to the mounted file systems via C, C++
Calling a HAL directly
#include <err.h>
#include <stdio.h>
#include <unistd.h>
#include <hardware/hardware.h>
#include <hardware/lights.h>
int main() {
const hw_module_t* module = nullptr;
struct light_device_t* light_device = nullptr;
int ret = hw_get_module(LIGHTS_HARDWARE_MODULE_ID, &module);
if (ret || !module)
err(1, "Failed to load %s", LIGHTS_HARDWARE_MODULE_ID);
ret = module->methods->open(
module, LIGHT_ID_NOTIFICATIONS,
reinterpret_cast<struct hw_device_t**>(&light_device));
if (ret || !light_device)
err(1, "Failed to open %s", LIGHT_ID_NOTIFICATIONS);
struct light_state_t state = {
.color = 0,
.flashMode = LIGHT_FLASH_NONE,
.flashOnMS = 0,
.flashOffMS = 0,
.brightnessMode = 0,
};
// Turn light on for three seconds.
state.color = 1;
light_device->set_light(light_device, &state);
sleep(3);
// Flash for three seconds.
state.flashMode = LIGHT_FLASH_TIMED;
state.flashOnMS = 50;
state.flashOffMS = 50;
light_device->set_light(light_device, &state);
sleep(3);
// Turn light off.
state.color = 0;
state.flashMode = LIGHT_FLASH_NONE;
light_device->set_light(light_device, &state);
light_device->common.close(
reinterpret_cast<struct hw_device_t*>(light_device));
return 0;
}
Google* Code Labs
Step by Step Learning for Brillo* and Weave*
• Hello World for Brillo IO Programming
• Hello World Weave Integration
• Enable Google Services and APIs
• Web Service Development
http://developers.google.com/brillo
Brillo* Hello World (with libmraa)
https://codelabs.developers.google.com/codelabs/brillo-hello-leds-edison
• Download the BDK
• brunch: Add the BSP, build/flash the image
• Build the LED app program
• Flash the device
• Execute.... and watch the blinky lights
Project Setup
$ TOP=/build
$ export BDK_PATH=$TOP/bdk
$ cd $TOP
$ curl https://dl.google.com/dl/brillo/bdk/latest/bdk-latest.tar.gz
$ tar xf bdk-latest.tar.gz
$ cd $TOP/bdk
$ tools/bdk/brunch/brunch bsp download edison
$ mkdir $TOP/products && cd $TOP/products
$ ${BDK_PATH}/tools/bdk/brunch/brunch product create helloLEDs edison
$ cd $TOP/products/helloLEDs
$ echo hello_led_service >> config/packages
$ cd $TOP/products/helloLEDs/src
$ mkdir hello_led_service
Write your App, Build, Flash
hello_led_service/hello_led_service.cpp
#include <unistd.h>
#include <stdio.h>
#include <mraa.h>
int main(__unused int argc, __unused char* argv[]) {
const unsigned gpio[] = {0, 1, 2};
const int gpio_count = sizeof(gpio)/sizeof(*gpio);
mraa_gpio_context m_gpio[] = {NULL, NULL, NULL};
mraa_init();
for (int i = 0; i < gpio_count; i++) {
m_gpio[i] = mraa_gpio_init(gpio[i]);
if (!m_gpio[i])
return 1;
mraa_gpio_dir(m_gpio[i], MRAA_GPIO_OUT);
}
for (int iterations=0; iterations < 3; iterations++) {
for (int i = 0; i < gpio_count; i++) {
mraa_gpio_write(m_gpio[i], 1);
sleep(1);
}
for (int i = gpio_count-1; i >= 0; i--) {
mraa_gpio_write(m_gpio[i], 0);
sleep(1);
}
}
for (int i = 0; i < gpio_count; i++)
mraa_gpio_close(m_gpio[i]);
return 0;
}
Write your App, Build, Flash
hello_led_service/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := hello_led_service
LOCAL_SRC_FILES := hello_led_service.cpp
LOCAL_SHARED_LIBRARIES := libc libbase libmraa
LOCAL_CFLAGS := -Werror
include $(BUILD_EXECUTABLE)
$ cd ~/products/helloLEDs
$ source envsetup.sh
$ m –j 20
$ provision
$ fastboot reboot
$ adb shell hello_led_service
$ du -s -h .
13G .
$
Time Saver – Submodule Build and “adb sync”
$ cd src/hello_led_service/
$ touch hello_led_service.cpp
$ mm -j20
Building submodule only . . .
Output will be placed in /spare/PROD/helloLEDs/out
...
[ 14% 1/7] target C++: hello_led_service <= /spare/PROD/helloLEDs/src/hello_led_service/hello_led_service.cpp
...
#### make completed successfully (1 seconds) ####
$ adb root
restarting adbd as root
$ adb remount
remount succeeded
$ adb sync
/system/: 1 file pushed. 706 files skipped. 0.0 MB/s (5516 bytes in 0.225s)K
/data/: 0 files pushed. 7 files skipped.
$ adb shell hello_led_service
$
Google* Code Labs
• Hello World for Brillo IO Programming
• Hello World Weave Integration
• Enable Google Services and APIs
• Web Service Development
Binder integration with C++
Binder now has a fully supported C++ interface
• aidl compiler at: out/host/linux-x86/bin/aidl-cpp
• Generates a *.cpp file
• Compiles to a *.a and linked into the program
• Interface defined in:
frameworks/native/include/binder/IInterface.h
#define SERVICE "brillo.examples.ledflasher.ILEDService"
namespace brillo {
namespace examples {
namespace ledflasher {
IMPLEMENT_META_INTERFACE(LEDService, SERVICE);
} // namespace ledflasher
} // namespace examples
} // namespace brillo
product/google/example-ledflasher/src/:
common/Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libledservice-common
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_SRC_FILES := 
aidl/brillo/examples/ledflasher/ILEDService.aidl 
binder_constants.cpp
include $(BUILD_STATIC_LIBRARY)
common/aidl/brillo/examples/ledflasher/ILEDService.aidl:
package brillo.examples.ledflasher;
interface ILEDService {
void setLED(int ledIndex, boolean on);
boolean getLED(int ledIndex);
boolean[] getAllLEDs();
}
common/binder_constants.h:
namespace ledservice {
extern const char kBinderServiceName[];
}
common/binder_constants.cpp:
#include "binder_constants.h"
namespace ledservice {
const char kBinderServiceName[] = "example_led_service";
}
Weave* Schema
Weave requests are:
• sent from the web via XMPP over any
available network transport
• forwarded to the Brillo* application
server via the Binder
• Commands or states associations are
defined in a .json file installed on the
target
A Weave app (web, IOS, Android)
introspects the device capabilities and can
then construct an appropriate interface
…/ledflasher/etc/weaved/traits
$ cat ledflasher.json
{
"_ledflasher": {
"commands": {
"set": {
"minimalRole": "user",
"parameters": {
"led": {
"type": "integer",
"minimum": 1,
"maximum": 4
},
"on": { "type": "boolean" }
}
},
"toggle": {
"minimalRole": "user",
"parameters": {
"led": {
"type": "integer",
"minimum": 1,
"maximum": 4
Binding Weave* Handlers
New Coding Constructs:
• Google* has imported the use of WeakPtr from
Chromium*
• Google has imported the use of TaskRunner from
Chromium
https://www.chromium.org/developers/coding-style/important-
abstractions-and-data-structures
https://www.chromium.org/developers/design-documents/threading
#define WEAK_PTR_THIS weak_ptr_factory_.GetWeakPtr()
void Daemon::OnWeaveServiceConnected(
const std::weak_ptr<weaved::Service>& service) {
weave_service_ = service;
auto weave_service = weave_service_.lock();
if (!weave_service)
return;
weave_service->AddComponent(kWeaveComponent,
{kWeaveTrait}, nullptr);
weave_service->AddCommandHandler(
kWeaveComponent, kWeaveTrait, "set",
base::Bind(&Daemon::OnSet, WEAK_PTR_THIS));
weave_service->AddCommandHandler(
kWeaveComponent, kWeaveTrait, "toggle",
base::Bind(&Daemon::OnToggle, WEAK_PTR_THIS));
...
weave_service->SetPairingInfoListener(
base::Bind(&Daemon::OnPairingInfoChanged,
WEAK_PTR_THIS));
UpdateDeviceState();
}
Weave* Service Handler
• Invoked when a weave message is
received via the Binder
• Executed in a TaskRunner context
…/ledflasher/ledflasher.cpp
void Daemon::OnSet(std::unique_ptr<weaved::Command> command) {
if (!led_service_.get()) {
command->Abort("_system_error", "ledservice", nullptr);
return;
}
int index = command->GetParameter<int>("led");
if(index < 1 || index > 4) {
command->Abort("_invalid_parameter", "Invalid", nullptr);
return;
}
bool on = command->GetParameter<bool>("on");
android::binder::Status status =
led_service_->setLED(index - 1, on);
if (!status.isOk()) {
command->AbortWithCustomError(status, nullptr);
return;
}
animation_.reset();
status_ = "idle";
UpdateDeviceState();
command->Complete({}, nullptr);
}
Weave* Device State
Sent to the web via Weave whenever
device the state changes
void Daemon::UpdateDeviceState() {
if (!led_service_.get())
return;
std::vector<bool> leds;
if (!led_service_->getAllLEDs(&leds).isOk())
return;
auto weave_service = weave_service_.lock();
if (!weave_service)
return;
brillo::VariantDictionary state_change{
{"_ledflasher.status", status_},
{"_ledflasher.leds", leds},
};
weave_service->SetStateProperties
(kWeaveComponent, state_change, nullptr);
}
…/ledflasher/ledflasher.json:
{
"_ledflasher": {
...
"state": {
"status": {
"type": "string",
"enum": [ "idle", "animating" ]
},
"leds": {
"type": "array",
"items": { "type": "boolean" }
}
}
}
}
Build, Flash, Test
• Incremental builds are much quicker.
• USE_CCACHE=1 can speed rebuilds
• Either re-provision (flash) the device or
push the files out to the device
You are now ready to register your device
with the cloud
$ source envsetup.sh
Brillo Development Kit v.10.0.0 from /spare/AOSP
Available commands:
brunch, m, mm, adb, fastboot, provision, gdbclient.py
$ m -j20 USE_CCACHE=1
Output will be placed in /spare/PROD/ledflasher/out
...
[ 97% 35/36] build /spare/PROD/ledflasher/out/out-edison/target/product/edison/kernel
[100% 36/36] Target boot image: /spare/PROD/ledflasher/out/out-edison/target/product/edison/boot.img
#### make completed successfully (03:18 (mm:ss)) ####
$ adb root
adbd is already running as root
$ adb remount
$ adb sync
/system/: 5 files pushed. 702 files skipped. 1.1 MB/s (175755 bytes)
/data/: 0 files pushed. 7 files skipped.
$ adb reboot
$
Registering (provisioning) a Brillo* Device
https://codelabs.developers.google.com/codelabs/brillo-weave-leds
• Register (provision) your device from the
Chrome Browser
Android* Weave Application
https://play.google.com/apps/testing/com.google.android.weave
• Register (provision) your device
from Android
Sending Weave* Commands
Viewing Weave* Device State
Google* Code Labs
• Hello World for Brillo IO Programming
• Hello World Weave Integration
• Enable Google Services and APIs
• Web Service Development
Google* Cloud and Developer’s Consoles
https://console.cloud.google.com
https://console.developers.google.com
• Create Google Cloud Projects
• Enable API use
• Manage App Engine
• Manage Compute Engine
• Documentation
Weave* Developer’s Console
https://weave.google.com/console
Create a New Product (Cloud Project)
https://weave.google.com/console -> Your products
Google* Credentials Console
https://console.cloud.google.com/apis/credentials
• Your device keys were automatically created
for your project.
• Create your Browser and Web keys if you plan
to write a web client
Copy Identifiers and Keys to your Build
Environment weaved.conf
# OAuth 2.0 client id.
client_id=247106653574-
ki66j1e106dbhvpdk0o98t288fteneke.apps.googleusercontent.com
# OAuth 2.0 client secret.
client_secret=Mx8NSPEPdnAOHqYGzEByydOt
# API key.
api_key=AIzaSyCwqT2dpFFezXzLcrqaFqiRYdUMucUz2jU
# Human readable name of the device.
name=Lights on Edison
# Human readable description of the device.
# Defaults to empty string"
description=Blink lights on an Edison Development
Board
# Manufacturer of the device.
oem_name=FSMco
# Model of the device.
model_name=StarryNight
# Five character code assigned by the cloud registry
model_id=ABvGf
Google* Code Labs
• Hello World for Brillo IO Programming
• Hello World Weave Integration
• Enable Google Services and APIs
• Web Service Development
Web API Bindings
Implement Web Apps with a variety of programming languages:
• Shell (curl)
• Python
• Java
• JavaScript
Use https: to execute Google Cloud APIs.
Prototyping Weave commands with CURL
RESTful APIs
• Uniform Interface
• Stateless
• Cacheable
• Client-Server
• Layered System
• Code on Demand (optional)
JSON Data Format
OAuth Token for authentication
Prototype and test commands with CURL
• List all devices
• Get device information
• Insert (send) a Command to the device
https://developers.google.com/weave/guides/web-dev/web-service-dev
Sending RESTful commands via CURL
Device Commands:
• Delete
• Get
• handleInvitation
• List
• Patch
• patchState
• Udpate
• updateParent
• upsertLocalAuthInfo
https://developers.google.com/weave/v1/reference/cloud-api/devices
Shell/CURL Helper Functions
#!/bin/bash
# file “functions”
# Gets the client_id, client_secret from weaved.conf
eval $(egrep '^client_id=|^client_secret=' ../weaved.conf)
# Run authorize_account.sh to get the following token
refresh_token="1/sYKiBDwPbFO_PM1GI-UBYW1DO1jw09hqlui-AcVGdtU"
# Refresh the auth_token from the refresh token
# return the new auth_token
function auth_token {
curl -s -d "
refresh_token=$refresh_token&
client_id=$client_id&
client_secret=$client_secret&
grant_type=refresh_token" 
https://accounts.google.com/o/oauth2/token |
jq $@ '.access_token'
}
# Return the device id for the first found device
function device_id {
curl -s -H "Authorization: Bearer $(auth_token)" 
https://www.googleapis.com/clouddevices/v1/devices |
jq $@ '.devices[0].id'
}
# return the .json for the command definitions
function command_defs {
curl -s -H "Authorization: Bearer $(auth_token)" 
https://www.googleapis.com/clouddevices/v1/devices |
jq $@ '.devices[0].commandDefs'
}
Authorize Account and get a Refresh Token
#!/bin/bash
source functions
google-chrome "https://accounts.google.com/o/oauth2/auth?
scope=https://www.googleapis.com/auth/clouddevices&
redirect_uri=urn:ietf:wg:oauth:2.0:oob&
response_type=code&
client_id=$client_id"
echo -n "Enter the auth_code from the browser window: "
read auth_code
curl -d "
code=$auth_code&
client_id=$client_id&
client_secret=$client_secret&
redirect_uri=urn:ietf:wg:oauth:2.0:oob&
grant_type=authorization_code" https://accounts.google.com/o/oauth2/token
echo
echo "Copy the above refresh_token to the 'functions' file."
List All Registered Devices
#!/bin/bash
source ./functions
curl -s -H "Authorization: Bearer $(auth_token -r)" 
https://www.googleapis.com/clouddevices/v1/devices |
jq '.devices[].id'

"52c867ca-17d5-f422-a2c8-b31c4e02743e"
"e28ea71b-8115-cd76-4852-b08f9bd6faf0"
"3637ff18-2538-0973-fe01-d45d8a91e676"
"ed61c2fc-f7c9-0936-ce23-a498b1d9a3ad"
"64d6336a-5bba-c971-4f51-bb550a4a7529"
"be8edcaa-8e1b-c480-8595-c9cc335ec8d4"
"3242af3d-eb28-8ca8-0f20-4ddcdd112624"
"fd2437c0-f421-4ea2-05f9-4199e5c1ab2b"
https://developers.google.com/weave/v1/reference/cloud-api/devices/list
Get State for a Specific Device
#!/bin/bash
source ./functions
curl -s -H "Authorization: Bearer $(auth_token -r)" 
"https://www.googleapis.com/clouddevices/v1/devices/$(device_id -r)" |
jq '.state._ledflasher'

{
"leds": [
false,
false,
false,
false
],
"status": "idle"
}
https://developers.google.com/weave/v1/reference/cloud-api/devices/list
List available device commands
#!/bin/bash
source ./functions
curl -H "Authorization: Bearer $(auth_token -r)" 
"https://www.googleapis.com/weave/v1/commands?deviceId=$(device_id -r)"
{
"kind": "weave#commandsListResponse",
"commands": [
{
"kind": "weave#command",
"id": "52c867ca-17d5-f422-a2c8-b31c4e02743efdf8b212-d0a5-202e-d6d1-e0ee9727df97",
"deviceId": "52c867ca-17d5-f422-a2c8-b31c4e02743e",
"creatorEmail": "bbeare1.test@gmail.com",
"component": "base",
"name": "base.updateDeviceInfo",
"parameters": {
"name": "Bruce: Lights on Edison"
},
"state": "done",
"creationTimeMs": "1457726895466",
"expirationTimeMs": "1457726905466",
"expirationTimeoutMs": "10000"
},
{
"kind": "weave#command",
"id": "52c867ca-17d5-f422-a2c8-b31c4e02743e5d194dbc-dbc8-f4c2-16f2-6f01a9dd228b",
"deviceId": "52c867ca-17d5-f422-a2c8-b31c4e02743e",
"creatorEmail": "bbeare1.test@gmail.com",
"component": "base",
"name": "base.updateDeviceInfo",
"parameters": {
"location": "Home office"
},
"state": "done",
"creationTimeMs": "1457726873129",
"expirationTimeMs": "1457726883129",
"expirationTimeoutMs": "10000"
}
],
"totalResults": 2
}
https://developers.google.com/weave/v1/reference/cloud-api/devices/list
#!/bin/bash
source ./functions
body="{
'deviceId': $(device_id),
'name': '_ledflasher.set',
'parameters': {
'led': 1,
'on': true
}
}"
curl -H "Authorization: Bearer $(auth_token)" 
-H "Content-Type: application/json" -X POST 
-d "$body" 
https://www.googleapis.com/clouddevices/v1/commands
https://developers.google.com/weave/v1/reference/cloud-api/devices/list
Turn ON/OFF an LED
Google* Code Labs
Additional Topics
• Over the Air Updates
• IOS/Android Application Development
Questions?
Legal Notices and Disclaimers
Intel technologies’ features and benefits depend on system configuration and may require
enabled hardware, software or service activation. Learn more at intel.com, or from the
OEM or retailer.
No computer system can be absolutely secure.
Tests document performance of components on a particular test, in specific systems.
Differences in hardware, software, or configuration will affect actual performance. Consult
other sources of information to evaluate performance as you consider your purchase. For
more complete information about performance and benchmark results, visit
http://www.intel.com/performance.
Intel, the Intel logo and others are trademarks of Intel Corporation in the U.S. and/or other
countries. *Other names and brands may be claimed as the property of others.
© 2016 Intel Corporation.
Brillo/Weave Part 2: Deep Dive
Brillo/Weave Part 2: Deep Dive

Weitere ähnliche Inhalte

Was ist angesagt?

IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2John Staveley
 
Developing a NodeBot using Intel XDK IoT Edition
Developing a NodeBot using Intel XDK IoT EditionDeveloping a NodeBot using Intel XDK IoT Edition
Developing a NodeBot using Intel XDK IoT EditionIntel® Software
 
Overview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitOverview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitIntel® Software
 
Home Automation Using RPI
Home Automation Using  RPIHome Automation Using  RPI
Home Automation Using RPIAnkara JUG
 
DIY IoT: Raspberry PI 2 + Windows 10 for IoT devices + Microsoft Azure
DIY IoT: Raspberry PI 2 + Windows 10 for IoT devices + Microsoft AzureDIY IoT: Raspberry PI 2 + Windows 10 for IoT devices + Microsoft Azure
DIY IoT: Raspberry PI 2 + Windows 10 for IoT devices + Microsoft AzureIntersog
 
Industrial IoT with Intel IoT Gateway & Octoblu
Industrial IoT with Intel IoT Gateway & OctobluIndustrial IoT with Intel IoT Gateway & Octoblu
Industrial IoT with Intel IoT Gateway & OctobluIntel® Software
 
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive servicesBirdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive servicesJohn Staveley
 
Eclipse Edje: A Java API for Microcontrollers
Eclipse Edje: A Java API for MicrocontrollersEclipse Edje: A Java API for Microcontrollers
Eclipse Edje: A Java API for MicrocontrollersMicroEJ
 
Fullstack IoT Development
Fullstack IoT DevelopmentFullstack IoT Development
Fullstack IoT DevelopmentAndri Yadi
 
Creator IoT Framework
Creator IoT FrameworkCreator IoT Framework
Creator IoT FrameworkPaul Evans
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-PrototypingLars Gregori
 
Raspberry Pi introduction
Raspberry Pi introductionRaspberry Pi introduction
Raspberry Pi introductionLotfi Messaoudi
 
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...Marco Parenzan
 
Windows 10 iot core dot net notts - 27-07-15
Windows 10 iot core   dot net notts - 27-07-15Windows 10 iot core   dot net notts - 27-07-15
Windows 10 iot core dot net notts - 27-07-15Peter Gallagher
 
Federated Identity for IoT with OAuth2
Federated Identity for IoT with OAuth2Federated Identity for IoT with OAuth2
Federated Identity for IoT with OAuth2Paul Fremantle
 

Was ist angesagt? (20)

IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2
 
Developing a NodeBot using Intel XDK IoT Edition
Developing a NodeBot using Intel XDK IoT EditionDeveloping a NodeBot using Intel XDK IoT Edition
Developing a NodeBot using Intel XDK IoT Edition
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
 
Overview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitOverview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer Kit
 
IoT on Raspberry Pi
IoT on Raspberry PiIoT on Raspberry Pi
IoT on Raspberry Pi
 
Home Automation Using RPI
Home Automation Using  RPIHome Automation Using  RPI
Home Automation Using RPI
 
DIY IoT: Raspberry PI 2 + Windows 10 for IoT devices + Microsoft Azure
DIY IoT: Raspberry PI 2 + Windows 10 for IoT devices + Microsoft AzureDIY IoT: Raspberry PI 2 + Windows 10 for IoT devices + Microsoft Azure
DIY IoT: Raspberry PI 2 + Windows 10 for IoT devices + Microsoft Azure
 
Industrial IoT with Intel IoT Gateway & Octoblu
Industrial IoT with Intel IoT Gateway & OctobluIndustrial IoT with Intel IoT Gateway & Octoblu
Industrial IoT with Intel IoT Gateway & Octoblu
 
Azure Sphere
Azure SphereAzure Sphere
Azure Sphere
 
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive servicesBirdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
 
Eclipse Edje: A Java API for Microcontrollers
Eclipse Edje: A Java API for MicrocontrollersEclipse Edje: A Java API for Microcontrollers
Eclipse Edje: A Java API for Microcontrollers
 
Fullstack IoT Development
Fullstack IoT DevelopmentFullstack IoT Development
Fullstack IoT Development
 
Creator IoT Framework
Creator IoT FrameworkCreator IoT Framework
Creator IoT Framework
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-Prototyping
 
Raspberry Pi introduction
Raspberry Pi introductionRaspberry Pi introduction
Raspberry Pi introduction
 
Iot lab manual new
Iot lab manual newIot lab manual new
Iot lab manual new
 
Windows IoT
Windows IoTWindows IoT
Windows IoT
 
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
 
Windows 10 iot core dot net notts - 27-07-15
Windows 10 iot core   dot net notts - 27-07-15Windows 10 iot core   dot net notts - 27-07-15
Windows 10 iot core dot net notts - 27-07-15
 
Federated Identity for IoT with OAuth2
Federated Identity for IoT with OAuth2Federated Identity for IoT with OAuth2
Federated Identity for IoT with OAuth2
 

Andere mochten auch

L'uomo, motore della tecnologia
L'uomo, motore della tecnologiaL'uomo, motore della tecnologia
L'uomo, motore della tecnologiaFinecoBank
 
The Great Unbundling of Higher Education: Dystopia or Utopia?
The Great Unbundling of Higher Education: Dystopia or Utopia?The Great Unbundling of Higher Education: Dystopia or Utopia?
The Great Unbundling of Higher Education: Dystopia or Utopia?Mark Brown
 
Strong and weak syllables
Strong and weak syllablesStrong and weak syllables
Strong and weak syllablesRuth Infante
 
Pure Nectar Cold-Pressed Juice Franchise
Pure Nectar Cold-Pressed Juice FranchisePure Nectar Cold-Pressed Juice Franchise
Pure Nectar Cold-Pressed Juice FranchiseHarish Babla
 
Masterclass : Transformation Numérique du Sport
Masterclass : Transformation Numérique du SportMasterclass : Transformation Numérique du Sport
Masterclass : Transformation Numérique du SportJade BEUNOT
 
Comparative study on LIC V/S other insurances company
Comparative study on LIC V/S other insurances companyComparative study on LIC V/S other insurances company
Comparative study on LIC V/S other insurances companyTushar bhuwad
 
Animal Law Institute Presentation: The Tangled Web of China's Domestic Animal...
Animal Law Institute Presentation: The Tangled Web of China's Domestic Animal...Animal Law Institute Presentation: The Tangled Web of China's Domestic Animal...
Animal Law Institute Presentation: The Tangled Web of China's Domestic Animal...sharon methvin
 
Scrum Day UA 2017 - re-vers-ify
Scrum Day UA 2017 - re-vers-ifyScrum Day UA 2017 - re-vers-ify
Scrum Day UA 2017 - re-vers-ifyGunther Verheyen
 
“TO STUDY EMPLOYEE HEALTH, SAFETY AND WELFARE AT SUMUL DAIRY”
“TO STUDY EMPLOYEE HEALTH, SAFETY AND WELFARE AT SUMUL DAIRY”“TO STUDY EMPLOYEE HEALTH, SAFETY AND WELFARE AT SUMUL DAIRY”
“TO STUDY EMPLOYEE HEALTH, SAFETY AND WELFARE AT SUMUL DAIRY”Rishi Patel
 
Concierge development program 2016
Concierge development program 2016 Concierge development program 2016
Concierge development program 2016 Bagus Widi Kurnianto
 
Payments Trends 2017
Payments Trends 2017Payments Trends 2017
Payments Trends 2017Capgemini
 
10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
 10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot 10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
10 Things You Didn’t Know About Mobile Email from Litmus & HubSpotHubSpot
 
How to Earn the Attention of Today's Buyer
How to Earn the Attention of Today's BuyerHow to Earn the Attention of Today's Buyer
How to Earn the Attention of Today's BuyerHubSpot
 
25 Discovery Call Questions
25 Discovery Call Questions25 Discovery Call Questions
25 Discovery Call QuestionsHubSpot
 
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...HubSpot
 
Class 1: Email Marketing Certification course: Email Marketing and Your Business
Class 1: Email Marketing Certification course: Email Marketing and Your BusinessClass 1: Email Marketing Certification course: Email Marketing and Your Business
Class 1: Email Marketing Certification course: Email Marketing and Your BusinessHubSpot
 

Andere mochten auch (19)

L'uomo, motore della tecnologia
L'uomo, motore della tecnologiaL'uomo, motore della tecnologia
L'uomo, motore della tecnologia
 
The Great Unbundling of Higher Education: Dystopia or Utopia?
The Great Unbundling of Higher Education: Dystopia or Utopia?The Great Unbundling of Higher Education: Dystopia or Utopia?
The Great Unbundling of Higher Education: Dystopia or Utopia?
 
Strong and weak syllables
Strong and weak syllablesStrong and weak syllables
Strong and weak syllables
 
Pure Nectar Cold-Pressed Juice Franchise
Pure Nectar Cold-Pressed Juice FranchisePure Nectar Cold-Pressed Juice Franchise
Pure Nectar Cold-Pressed Juice Franchise
 
Masterclass : Transformation Numérique du Sport
Masterclass : Transformation Numérique du SportMasterclass : Transformation Numérique du Sport
Masterclass : Transformation Numérique du Sport
 
Comparative study on LIC V/S other insurances company
Comparative study on LIC V/S other insurances companyComparative study on LIC V/S other insurances company
Comparative study on LIC V/S other insurances company
 
Animal Law Institute Presentation: The Tangled Web of China's Domestic Animal...
Animal Law Institute Presentation: The Tangled Web of China's Domestic Animal...Animal Law Institute Presentation: The Tangled Web of China's Domestic Animal...
Animal Law Institute Presentation: The Tangled Web of China's Domestic Animal...
 
AWSKRUGの現状 (Sanguk Park) - JAWS Days 2017
AWSKRUGの現状 (Sanguk Park) - JAWS Days 2017AWSKRUGの現状 (Sanguk Park) - JAWS Days 2017
AWSKRUGの現状 (Sanguk Park) - JAWS Days 2017
 
Scrum Day UA 2017 - re-vers-ify
Scrum Day UA 2017 - re-vers-ifyScrum Day UA 2017 - re-vers-ify
Scrum Day UA 2017 - re-vers-ify
 
PT Agro Bukit RSPO Initial Assessment Summary Report
PT Agro Bukit RSPO Initial Assessment Summary ReportPT Agro Bukit RSPO Initial Assessment Summary Report
PT Agro Bukit RSPO Initial Assessment Summary Report
 
“TO STUDY EMPLOYEE HEALTH, SAFETY AND WELFARE AT SUMUL DAIRY”
“TO STUDY EMPLOYEE HEALTH, SAFETY AND WELFARE AT SUMUL DAIRY”“TO STUDY EMPLOYEE HEALTH, SAFETY AND WELFARE AT SUMUL DAIRY”
“TO STUDY EMPLOYEE HEALTH, SAFETY AND WELFARE AT SUMUL DAIRY”
 
Concierge development program 2016
Concierge development program 2016 Concierge development program 2016
Concierge development program 2016
 
News SA 11 2017
News SA 11 2017News SA 11 2017
News SA 11 2017
 
Payments Trends 2017
Payments Trends 2017Payments Trends 2017
Payments Trends 2017
 
10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
 10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot 10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
10 Things You Didn’t Know About Mobile Email from Litmus & HubSpot
 
How to Earn the Attention of Today's Buyer
How to Earn the Attention of Today's BuyerHow to Earn the Attention of Today's Buyer
How to Earn the Attention of Today's Buyer
 
25 Discovery Call Questions
25 Discovery Call Questions25 Discovery Call Questions
25 Discovery Call Questions
 
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
Modern Prospecting Techniques for Connecting with Prospects (from Sales Hacke...
 
Class 1: Email Marketing Certification course: Email Marketing and Your Business
Class 1: Email Marketing Certification course: Email Marketing and Your BusinessClass 1: Email Marketing Certification course: Email Marketing and Your Business
Class 1: Email Marketing Certification course: Email Marketing and Your Business
 

Ähnlich wie Brillo/Weave Part 2: Deep Dive

Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitSulamita Garcia
 
IoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitIoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitVasily Ryzhonkov
 
Virtual platform
Virtual platformVirtual platform
Virtual platformsean chen
 
OneAPI dpc++ Virtual Workshop 9th Dec-20
OneAPI dpc++ Virtual Workshop 9th Dec-20OneAPI dpc++ Virtual Workshop 9th Dec-20
OneAPI dpc++ Virtual Workshop 9th Dec-20Tyrone Systems
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptxssuserb4d806
 
Android Industrial Mobility - Droidcon Italy - Turin 9-10 April 2015
Android Industrial Mobility - Droidcon Italy - Turin 9-10 April 2015Android Industrial Mobility - Droidcon Italy - Turin 9-10 April 2015
Android Industrial Mobility - Droidcon Italy - Turin 9-10 April 2015Pietro F. Maggi
 
Perceptual Computing Workshop à Paris
Perceptual Computing Workshop à ParisPerceptual Computing Workshop à Paris
Perceptual Computing Workshop à ParisBeMyApp
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoTBartosz Kosarzycki
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104swena_gupta
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104swena_gupta
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104swena_gupta
 
DeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonDeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonGabriel Arnautu
 
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talkHES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talkHackito Ergo Sum
 
Android 5.0 Lollipop platform change investigation report
Android 5.0 Lollipop platform change investigation reportAndroid 5.0 Lollipop platform change investigation report
Android 5.0 Lollipop platform change investigation reporthidenorly
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Codemotion
 
Perceptual Computing Workshop in Munich
Perceptual Computing Workshop in MunichPerceptual Computing Workshop in Munich
Perceptual Computing Workshop in MunichBeMyApp
 

Ähnlich wie Brillo/Weave Part 2: Deep Dive (20)

Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
 
Начало работы с Intel IoT Dev Kit
Начало работы с Intel IoT Dev KitНачало работы с Intel IoT Dev Kit
Начало работы с Intel IoT Dev Kit
 
IoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitIoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT Devkit
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
OneAPI dpc++ Virtual Workshop 9th Dec-20
OneAPI dpc++ Virtual Workshop 9th Dec-20OneAPI dpc++ Virtual Workshop 9th Dec-20
OneAPI dpc++ Virtual Workshop 9th Dec-20
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
STM -32
STM -32STM -32
STM -32
 
learning STM -32
learning STM -32 learning STM -32
learning STM -32
 
Android Industrial Mobility - Droidcon Italy - Turin 9-10 April 2015
Android Industrial Mobility - Droidcon Italy - Turin 9-10 April 2015Android Industrial Mobility - Droidcon Italy - Turin 9-10 April 2015
Android Industrial Mobility - Droidcon Italy - Turin 9-10 April 2015
 
Pythonpresent
PythonpresentPythonpresent
Pythonpresent
 
Perceptual Computing Workshop à Paris
Perceptual Computing Workshop à ParisPerceptual Computing Workshop à Paris
Perceptual Computing Workshop à Paris
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoT
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
Lab report 201001067_201001104
Lab report 201001067_201001104Lab report 201001067_201001104
Lab report 201001067_201001104
 
DeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonDeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel Edison
 
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talkHES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
 
Android 5.0 Lollipop platform change investigation report
Android 5.0 Lollipop platform change investigation reportAndroid 5.0 Lollipop platform change investigation report
Android 5.0 Lollipop platform change investigation report
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Perceptual Computing Workshop in Munich
Perceptual Computing Workshop in MunichPerceptual Computing Workshop in Munich
Perceptual Computing Workshop in Munich
 

Mehr von Jalal Rohani

پسماند و اقتصاد چرخشی تهران
پسماند و اقتصاد چرخشی تهرانپسماند و اقتصاد چرخشی تهران
پسماند و اقتصاد چرخشی تهرانJalal Rohani
 
Hamad Bin Khalifa University Strategic Plan 2016 – 2026
Hamad Bin Khalifa University Strategic Plan 2016 – 2026Hamad Bin Khalifa University Strategic Plan 2016 – 2026
Hamad Bin Khalifa University Strategic Plan 2016 – 2026Jalal Rohani
 
Introduction to Hamad Bin Khalifa University - Qatar
Introduction to Hamad Bin Khalifa University - QatarIntroduction to Hamad Bin Khalifa University - Qatar
Introduction to Hamad Bin Khalifa University - QatarJalal Rohani
 
Kryptsy Cryptocurrency - Bitcoin Mining Farm
Kryptsy Cryptocurrency - Bitcoin Mining FarmKryptsy Cryptocurrency - Bitcoin Mining Farm
Kryptsy Cryptocurrency - Bitcoin Mining FarmJalal Rohani
 
R3 | Analytics, Insight and RA for MVAS economy
R3 | Analytics, Insight and RA for MVAS economy R3 | Analytics, Insight and RA for MVAS economy
R3 | Analytics, Insight and RA for MVAS economy Jalal Rohani
 
Digital Marketing - Strategy, Planning & Execution - Part 2
Digital Marketing - Strategy, Planning & Execution - Part 2Digital Marketing - Strategy, Planning & Execution - Part 2
Digital Marketing - Strategy, Planning & Execution - Part 2Jalal Rohani
 
Digital Marketing - Strategy, Planning & Execution - Part 1
Digital Marketing - Strategy, Planning & Execution - Part 1Digital Marketing - Strategy, Planning & Execution - Part 1
Digital Marketing - Strategy, Planning & Execution - Part 1Jalal Rohani
 
Digital Marketing for Fashion and Apparel - بازاریابی مد و پوشاک
Digital Marketing for Fashion and Apparel - بازاریابی مد و پوشاکDigital Marketing for Fashion and Apparel - بازاریابی مد و پوشاک
Digital Marketing for Fashion and Apparel - بازاریابی مد و پوشاکJalal Rohani
 
بازاریابی، با کمی دقت و سرعت بیشتر | Marketing and AI
بازاریابی، با کمی دقت و سرعت بیشتر | Marketing and AIبازاریابی، با کمی دقت و سرعت بیشتر | Marketing and AI
بازاریابی، با کمی دقت و سرعت بیشتر | Marketing and AIJalal Rohani
 
Claritas Prizm - Behavioral Customer Segmentation
Claritas Prizm - Behavioral Customer SegmentationClaritas Prizm - Behavioral Customer Segmentation
Claritas Prizm - Behavioral Customer SegmentationJalal Rohani
 
An Introduction to BitCoin and Cryptocurrency Ecosystem
An Introduction to BitCoin and Cryptocurrency EcosystemAn Introduction to BitCoin and Cryptocurrency Ecosystem
An Introduction to BitCoin and Cryptocurrency EcosystemJalal Rohani
 
An introduction to Online Focus Group
An introduction to Online Focus GroupAn introduction to Online Focus Group
An introduction to Online Focus GroupJalal Rohani
 
12 Angry Men - Characters
12 Angry Men - Characters12 Angry Men - Characters
12 Angry Men - CharactersJalal Rohani
 

Mehr von Jalal Rohani (14)

پسماند و اقتصاد چرخشی تهران
پسماند و اقتصاد چرخشی تهرانپسماند و اقتصاد چرخشی تهران
پسماند و اقتصاد چرخشی تهران
 
Hamad Bin Khalifa University Strategic Plan 2016 – 2026
Hamad Bin Khalifa University Strategic Plan 2016 – 2026Hamad Bin Khalifa University Strategic Plan 2016 – 2026
Hamad Bin Khalifa University Strategic Plan 2016 – 2026
 
Introduction to Hamad Bin Khalifa University - Qatar
Introduction to Hamad Bin Khalifa University - QatarIntroduction to Hamad Bin Khalifa University - Qatar
Introduction to Hamad Bin Khalifa University - Qatar
 
Kryptsy Cryptocurrency - Bitcoin Mining Farm
Kryptsy Cryptocurrency - Bitcoin Mining FarmKryptsy Cryptocurrency - Bitcoin Mining Farm
Kryptsy Cryptocurrency - Bitcoin Mining Farm
 
R3 | Analytics, Insight and RA for MVAS economy
R3 | Analytics, Insight and RA for MVAS economy R3 | Analytics, Insight and RA for MVAS economy
R3 | Analytics, Insight and RA for MVAS economy
 
Digital Marketing - Strategy, Planning & Execution - Part 2
Digital Marketing - Strategy, Planning & Execution - Part 2Digital Marketing - Strategy, Planning & Execution - Part 2
Digital Marketing - Strategy, Planning & Execution - Part 2
 
Digital Marketing - Strategy, Planning & Execution - Part 1
Digital Marketing - Strategy, Planning & Execution - Part 1Digital Marketing - Strategy, Planning & Execution - Part 1
Digital Marketing - Strategy, Planning & Execution - Part 1
 
Digital Marketing for Fashion and Apparel - بازاریابی مد و پوشاک
Digital Marketing for Fashion and Apparel - بازاریابی مد و پوشاکDigital Marketing for Fashion and Apparel - بازاریابی مد و پوشاک
Digital Marketing for Fashion and Apparel - بازاریابی مد و پوشاک
 
بازاریابی، با کمی دقت و سرعت بیشتر | Marketing and AI
بازاریابی، با کمی دقت و سرعت بیشتر | Marketing and AIبازاریابی، با کمی دقت و سرعت بیشتر | Marketing and AI
بازاریابی، با کمی دقت و سرعت بیشتر | Marketing and AI
 
What is Brillo
What is BrilloWhat is Brillo
What is Brillo
 
Claritas Prizm - Behavioral Customer Segmentation
Claritas Prizm - Behavioral Customer SegmentationClaritas Prizm - Behavioral Customer Segmentation
Claritas Prizm - Behavioral Customer Segmentation
 
An Introduction to BitCoin and Cryptocurrency Ecosystem
An Introduction to BitCoin and Cryptocurrency EcosystemAn Introduction to BitCoin and Cryptocurrency Ecosystem
An Introduction to BitCoin and Cryptocurrency Ecosystem
 
An introduction to Online Focus Group
An introduction to Online Focus GroupAn introduction to Online Focus Group
An introduction to Online Focus Group
 
12 Angry Men - Characters
12 Angry Men - Characters12 Angry Men - Characters
12 Angry Men - Characters
 

Kürzlich hochgeladen

Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...ranjana rawat
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...Pooja Nehwal
 
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaDubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaUnited Arab Emirates
 
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...Suhani Kapoor
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Pooja Nehwal
 
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...ranjana rawat
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...Pooja Nehwal
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查awo24iot
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)kojalkojal131
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...Amil baba
 
Thane Escorts, (Pooja 09892124323), Thane Call Girls
Thane Escorts, (Pooja 09892124323), Thane Call GirlsThane Escorts, (Pooja 09892124323), Thane Call Girls
Thane Escorts, (Pooja 09892124323), Thane Call GirlsPooja Nehwal
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikLow Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...Pooja Nehwal
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 

Kürzlich hochgeladen (20)

Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Sakshi Call 7001035870 Meet With Nagpur Escorts
 
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
Book Paid Lohegaon Call Girls Pune 8250192130Low Budget Full Independent High...
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
 
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai WisteriaDubai Call Girls O528786472 Call Girls In Dubai Wisteria
Dubai Call Girls O528786472 Call Girls In Dubai Wisteria
 
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
VIP Call Girls Kavuri Hills ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With ...
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006
 
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
 
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
(SANA) Call Girls Landewadi ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
 
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
 
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
 
Thane Escorts, (Pooja 09892124323), Thane Call Girls
Thane Escorts, (Pooja 09892124323), Thane Call GirlsThane Escorts, (Pooja 09892124323), Thane Call Girls
Thane Escorts, (Pooja 09892124323), Thane Call Girls
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service NashikLow Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
Low Rate Call Girls Nashik Vedika 7001305949 Independent Escort Service Nashik
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 

Brillo/Weave Part 2: Deep Dive

  • 1. Brillo/Weave Part 2: Deep Dive Open IoT Summit Bruce Beare April 2016
  • 2. Acknowledgements… Thank you to Google for the wonderful code labs and sample code. Many of the examples and pictures are taken directly from the source tree, code labs or screen shots of Google tools.
  • 3. Deep Dive into Brillo* and Weave* – Code Structure (was covered in the Intro presentation) – Hardware Access Layer – Code Labs – Monitoring and Analytics – Logging
  • 4. Brillo* / Android* - HAL Structure HALs are: • Defined by Google* header files • Common with Android (mostly) • Not all implemented or required (yet) hardware/libhardware/include/hardware: activity_recognition.h bt_rc.h input.h audio_alsaops.h bt_sdp.h keymaster0.h audio_effect.h bt_sock.h keymaster1.h audio.h camera2.h keymaster_common.h audio_policy.h camera3.h keymaster_defs.h bluetooth.h camera_common.h lights.h boot_control.h camera.h local_time_hal.h bt_av.h consumerir.h memtrack.h bt_common_types.h fb.h nfc.h bt_gatt_client.h fingerprint.h nfc_tag.h bt_gatt.h fused_location.h power.h bt_gatt_server.h gatekeeper.h qemud.h bt_gatt_types.h gps.h qemu_pipe.h bt_hf_client.h gralloc.h radio.h bt_hf.h hardware.h sensors.h bt_hh.h hdmi_cec.h sound_trigger.h bt_hl.h hw_auth_token.h tv_input.h bt_mce.h hwcomposer_defs.h vibrator.h bt_pan.h hwcomposer.h
  • 5. WiFi HAL • Largely handled by wpa_supplicant • Requires NL802.11 support • Responsible for initialization • Performs station/AP mode switching • Brillo* specific HAL hardware_brillo/wifi_driver_hal.h typedef enum { WIFI_MODE_STATION = 0, WIFI_MODE_AP = 1 } wifi_driver_mode; typedef struct wifi_driver_device { hw_device_t common; /** * Initialize the driver. Network devices may or may not appear as * a result. * * @return WIFI_SUCCESS if successful, or appropriate wifi_driver_error. */ wifi_driver_error (* wifi_driver_initialize)(); /** * Start up the device in a specified mode. It is guaranteed that the * wifi_driver_initialize function has been called prior to this. This * function can be called multiple times to switch between modes. * * @param mode mode to start the driver up in. * @param wifi_device_name_buf name of the device created (on success). * @param wifi_device_name_size number of bytes available in device_name. * * @return WIFI_SUCCESS if successful, or appropriate wifi_driver_error. */ wifi_driver_error (* wifi_driver_set_mode)(wifi_driver_mode mode, char* wifi_device_name_buf, size_t wifi_device_name_size); } wifi_driver_device_t;
  • 6. Low-Speed Bus Interface Libraries libupm • High level implementations for many sensors • C++ Class bindings • Easy to use, modify, extend • http://iotdk.intel.com/docs/master/upm/ libmraa • I/O and bus access library • Architecture Independant • Supports many boards • Bindings for C++, Python*, Java*, JavaScript • http://iotdk.intel.com/docs/master/mraa/ C API Modules C++ API Classes gpio Gpio class i2c I2c class aio Aio class pwm Pwm class spi Spi class uart Uart class common common Supported platforms Intel® Galileo Gen 1 - Rev D Intel® Galileo Gen 2 - Rev H Intel® Edison kit Intel® NUC DE3815tykhe Intel® Expansion Kit with Minnowboard MAX* Raspberry Pi* Banana Pi*/Pro Beaglebone Black* Intel® NUC NUC5i5MYBE FTDI FT4222H
  • 7. HAL Structure with libmraa, libupm Application Daemons: • Receive getter/setter requests via Weave [binder as the internal transport] • Are MAC access controlled via SELinux • Instantiate libupm classes to implement a particular sensor or device • May call directly into libmraa for direct access to pins and busses • May make system calls directly for access to non-mraa devices Linux Kernel (access via /sys) Hardware (i2c, i2s, i2o, gpio, pwm, ...) libmraa libupm sensors lights display buttons motors steppers Sensor Daemon Peripheral Daemon App DaemonApp DaemonApp Daemon weaveweave weave HAL
  • 8. Sensor Service and HAL A single process talks to the sensor HAL • Race and bus issues are handled within the HAL (libmraa and libupm can mutex if required) • The HAL can talk either via libmraa, libupm... or directly to the kernel • The HAL upper layer is defined by: hardware/libhardware/include/hardware/*.h • The HAL lower layer is implemented by: sensors.<device>.so and any code that is called by the dynamic library. Linux Kernel (access via /sys) Hardware (i2c, i2s, i2o, gpio, pwm, ...) libmraa.so libupm.so sensors buttons Sensor Service sensors.edison.so binder.so bionic.so
  • 9. Intel’s Sensor HAL • The i2c bus is auto-detected by libmraa • The main thread sleeps if there is no event available (power consumption friendly) • Each activated sensor has a thread which • periodically reads data from the sensor • writes it to a pipe connected to the main thread Adding a sensor is very simple • Just add a new file with the new Sensor class and include it in Android.mk. • Selection of the supported sensors can be done at build time poll(), read() - loop Accelerometer Thread read_from_sensor() write_to_pipe() sleep(delay) … Light Thread sleep(delay) read_from_sensor() write_to_pipe() event fifo Sensor Client Sensor Client Sensor Client Sensor Service (daemon) WeaveWeave* Weave
  • 10. Peripheral Manager • Arbitrate access to busses and pin multiplexers across processes • SELinux security model for bus/device access • Increase re-use of peripheral HALs • Utilize Pin names for functions rather than board specific numbers • Loadable (pluggable) HALs for specific devices • ABI Stability, consistency and future sharing with Android The Peripheral manager is likely to replace libmraa ... stay tuned
  • 11. Other HALs in use by Brillo* Audio HAL • Android* Audio HAL, we support USB, I2S audio Bluetooth* HAL • Able to scan and advertise... waiting for Google* to complete the BT framework. Lights & Notification HAL • Android Lights/notification, generally just turn on/off a GPIO Storage HAL • Direct access to the mounted file systems via C, C++
  • 12. Calling a HAL directly #include <err.h> #include <stdio.h> #include <unistd.h> #include <hardware/hardware.h> #include <hardware/lights.h> int main() { const hw_module_t* module = nullptr; struct light_device_t* light_device = nullptr; int ret = hw_get_module(LIGHTS_HARDWARE_MODULE_ID, &module); if (ret || !module) err(1, "Failed to load %s", LIGHTS_HARDWARE_MODULE_ID); ret = module->methods->open( module, LIGHT_ID_NOTIFICATIONS, reinterpret_cast<struct hw_device_t**>(&light_device)); if (ret || !light_device) err(1, "Failed to open %s", LIGHT_ID_NOTIFICATIONS); struct light_state_t state = { .color = 0, .flashMode = LIGHT_FLASH_NONE, .flashOnMS = 0, .flashOffMS = 0, .brightnessMode = 0, }; // Turn light on for three seconds. state.color = 1; light_device->set_light(light_device, &state); sleep(3); // Flash for three seconds. state.flashMode = LIGHT_FLASH_TIMED; state.flashOnMS = 50; state.flashOffMS = 50; light_device->set_light(light_device, &state); sleep(3); // Turn light off. state.color = 0; state.flashMode = LIGHT_FLASH_NONE; light_device->set_light(light_device, &state); light_device->common.close( reinterpret_cast<struct hw_device_t*>(light_device)); return 0; }
  • 13. Google* Code Labs Step by Step Learning for Brillo* and Weave* • Hello World for Brillo IO Programming • Hello World Weave Integration • Enable Google Services and APIs • Web Service Development http://developers.google.com/brillo
  • 14. Brillo* Hello World (with libmraa) https://codelabs.developers.google.com/codelabs/brillo-hello-leds-edison • Download the BDK • brunch: Add the BSP, build/flash the image • Build the LED app program • Flash the device • Execute.... and watch the blinky lights
  • 15. Project Setup $ TOP=/build $ export BDK_PATH=$TOP/bdk $ cd $TOP $ curl https://dl.google.com/dl/brillo/bdk/latest/bdk-latest.tar.gz $ tar xf bdk-latest.tar.gz $ cd $TOP/bdk $ tools/bdk/brunch/brunch bsp download edison $ mkdir $TOP/products && cd $TOP/products $ ${BDK_PATH}/tools/bdk/brunch/brunch product create helloLEDs edison $ cd $TOP/products/helloLEDs $ echo hello_led_service >> config/packages $ cd $TOP/products/helloLEDs/src $ mkdir hello_led_service
  • 16. Write your App, Build, Flash hello_led_service/hello_led_service.cpp #include <unistd.h> #include <stdio.h> #include <mraa.h> int main(__unused int argc, __unused char* argv[]) { const unsigned gpio[] = {0, 1, 2}; const int gpio_count = sizeof(gpio)/sizeof(*gpio); mraa_gpio_context m_gpio[] = {NULL, NULL, NULL}; mraa_init(); for (int i = 0; i < gpio_count; i++) { m_gpio[i] = mraa_gpio_init(gpio[i]); if (!m_gpio[i]) return 1; mraa_gpio_dir(m_gpio[i], MRAA_GPIO_OUT); } for (int iterations=0; iterations < 3; iterations++) { for (int i = 0; i < gpio_count; i++) { mraa_gpio_write(m_gpio[i], 1); sleep(1); } for (int i = gpio_count-1; i >= 0; i--) { mraa_gpio_write(m_gpio[i], 0); sleep(1); } } for (int i = 0; i < gpio_count; i++) mraa_gpio_close(m_gpio[i]); return 0; }
  • 17. Write your App, Build, Flash hello_led_service/Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := hello_led_service LOCAL_SRC_FILES := hello_led_service.cpp LOCAL_SHARED_LIBRARIES := libc libbase libmraa LOCAL_CFLAGS := -Werror include $(BUILD_EXECUTABLE) $ cd ~/products/helloLEDs $ source envsetup.sh $ m –j 20 $ provision $ fastboot reboot $ adb shell hello_led_service $ du -s -h . 13G . $
  • 18. Time Saver – Submodule Build and “adb sync” $ cd src/hello_led_service/ $ touch hello_led_service.cpp $ mm -j20 Building submodule only . . . Output will be placed in /spare/PROD/helloLEDs/out ... [ 14% 1/7] target C++: hello_led_service <= /spare/PROD/helloLEDs/src/hello_led_service/hello_led_service.cpp ... #### make completed successfully (1 seconds) #### $ adb root restarting adbd as root $ adb remount remount succeeded $ adb sync /system/: 1 file pushed. 706 files skipped. 0.0 MB/s (5516 bytes in 0.225s)K /data/: 0 files pushed. 7 files skipped. $ adb shell hello_led_service $
  • 19. Google* Code Labs • Hello World for Brillo IO Programming • Hello World Weave Integration • Enable Google Services and APIs • Web Service Development
  • 20. Binder integration with C++ Binder now has a fully supported C++ interface • aidl compiler at: out/host/linux-x86/bin/aidl-cpp • Generates a *.cpp file • Compiles to a *.a and linked into the program • Interface defined in: frameworks/native/include/binder/IInterface.h #define SERVICE "brillo.examples.ledflasher.ILEDService" namespace brillo { namespace examples { namespace ledflasher { IMPLEMENT_META_INTERFACE(LEDService, SERVICE); } // namespace ledflasher } // namespace examples } // namespace brillo product/google/example-ledflasher/src/: common/Android.mk: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libledservice-common LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) LOCAL_SRC_FILES := aidl/brillo/examples/ledflasher/ILEDService.aidl binder_constants.cpp include $(BUILD_STATIC_LIBRARY) common/aidl/brillo/examples/ledflasher/ILEDService.aidl: package brillo.examples.ledflasher; interface ILEDService { void setLED(int ledIndex, boolean on); boolean getLED(int ledIndex); boolean[] getAllLEDs(); } common/binder_constants.h: namespace ledservice { extern const char kBinderServiceName[]; } common/binder_constants.cpp: #include "binder_constants.h" namespace ledservice { const char kBinderServiceName[] = "example_led_service"; }
  • 21. Weave* Schema Weave requests are: • sent from the web via XMPP over any available network transport • forwarded to the Brillo* application server via the Binder • Commands or states associations are defined in a .json file installed on the target A Weave app (web, IOS, Android) introspects the device capabilities and can then construct an appropriate interface …/ledflasher/etc/weaved/traits $ cat ledflasher.json { "_ledflasher": { "commands": { "set": { "minimalRole": "user", "parameters": { "led": { "type": "integer", "minimum": 1, "maximum": 4 }, "on": { "type": "boolean" } } }, "toggle": { "minimalRole": "user", "parameters": { "led": { "type": "integer", "minimum": 1, "maximum": 4
  • 22. Binding Weave* Handlers New Coding Constructs: • Google* has imported the use of WeakPtr from Chromium* • Google has imported the use of TaskRunner from Chromium https://www.chromium.org/developers/coding-style/important- abstractions-and-data-structures https://www.chromium.org/developers/design-documents/threading #define WEAK_PTR_THIS weak_ptr_factory_.GetWeakPtr() void Daemon::OnWeaveServiceConnected( const std::weak_ptr<weaved::Service>& service) { weave_service_ = service; auto weave_service = weave_service_.lock(); if (!weave_service) return; weave_service->AddComponent(kWeaveComponent, {kWeaveTrait}, nullptr); weave_service->AddCommandHandler( kWeaveComponent, kWeaveTrait, "set", base::Bind(&Daemon::OnSet, WEAK_PTR_THIS)); weave_service->AddCommandHandler( kWeaveComponent, kWeaveTrait, "toggle", base::Bind(&Daemon::OnToggle, WEAK_PTR_THIS)); ... weave_service->SetPairingInfoListener( base::Bind(&Daemon::OnPairingInfoChanged, WEAK_PTR_THIS)); UpdateDeviceState(); }
  • 23. Weave* Service Handler • Invoked when a weave message is received via the Binder • Executed in a TaskRunner context …/ledflasher/ledflasher.cpp void Daemon::OnSet(std::unique_ptr<weaved::Command> command) { if (!led_service_.get()) { command->Abort("_system_error", "ledservice", nullptr); return; } int index = command->GetParameter<int>("led"); if(index < 1 || index > 4) { command->Abort("_invalid_parameter", "Invalid", nullptr); return; } bool on = command->GetParameter<bool>("on"); android::binder::Status status = led_service_->setLED(index - 1, on); if (!status.isOk()) { command->AbortWithCustomError(status, nullptr); return; } animation_.reset(); status_ = "idle"; UpdateDeviceState(); command->Complete({}, nullptr); }
  • 24. Weave* Device State Sent to the web via Weave whenever device the state changes void Daemon::UpdateDeviceState() { if (!led_service_.get()) return; std::vector<bool> leds; if (!led_service_->getAllLEDs(&leds).isOk()) return; auto weave_service = weave_service_.lock(); if (!weave_service) return; brillo::VariantDictionary state_change{ {"_ledflasher.status", status_}, {"_ledflasher.leds", leds}, }; weave_service->SetStateProperties (kWeaveComponent, state_change, nullptr); } …/ledflasher/ledflasher.json: { "_ledflasher": { ... "state": { "status": { "type": "string", "enum": [ "idle", "animating" ] }, "leds": { "type": "array", "items": { "type": "boolean" } } } } }
  • 25. Build, Flash, Test • Incremental builds are much quicker. • USE_CCACHE=1 can speed rebuilds • Either re-provision (flash) the device or push the files out to the device You are now ready to register your device with the cloud $ source envsetup.sh Brillo Development Kit v.10.0.0 from /spare/AOSP Available commands: brunch, m, mm, adb, fastboot, provision, gdbclient.py $ m -j20 USE_CCACHE=1 Output will be placed in /spare/PROD/ledflasher/out ... [ 97% 35/36] build /spare/PROD/ledflasher/out/out-edison/target/product/edison/kernel [100% 36/36] Target boot image: /spare/PROD/ledflasher/out/out-edison/target/product/edison/boot.img #### make completed successfully (03:18 (mm:ss)) #### $ adb root adbd is already running as root $ adb remount $ adb sync /system/: 5 files pushed. 702 files skipped. 1.1 MB/s (175755 bytes) /data/: 0 files pushed. 7 files skipped. $ adb reboot $
  • 26. Registering (provisioning) a Brillo* Device https://codelabs.developers.google.com/codelabs/brillo-weave-leds • Register (provision) your device from the Chrome Browser
  • 30. Google* Code Labs • Hello World for Brillo IO Programming • Hello World Weave Integration • Enable Google Services and APIs • Web Service Development
  • 31. Google* Cloud and Developer’s Consoles https://console.cloud.google.com https://console.developers.google.com • Create Google Cloud Projects • Enable API use • Manage App Engine • Manage Compute Engine • Documentation
  • 33. Create a New Product (Cloud Project) https://weave.google.com/console -> Your products
  • 34. Google* Credentials Console https://console.cloud.google.com/apis/credentials • Your device keys were automatically created for your project. • Create your Browser and Web keys if you plan to write a web client
  • 35. Copy Identifiers and Keys to your Build Environment weaved.conf # OAuth 2.0 client id. client_id=247106653574- ki66j1e106dbhvpdk0o98t288fteneke.apps.googleusercontent.com # OAuth 2.0 client secret. client_secret=Mx8NSPEPdnAOHqYGzEByydOt # API key. api_key=AIzaSyCwqT2dpFFezXzLcrqaFqiRYdUMucUz2jU # Human readable name of the device. name=Lights on Edison # Human readable description of the device. # Defaults to empty string" description=Blink lights on an Edison Development Board # Manufacturer of the device. oem_name=FSMco # Model of the device. model_name=StarryNight # Five character code assigned by the cloud registry model_id=ABvGf
  • 36. Google* Code Labs • Hello World for Brillo IO Programming • Hello World Weave Integration • Enable Google Services and APIs • Web Service Development
  • 37. Web API Bindings Implement Web Apps with a variety of programming languages: • Shell (curl) • Python • Java • JavaScript Use https: to execute Google Cloud APIs.
  • 38. Prototyping Weave commands with CURL RESTful APIs • Uniform Interface • Stateless • Cacheable • Client-Server • Layered System • Code on Demand (optional) JSON Data Format OAuth Token for authentication Prototype and test commands with CURL • List all devices • Get device information • Insert (send) a Command to the device https://developers.google.com/weave/guides/web-dev/web-service-dev
  • 39. Sending RESTful commands via CURL Device Commands: • Delete • Get • handleInvitation • List • Patch • patchState • Udpate • updateParent • upsertLocalAuthInfo https://developers.google.com/weave/v1/reference/cloud-api/devices
  • 40. Shell/CURL Helper Functions #!/bin/bash # file “functions” # Gets the client_id, client_secret from weaved.conf eval $(egrep '^client_id=|^client_secret=' ../weaved.conf) # Run authorize_account.sh to get the following token refresh_token="1/sYKiBDwPbFO_PM1GI-UBYW1DO1jw09hqlui-AcVGdtU" # Refresh the auth_token from the refresh token # return the new auth_token function auth_token { curl -s -d " refresh_token=$refresh_token& client_id=$client_id& client_secret=$client_secret& grant_type=refresh_token" https://accounts.google.com/o/oauth2/token | jq $@ '.access_token' } # Return the device id for the first found device function device_id { curl -s -H "Authorization: Bearer $(auth_token)" https://www.googleapis.com/clouddevices/v1/devices | jq $@ '.devices[0].id' } # return the .json for the command definitions function command_defs { curl -s -H "Authorization: Bearer $(auth_token)" https://www.googleapis.com/clouddevices/v1/devices | jq $@ '.devices[0].commandDefs' }
  • 41. Authorize Account and get a Refresh Token #!/bin/bash source functions google-chrome "https://accounts.google.com/o/oauth2/auth? scope=https://www.googleapis.com/auth/clouddevices& redirect_uri=urn:ietf:wg:oauth:2.0:oob& response_type=code& client_id=$client_id" echo -n "Enter the auth_code from the browser window: " read auth_code curl -d " code=$auth_code& client_id=$client_id& client_secret=$client_secret& redirect_uri=urn:ietf:wg:oauth:2.0:oob& grant_type=authorization_code" https://accounts.google.com/o/oauth2/token echo echo "Copy the above refresh_token to the 'functions' file."
  • 42. List All Registered Devices #!/bin/bash source ./functions curl -s -H "Authorization: Bearer $(auth_token -r)" https://www.googleapis.com/clouddevices/v1/devices | jq '.devices[].id'  "52c867ca-17d5-f422-a2c8-b31c4e02743e" "e28ea71b-8115-cd76-4852-b08f9bd6faf0" "3637ff18-2538-0973-fe01-d45d8a91e676" "ed61c2fc-f7c9-0936-ce23-a498b1d9a3ad" "64d6336a-5bba-c971-4f51-bb550a4a7529" "be8edcaa-8e1b-c480-8595-c9cc335ec8d4" "3242af3d-eb28-8ca8-0f20-4ddcdd112624" "fd2437c0-f421-4ea2-05f9-4199e5c1ab2b" https://developers.google.com/weave/v1/reference/cloud-api/devices/list
  • 43. Get State for a Specific Device #!/bin/bash source ./functions curl -s -H "Authorization: Bearer $(auth_token -r)" "https://www.googleapis.com/clouddevices/v1/devices/$(device_id -r)" | jq '.state._ledflasher'  { "leds": [ false, false, false, false ], "status": "idle" } https://developers.google.com/weave/v1/reference/cloud-api/devices/list
  • 44. List available device commands #!/bin/bash source ./functions curl -H "Authorization: Bearer $(auth_token -r)" "https://www.googleapis.com/weave/v1/commands?deviceId=$(device_id -r)" { "kind": "weave#commandsListResponse", "commands": [ { "kind": "weave#command", "id": "52c867ca-17d5-f422-a2c8-b31c4e02743efdf8b212-d0a5-202e-d6d1-e0ee9727df97", "deviceId": "52c867ca-17d5-f422-a2c8-b31c4e02743e", "creatorEmail": "bbeare1.test@gmail.com", "component": "base", "name": "base.updateDeviceInfo", "parameters": { "name": "Bruce: Lights on Edison" }, "state": "done", "creationTimeMs": "1457726895466", "expirationTimeMs": "1457726905466", "expirationTimeoutMs": "10000" }, { "kind": "weave#command", "id": "52c867ca-17d5-f422-a2c8-b31c4e02743e5d194dbc-dbc8-f4c2-16f2-6f01a9dd228b", "deviceId": "52c867ca-17d5-f422-a2c8-b31c4e02743e", "creatorEmail": "bbeare1.test@gmail.com", "component": "base", "name": "base.updateDeviceInfo", "parameters": { "location": "Home office" }, "state": "done", "creationTimeMs": "1457726873129", "expirationTimeMs": "1457726883129", "expirationTimeoutMs": "10000" } ], "totalResults": 2 } https://developers.google.com/weave/v1/reference/cloud-api/devices/list
  • 45. #!/bin/bash source ./functions body="{ 'deviceId': $(device_id), 'name': '_ledflasher.set', 'parameters': { 'led': 1, 'on': true } }" curl -H "Authorization: Bearer $(auth_token)" -H "Content-Type: application/json" -X POST -d "$body" https://www.googleapis.com/clouddevices/v1/commands https://developers.google.com/weave/v1/reference/cloud-api/devices/list Turn ON/OFF an LED
  • 46. Google* Code Labs Additional Topics • Over the Air Updates • IOS/Android Application Development
  • 48. Legal Notices and Disclaimers Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. Learn more at intel.com, or from the OEM or retailer. No computer system can be absolutely secure. Tests document performance of components on a particular test, in specific systems. Differences in hardware, software, or configuration will affect actual performance. Consult other sources of information to evaluate performance as you consider your purchase. For more complete information about performance and benchmark results, visit http://www.intel.com/performance. Intel, the Intel logo and others are trademarks of Intel Corporation in the U.S. and/or other countries. *Other names and brands may be claimed as the property of others. © 2016 Intel Corporation.