De leukste Bug

Download De leukste Bug

Post on 22-Jun-2015

96 views

Category:

Software

0 download

Embed Size (px)

DESCRIPTION

The Bug is a device with which you can build your own mobile system by combining certain modules. Each module delivers a specific piece of functionality, such as camera, video output, GPS location, etc. The fun part of this device is that both the hardware and the software are completely modular and dynamic. That means that you can easily, with Eclipse and an SDK, write your own software for it. This session will introduce the Bug and the OSGi based software stack and will build and deploy a whole application.

TRANSCRIPT

<ul><li> 1. De leukste BugMarcel Offermansluminis</li></ul> <p> 2. luminisIntroduction Marcel Offermans marcel.offermans@luminis.nl . IT solutions from idea toArnhem Apeldoornimplementation experts in Java, OSGi, .NET,Agile/ScrumEnschedeimage 2008 Google Earth 3. luminisAgenda The BUG hardware The software stack, from kernel to application OSGi overview Concierge, R3 and the SDK Live demos Hello world on the BUG Developing and deploying a camera application Wrapping up 4. luminisAgenda The BUG hardware The software stack, from kernel to application OSGi overview Concierge, R3 and the SDK Live demos Hello world on the BUG Developing and deploying a camera application Wrapping up 5. luminisBUG Electronic building blocks to build personalizeddevices Open platform for custom hardware and softwaredevelopment Based on proven technologies: Linux Java OSGi 100% open source ((L)GPL, BSD and EPL) 6. luminisBUG elements BUGbase mobile linux computer BUGmodules video, audio, GPS, sensors, general I/O, ... SDK based on Eclipse BUGnet community application repository 7. luminisBUGbase Mobile Linux computer Freescale ARM SoC at 532 MHz 128 MB RAM, 32 MB flash, 2 GB SD storage, USB 2.0 LCD menu system with navigation buttons and LEDs battery powered BUG Module Interface with 4 slots I2C, I2S, UART, ... hot pluggable kernel subsystem 8. luminisBUG camera 2 megapixel camera flash LED 3 buttons 9. luminisBUG LCD QVGA (320x240) resolution touchscreen (simple) accelerometer 10. luminisBUG GPS GPS device internal or external antenna 11. luminisBUG motion andaccelerometer IR motion detector 3 axis accelerometer 12. luminisBUG von Hippel named after MIT professorEric von HippelDemocratizing InnovationIn this book I explain in detail how the emerging process ofuser-centric, democratized innovation works. I also explainhow innovation by users provides a very necessarycomplement to and feedstock for manufacturer innovation. exposes most hardwareinterfaces suited for rapid prototyping of modules, and asgeneral I/O device 13. luminisBUG audio audio in and out mic, headphone, line-in,line-out 2 hardware buttons 14. luminisThird party and planned Zigbee Wifi 3G 15. luminisAgenda The BUG hardware The software stack, from kernel to application OSGi overview Concierge, R3 and the SDK Live demos Hello world on the BUG Developing and deploying a camera application Wrapping up 16. App App AppOSGiluminisBUG software stack Linux 2.6 kernel CDC JVM (phoneME advanced) OSGi R3 framework (Concierge)Java VM BUG applications are collectionsof OSGi bundles Linux Kernel 17. OSGi history Started as an embedded platform for the homegateway Originally under the JCP as JSR-8 (1999) OSGi alliance, large consortium, with a mission: maintaining and publicizing the OSGi specification certifying implementations organising events OSGi R3: march 2003 Current version: OSGi Release 4.1 (JSR-291)luminis 18. luminisOSGi todayOSGi technology is the dynamic module systemfor JavaOSGi technology is Universal Middleware.OSGi technology provides a service-oriented, component-basedenvironment for developers and offers standardizedways to manage the software lifecycle. These capabilitiesgreatly increase the value of a wide range of computersand devices that use the Java platform. 19. luminisOSGi Alliance Expert Groups: core platform (CPEG) mobile (MEG) vehicle (VEG) enterprise (EEG) residential (REG) Working Groups: marketing requirements 20. luminisOSGi specificationOSGi Service PlatformService CompendiumThe OSGi AllianceRelease 4, Version 4.1April 2007OSGiAllianceDigitallysigned byOSGi AllianceDN: cn=OSGiAlliance, c=USDate:2007.02.2214:44:10 +01'00'Signature NotVerifiedOSGi Service PlatformCore SpecificationThe OSGi AllianceRelease 4, Version 4.1April 2007OSGiAllianceDigitallysigned byOSGi AllianceDN: cn=OSGiAlliance,c=USDate:2007.02.2214:45:47 +01'00'Signature NotVerified 21. OSGi Framework LayeringL3 - Provides a publish/find/bind servicemodel to decouple bundlesL2 - Manages the life cycle of a bundle ina framework without requiring the vm to berestartedL1 - Creates the concept of a module(aka. bundles) that use classes from eachother in a controlled way according tosystem and bundle constraintsL0 - well defined profiles that define theenvironment in which bundles can work, ie:* CDC/Foundation* JavaSE-6luminisSERVICE MODELLIFE-CYCLEMODULEExecutionEnvironment 22. BundleluminisModule Layerexports Unit of deploymentis the bundle i.e., a JAR Separate class loaderper bundle Class sharing at the Java package level Supports multiple versions of packagesModuleModuleBundle Bundle Bundleorg.apache.utils 1.0org.apache.db 1.4org.apache.log 2.3 org.apache.utils 1.1exportsimportsexportsimportsexports 23. luminisManifestBundle-Name: Example BundleBundle-SymbolicName: net.luminis.example.bundleBundle-Version: 1.0.0DynamicImport-Package:net.luminis.jdbc.*Import-Package:org.osgi.framework;version=1.3,org.osgi.service.event;version=[1.0,2.0),net.luminis.foo;resolution:=optionalExport-Package:org.osgi.service.event;version=1.1Bundle-ManifestVersion: 2 24. Life-cycleresolved activeluminisLife-cycle Layer Managed life cycle States for each bundle; Allows updates of existing bundles Dynamically install, start, update, and uninstallLife-cyclestartendinstalledinstallstart startingstopping stopuninstalluninstalledModule 25. luminisLife-cycle ExampleBundleOSGi Framework 26. luminisLife-cycle ExampleBundleOSGi FrameworkProvidedPackage 27. luminisLife-cycle ExampleBundleOSGi FrameworkBundleInstallBundle 28. luminisLife-cycle ExampleBundleOSGi FrameworkBundleResolveBundle 29. luminisService Layer OSGi frameworkpromotes serviceoriented interactionpattern amongbundlesServiceServiceLog Databasepublish useusepublishBundle Bundle BundleBundlePrefspublishusepublish findServiceProviderServiceRequesterServiceRegistryinteractLife-cycleModule 30. luminisService ExampleBundleOSGi Framework 31. luminisService ExampleBundleOSGi FrameworkProvidedServiceProvidedPackage 32. luminisService ExampleBundleOSGi FrameworkBundleInstallBundle 33. luminisService ExampleBundleOSGi FrameworkBundleResolveBundle 34. luminisService ExampleBundleOSGi FrameworkBundleResolveService 35. Security Concepts Overview Codebased security of the Java Security Model Makes use of Protection Domain The stack walk based Permission Check Signed bundles User based security is supported bySecuritythe UserAdmin service but notintegrated in the standard permissionServicecheck as with JAAS PermissionAdmin andConditionalPermissionAdmin servicesprovide management infrastructureLife-cycleModuleluminis 36. Leveraging standard services Specification: OSGi compendium catalog of standard serviceluminisdescriptions Implementations: OBR repository at bundles.osgi.org over 1400bundles, implement compendium and other services Maven repository and third party OBRs Springsource has a repository More and more projects are made OSGi compatible, forexample: Apache Commons OSGi, Jetty, ... 37. User Admin Wire AdminluminisOSGi compendiumLogXML ParserPositionMeasurement and StateEvent Admin Service TrackerHTTPDevice AccessConfiguration AdminPreferencesMetatypeIO ConnectorInitial ProvisioningUPnP DeviceExecution Environment SpecDeclarative ServicesOSGi Service PlatformService CompendiumThe OSGi AllianceRelease 4, Version 4.1April 2007OSGiAllianceDigitallysigned byOSGi AllianceDN: cn=OSGiAlliance, c=USDate:2007.02.2214:44:10 +01'00'Signature NotVerified 38. luminisConcierge implements OSGi R3 specification small footprint: 80 kB optimized for embedded environments low resource consumption tuned for VMs that interpret bytecode tested on many platforms iPAQ, Zaurus, Nokia 9300, LinkSys NSLU, iMote2, ... Homepage: http://concierge.sourceforge.net/ 39. luminisOSGi R3 no bundle symbolic names no require-bundle only one version of a package a somewhat smaller compendiumOSGi Service PlatformRelease 3March 2003 40. luminisDragonfly BUG SDK software development kit to build applications Eclipse plug-ins, open source includes a virtual BUG, an emulator to testapplications without hardware 41. SDK interfaces with hardwareluminis 42. luminisAgenda The BUG hardware The software stack, from kernel to application OSGi overview Concierge, R3 and the SDK Live demos Hello world on the BUG Developing and deploying a camera application Wrapping up 43. luminisHello World on the BUG Register ourselves as a listener for button events When an event comes in, blink all LEDs for half asecond Deploy the code to the BUG 44. luminisAdding modules at the OSGi level, adding a module means newservices appearing applications can track these services andbecome active once all required services arepresent BUG SDK has a convenient project wizard to helpyou with that internally, Service Trackers are used to track OSGiservices 45. Developing and deploying acamera application Use the camera, LCD and accelerometer to: wait until you hold the device still for a little while take a picture display the picture on the LCD Use the project wizard to depend on the rightservices Deploy to the BUG Test the applicationluminis 46. luminisAgenda The BUG hardware The software stack, from kernel to application OSGi overview Concierge, R3 and the SDK Live demos Hello world on the BUG Developing and deploying a camera application Wrapping up 47. luminisWrapping up Weve looked at the open software and hardwarestack of the BUG After a brief look at OSGi, we developed anddeployed a couple of applications to the BUG Before you ask, a new version of the BUG, whichsupports WiFi is scheduled for June and will shipto europe (you need a US address now) The BUG community is very supportive, check itout on their site and go to #buglabs on FreenodeIRC 48. luminisLinks Slides, docs and code:http://opensource.luminis.net/ Buglabs:http://buglabs.net/ OSGi:http://www.osgi.org/ Marcel Offermans:marcel.offermans@luminis.nl 49. luminisQuestions?!? &amp; ! </p>