SlideServe
Menu
Préférences
© SlideServe · v2026

Department of Computer Science

cally-barton avatar
12 diapositives · 264 Views · Nov 15, 2014

This guide provides a comprehensive introduction to OSGi (Open Services Gateway Initiative) and Phidgets, focusing on their application in programming smart home systems. Users are walked through the simple hardware setup, software installation, and basic programming concepts needed to control and sense the environment through a computer. With no prior hardware knowledge needed, this accessible guide enables anyone to dive into smart home automation using Phidgets and Java programming.

Department of Computer Science - slide 1
01 / 12Department of Computer Science
1 / 17

Télécharger la présentation

Department of Computer Science
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Basics of OSGi and Phidgets • May 24, 2007 Department of Computer Science Guillermo Hernandez, Jose Reyes Alamo Understanding the basics of OSGi and Phidgets Programming Smart Home Lab Iowa State University

  2. Definition - User-friendly system available for controlling and sensing the environment from your computer. No hardware knowledge needed, just a matter of plugging into the USB port on your computer and use Phidgets software libraries to access these devices. • Basics of OSGi and Phidgets • May 24, 2007 Phidgets Department of Computer Science Guillermo Hernández, José M. Reyes Álamo

  3. Connect one end of a USB cable to the phidget and the other end to the computer. (Optional) If the phidget requires power make sure to plug it to a power source. • Basics of OSGi and Phidgets • May 24, 2007 Phidgets Hardware Installation Department of Computer Science Guillermo Hernández, José M. Reyes Álamo

  4. Go to www.phidget.com and click on downloads. Click on the link for Phidget21 Downloads Download the file PHIDGET.MSI Install the PHIDGET.MSI. This file allows your OS to easily interact with the Phidgets. Download Java JNI Library - Phidget21 to a known location. This is a .jar file that will be used later for application development. • Basics of OSGi and Phidgets • May 24, 2007 Phidgets Software Intallation Department of Computer Science Guillermo Hernández, José M. Reyes Álamo

  5. Open Eclipse and go to File NewProject and select Java Project Click Next and give an appropriate name to the project and click Finish. RIGHT click under you project name and click on Properties On the menu to the left, click on Java Build Path On the Tab Menu click on Libraries Click on Add External JARs. Locate the file called phidget21.jar (just downloaded) Create a new Class Import the following packages: com.phidget.* and com.phidget.event.* • Basics of OSGi and Phidgets • May 24, 2007 Using Phidgets – RFID Project Department of Computer Science Guillermo Hernández, José M. Reyes Álamo

  6. import com.phidgets.*; import com.phidgets.event.*; public class RFIDExample{ public static final void main(String args[]) throws Exception { RFIDPhidget rfid; rfid = new RFIDPhidget(); rfid.addTagGainListener(new TagGainListener(){ public void tagGained(TagGainEvent oe){ System.out.println(oe); } }); rfid.openAny(); rfid.waitForAttachment(); System.out.println("Serial: " + rfid.getSerialNumber()); System.out.println("Outputs: " + rfid.getOutputCount()); rfid.setAntennaOn(true); rfid.setLEDOn(true); System.in.read(); rfid.close(); rfid = null; } } • Basics of OSGi and Phidgets • May 24, 2007 Department of Computer Science Guillermo Hernández, José M. Reyes Álamo

  7. What is OSGi? OSGi stands for Open Services Gateway Initiative. It is an open standards organization composed of companies like Sun Microsystems, IBM, Motorola among many others. Provides a Java based service platform that can be remotely managed. • Basics of OSGi and Phidgets • May 24, 2007 OSGi Department of Computer Science Guillermo Hernández, José M. Reyes Álamo

  8. Key terms in OSGi Bundle- a java JAR file that contains service definition and implementation. Service- a function provided by a bundle. (e.g. reading the temperature of a temperature sensor). Framework- the central component of OSGi. It is the execution environment for services and bundles. • Basics of OSGi and Phidgets • May 24, 2007 OSGi Department of Computer Science Guillermo Hernández, José M. Reyes Álamo

  9. Basics of OSGi and Phidgets • May 24, 2007 OSGi Department of Computer Science Guillermo Hernández, José M. Reyes Álamo Figure 1- OSGi Framework

  10. Basics of OSGi and Phidgets • May 24, 2007 OSGi Department of Computer Science Guillermo Hernández, José M. Reyes Álamo Figure 2- Service Oriented Framework

  11. Basics of OSGi and Phidgets • May 24, 2007 OSGi Department of Computer Science Guillermo Hernández, José M. Reyes Álamo Code Demonstration • How to create a bundle • How to create and publish a service • How to use a service

  12. Basics of OSGi and Phidgets • May 24, 2007 Department of Computer Science Guillermo Hernández, José M. Reyes Álamo Questions