Structure of a Location server message
From TechnologicalWiki
Content of the XML file in each case:
1.- Server answers a request to change database content
<osami type=ans>
<message> "true, 200, Information stored into database"
or
<message> "false, 101, Database is not online"
- Something fails, and the information is not stored into the database
2.- An agent reports localization data to the service, and server answers true or false
<osami type=loc>
<agent type="BT">
- Agent that reports data
<devices>
- As much as devices enters or leaves agent's range
<device> <device>
<localization>
- Localization information
3.- Somebody requests to link a device to a user, and server answers true or false
<osami type=att>
<user>
- User that is going to be linked
<device>
- Device that is going to be linked
4.- Somebody requests to unlink a device from user, and server answers true or false
<osami type=det>
<user>
- User that is going to be unlinked
<device>
- Device that is going to be unlinked
5.- Somebody defines a new rule, and server answers true or false
<osami type=rul>
<rule>
- Rule's data
<id>
- If id is provided the rule will be updated
<condition>
- Required
<device>
- Optional
<user>
- Optional
<address>
- Required
6.- Somebody deletes an obsolete rule, and server answers true or false
<osami type=rul>
<rule remove=true>
- The remove = true attribute indicates that the rule must be deleted from database
<id>
- Id is mandatory to delete
7.- Somebody request to browse the database
<osami type=req>
<agent>
<id>
- If id is provided, reports devices and users in range of that agent
- If id is not provided, reports list of all agents on the database
or
<device>
<id>
- If id is provided, report localization info of a device and user linked to it
- If id is not provided, reports list of all devices on the database
or
<user>
<name>
- If name is provided, report localization info of device linked to that user
- If name is not provided, reports list of all users on the database
or
<rule>
<id>
- If id is provided, reports that rule
<device>
- if device id is provided, reports all rules related to that device
<user>
- if user name is provided, reports all rules related to that user
Note: if neither id, device or user is provided, reports all rules on the database
or
<localization>
<name>
- if position name is provided, all devices on that position are reported
<point>
- if point name provided, all devices on that point are reported
<area>
- if area name is provided,all devices inside that area are reported
<coor>
- lattitude, longitude and distance must be provided to report all devices close to the coordinates
Specific server answers:
<osami type=ans>
<devices>
- All devices that match the search condition
<device> <device>
8.- Server launches an event because of a rule
<osami type=eve>
<rule>
- Rule that trigges that event
<devices>
- All devices that match the rule condition (usually only one)
<device> <device>
<localization>
- Localization information
9.- In all cases, if there is a XML formating error server will answer:
<osami type=ans>
<message> false, 100, XML format error
Return to OSAmI-ES Developments


