Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Overview of Brillo (Android Things)

361 views

Published on

This is a presentation I gave at Sydney's Google DevFest: An overview of Brillo, which is rebrand as Android Things a few days later...

Published in: Technology
  • Be the first to comment

Overview of Brillo (Android Things)

  1. 1. An Overview of Brillo Bin Chen, GDG DevFest Sydney 12/2016 1 / 22
  2. 2. About me Senior Engineer at Linaro.org Working on Android OS 2 / 22
  3. 3. Brillo Minimized Android Same architecture Security OTA update IoT related core Services Ability to access Low level interface Http server Weave: A device­phone­cloud communication protocol 3 / 22
  4. 4. Brillo Architecture +--------------------------------------------------+ | C/C++ Applications | +--------------------------------------------------+ |Binder +--------------------------------------------------+ | C/C++ Library&Services | | (update_engine firewalld media | | bioniccameraPIO webservdWeaved) | +--------------------------------------------------+ +--------------------------------------------------+ | HardwareAbstractionLayer | | (BTWIFINFCSensorsCamera Audio | | I2CGPIOPWMLED) | +--------------------------------------------------+ +--------------------------------------------------+ | LinuxKernel/DeviceDrivers | +--------------------------------------------------+ +--------------------------------------------------+ | Hardware | +--------------------------------------------------+ 4 / 22
  5. 5. Security One top of Linux kernel security UID/GID based sandboxing SELinux: default­deny, must be explicit allowed by policy Secure Boot Full Disk Encryption Firewall (new in Brillo) OAuth2 authentication SSL Hardware­backed Crypto 5 / 22
  6. 6. OTA Update push new update to your device over­the­air Background reduced downtime with extra partitions be able to rollback; redeclared possibility of a bricked device secure end to end 6 / 22
  7. 7. Media - Graphic, Display, Camera No Graphics (e.g OpenGL) No Display (SurfaceFlinger,HWC) Support Camera with NDK API Support Audio 7 / 22
  8. 8. Sensors Use Sensor with NDK API all sensors supported by Android will be supported 8 / 22
  9. 9. Connectivity Bluetooth, BLE (central & peripheral) Wifi NFC No 802.15.4(LR­WPAN:Zigbee, Thread) No LPWAN (LoRa, Sigfox, NB­IOT) 9 / 22
  10. 10. HW I/O - Peripheral Manager Provide platform independent API for accessing hardware I/O. New Services added by Brillo Client/Server, peripheralman daemon, Binder as IPC C client API (create binding for your favourite languages) Supported Protocols: GPIO, I2c, LED, SPI, UART 10 / 22
  11. 11. WebServerd A web server deamon build on top of libmicrohttpd Weave is one of the client 11 / 22
  12. 12. show me the CODE! //1.createyourhandler constcharPingRequestHandler::kMethods[]=""; //allmethods constcharPingRequestHandler::kUrl[]="/webservd-test-client/ping"; classPingRequestHandler:publicRequestHandlerInterface{ voidHandleRequest(std::unique_ptr<Request>/*request*/, std::unique_ptr<Response>response)override{ response->ReplyWithText(200,"HelloWorld",brillo::mime::text::kPlain); } }; //classPingRequestHandler //2.registerittowebservd webserver_=Server::ConnectToServerViaBinder( ProtocolHandler*http_handler=webserver_->GetDefaultHttpHandler(); http_handler->AddHandler( PingRequestHandler::kUrl, PingRequestHandler::kMethods, std::unique_ptr<RequestHandlerInterface>(newPingRequestHandler())); ); //3.callit $curlhttp://localhost:8080/webservd-test-client/ping HelloWorld! 12 / 22
  13. 13. Weave "A communications platform for IoT devices that enables device setup, phone­to­device­to­cloud communication, and user interaction from mobile devices and the web" +-------------+ | | +-----------+ Cloud +------+ | | | | | +-------------+ | Weave Weave | | +------+------+ +--------+------+ | | | | | Device +----Weave-------+ Phone | | | | | +-------------+ +---------------+ Interoperability : schema Device Management & Cloud : privet 13 / 22
  14. 14. Weave - Schema: Interoperability Device, Components, Trait, Command, State Bluetooth: "Profile, Service, Characteristic": Device +-------------------------+ | | | Component(s) | +---------+ | +-------------+ | |Command| Write | |+--------+ | | | |------------------>|Trait(s)| | | +---------+ | |+---+----+ | | +---------+ | | | | | | | Read | +-------------+ | | State |<----------------------+ | +---------+ | | +-------------------------+ Weave will manage those Components 14 / 22
  15. 15. Schema : An example constcharkTraits[]=R"({ "onOff":{ "commands":{ "setConfig":{ "minimalRole":"user", "parameters":{ "state":{ "type":"string", "enum":["on","off"] } } } }, "state":{ "state":{ "isRequired":true, "type":"string", "enum":["on","off"] } } } })"; 15 / 22
  16. 16. Weave - Privet: Device Management & Google Cloud Device <­> Cloud: REST API Device Information Pairing Authentication Access Control Manage Components & Commands CheckForUpdate 16 / 22
  17. 17. show me the CODE! AddHandler("/privet/info"); AddHandler("/privet/v3/pairing/start", AddHandler("/privet/v3/pairing/confirm", AddHandler("/privet/v3/pairing/cancel", AddSecureHandler("/privet/v3/auth", AddSecureHandler("/privet/v3/accessControl/claim", AddSecureHandler("/privet/v3/accessControl/confirm", AddSecureHandler("/privet/v3/setup/start", AddSecureHandler("/privet/v3/commands/execute", AddSecureHandler("/privet/v3/commands/status", AddSecureHandler("/privet/v3/commands/cancel", AddSecureHandler("/privet/v3/commands/list", AddSecureHandler("/privet/v3/checkForUpdates", AddSecureHandler("/privet/v3/traits", AddSecureHandler("/privet/v3/components", 17 / 22
  18. 18. Brillo Developer Kit (BDK) Three parts: 1. The initial bdk contains common code all products need 2. Board support package (BSP) for a particular board bootloader, drivers, hals and firmware brunchbspinstall 1. Your service/product code brunchproduct 18 / 22
  19. 19. Support Platforms and Targets Acrosss different hardware platforms: Intel X86, ARM, MIPS Storage : 128M RAM : 32M 19 / 22
  20. 20. Development Environment Exactly the same as Android Platform Development. Language : C++/C IDE : do we need one?? Build : Android.mk/Android.bp Flash : fastboot Debug : adb, logcat, gdb, printf/k! 20 / 22
  21. 21. Get started and Get involved. Checkout, Build and Run! #Checkout repoinit-uhttps://android.googlesource.com/brillo/manifest-bmaster reposync #Build sourcebuild/envsetup.sh;lunchbrilloemulator_x86-eng make #Runthesimulator out/host/linux-x86/bin/brilloemulator-x86 Next, submit a patch. It is open source. 21 / 22
  22. 22. Discussion? Thank you. 22 / 22

×