Tuesday, April 19, 2011

Device discovery with the Bluetooth Java API/ JNDI vs JDBC / Business Processes / yes

I'll be posting extracts of the research related to my terminal project.

JAVA Bluetooth API

  • The bluetooth specification separates discovery of devices and discovery of services into separate processes.

  • In bluetooth terms, device discovery is known as an inquiry. Devices respond to an inquiry depending of their discoverable mode

  • Those devices respond with their Bluetooth address and class of device record. The class of device record determines what type of services are available on the device.

  • We have two types of inquiry: general and limited. One good analogy the author suggests is: a general inquiry is similar to asking all people in a room to say their names, and a limited inquiry is asking the same only if they're accountants.

  • The API let's you to take full control of the device and service discovery process, or it can leave it up to the JABWT implementation (I'll be covering the first approach)

  • Steps to device discovery:



  1. To specify the type of inquiry to perform

  2. The API returns each device found during an inquiry back to the application as the device is found via a deviceDiscovered() event. I guess it's the most appropriate way to handle device discovery as it happens.

  3. You get the device found and the device class record which is composed of: the major service class, major device class and minor device class. Basically I'm interesting in knowing that a device has the major device class:"phone", but I need to look up what the minor device class for the major class 'phone' entails. Regarding the available services, it might be worth asking if the device major  service class is : 'Limited Discoverable'


Now the cumbersome part:

A complete inquiry can take eight up to ten seconds to complete in order to achieve a 95% chance of finding all the devices in the area, moreover a complete inquiry is very power consuming.

  • To overcome this issues the API provides two facilities, to skip inquiries altogether. It depends on the concept of predefined device, which is a device that's been discovered before and presents frequent interaction. And this makes perfect sense: if you have frequent communication with a devices there's no reason to ask for address, service class and device class that are for that matter immutable.


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Spago BI

  • Now I know the difference between a  JNDI (java naming directory interface)  and a simple JDBC connection in spago. With the former only one connection is made to a datasource and then shared between modules or reports, and a simple JDBC connection actually creates one instance connection for each module requesting information from a datasource.


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Datawarehousing

  • I'm looking forward to learn the bus architecture in dimensional designs.

  • Dimensional modeling is concerned with representing entire business processes, it does not enforce departmental boundaries. Such distinction would entail unnecessary replication. So the main aspect we're interested in is always: business processes.

  • There are four steps involved in defining a dimensional model, I'll comment on those steps tomorrow, maybe with some made up examples.


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Linux

  • There's some innocuous command called yes that generates an infinite series of the specified characters. It's useful when issuing interactive commands that require us to confirm certain actions such as overriding a file. For example


# yes n | cp -ir  folder/ /path/folder/

to do some kind of folder merging when you have two folders with the same name.

No comments:

Post a Comment