-
Notifications
You must be signed in to change notification settings - Fork 7
Saving, Storing, Sending Messages
This page gives a low-down view of what types of messages ("records") we have, and what types of fields we have, and how everything fits together.
In GIS parlance, our "records" are essentially "map assets", or items on the map. There are many different types of records, each type has it's own set of required and recommended fields. The definition of a record is known as a record template. Many record templates have been formulated as below. We can support up to 0xFF record templates, or 256 different types of records.
Each record, when entered on the map in one device, is transferred via APRS messages to the other devices in the network.
Every record is displayed on the map as an icon (displayed icons need to have a filtering mechanism - TODO)
When accessing a record on the map, it's summary of required and recommended fields are displayed, as well as any response messages (type F0) that reference it.
If a record is "deleted", it is marked as such and removed from the map display, however it will persist in the database, and can be resurrected if need be. It's data will be disregarded by any analysis functions built into the device.
What is APRS and what do we use it for? APRS is a messaging specification built for connectionless networks. http://aprs.org/
We are using the APRS to send data from one device to another.
So, what happens is:
- User enters data.
- Data is saved as a record to the database on the user's machine.
- The Database Sync daemon formulates the new record into an APRS message (as below), and puts the message into a transmit queue.
- Another program (to be written) takes messages from the queue and transmits them across the network. This is not part of this challenge.
- Another program (to be written) listens to the network, and writes down the messages it hears and puts them into a receive queue.
- The Database Sync daemon monitors the receive queue, and inserts messages from it after validating (see the Database Sync Daemon page).
(< op_id >;< s_dev_id >;< ts >;< gps >;) < r_type >;< nparams >;<( paramID , value)>;<( paramID , value)>; ...
op_id: Sender Operator ID
s_dev_id: Sender device ID
ts: Timestamp
gps: GPS coordinates of the originating device
r_type: Type of record. Two Hexadecimal digits, total of 256 message types.
The type of record can be:
- 0* : Network Control Messages e.g 01,02,...
- 1* : Map based e.g. 11, 19
- 2* : Person Register
- 3* : Logistics / other
- 4* : Emergency, Crime, Impending Disaster, etc.
- ... Unallocated, may be dynamically allocated in the future
- F* : Service Messages
nparams: number of parameters
(paramID, value) : A tuple containing a parameter and its corresponding value. e.g (name,Abraham)
- See Parameter types for a detailed list of parameters and valid values.
Here we describe some of the different types of records that can be formulated.
Network Control messages : 0*
- 00: New Record Template
- 01: Update Record Template
- 02: Device going offline
- 03: Device Assignment
- 04: Channel Change (reserved)
- 10: Position Update (no message)
- 11: Resources Available
- 12: Refugee Center
- 13: Road Assessment
- 14: HAZMAT (chemical factories / spills / contaminated areas, etc)
- 20: Refugee
- 21: Missing
- 22: Deceased
- 23: Response Personnel
- 30: Headcount Order
- 31: Headcount Report
- 32: Rendezvous
- 33: Supplies running low
Emergency, Crime, ... 4*
- 40: Impending Disaster / Emergency / Help Needed
- 41: Crime
- F0: Update Record
- F1: Respond to Record
- FE: General Announcement
- FF: SOS call
Templates specify which, from a pool of parameters, are required, recommended, and optional parameters for a given type of record. In general, any parameter not specified explicitly in the record template is optional. Required and Recommended parameters must be easy to enter through the interface in as few steps as possible. (Provision must be made to have custom record types as well, but this may be reserved for future work.) It would be good to build the interface so that it formulates the input form by referencing the record template, this will aid in expanding the system.
For each record, based on the type of record there may be a list of parameters that are required, another list of parameters that are recommended, and all the other parameters may be optional. Each parameter represents a type of field on the user interface. For example, the following records and their required and recommended parameters.
This is meant to dynamically extend the capabilities of the system. In the case that a new type of record needs to be created, for example, if we need to record the location of beached whales.
Required:
- Record Template Name (eg: beached whale)
- Record Template ID (automatically assigned)
- Required Parameters for this template (CSV list of required parameters’ ID) (eg: GPS coordinates, name of beach)
- Recommended Parameters for this template (CSV list of recommended parameters’ ID) (eg: health status, comments)
This is meant to dynamically tweak the system. Most probable use case is to demote a field from required to recommended to aid entry of information.
Required:
- Record Template ID
- Required Parameters (CSV list of required parameters’ ID) (eg: GPS coordinates)
- Recommended Parameters (CSV list of recommended parameters’ ID) (eg: health status, comments)
Meant to let other devices know who’s online or not. No required parameters.
Recommended:
- Type of shutdown (low battery, normal powerdown)
- Comments
This is to let other devices know that this device has been assigned a special role in the disaster.
Required:
- Type of Assignment (Ambulance / Helicopter / Internet facing gateway / Incident Response Center / Refugee Center / Hospital / Morgue / New Record Template Block)
- Comments
This is basically a periodic no-op message sent with the current position. This functionality may be handled in APRX directly, and may not need a user interface.
Required:
- Current Position
Required:
- Type of Resource: (gas stations, medical supplies, food storage, buildings useful for refugee centers or morgues, potable water source, place of religious significance)
- Condition of Resource (sliding scale from might be usable to perfect)
- GPS location (if different from device’s location, point out on map)
- Ownership (public / private but free to use / private but compensation requested / private and owner * unavailable / other)
- Amount of resource (estimate)
- address location (using local landmarks / street names / etc. )
- Comment (if any)
- Remove from Map (toggle, presumably it’s exhausted)
Meant to send data about refugee centers.
Required:
- GPS location (may be different from device’s location)
- Center Name
- Type of Resource: (gas stations, medical supplies, food, potable water, place of religious significance)
- Amount of resource (estimate)
- Sanitary Conditions (fair, poor)
- Number of refugees (M, W, children)
- Comments
- Remove from Map (toggle, presumably it’s abandonded)
Meant to provide information on roads that the logistics modules can use in intelligent vehicle routing, and that can be seen on the road.
Required:
- GPS location (may be different from device’s location)
- Assessment (sliding scale from “there is no road” to “rock-climbing” to “donky-can-pass” to “two wheeler” to “car” to “truck”.)
- Comment / Alternate route
- Remove from Map (toggle, presumably it’s fixed)
Required:
- GPS location (may be different from device’s location)
- Assessment (irritating to lethal.)
- Comments
- Remove from Map (toggle, presumably it’s fixed)
Required:
- Person Name (if Unknown, please tag person with record number)
- Age (with a toggle of Approximate or Exact)
- Gender
- Health status: healthy? minor wounds? broken bones? ambulatory (can-walk)? unconscious? (series of check-boxes?)
- Current Location (refugee center ID / GPS coords / hospital) (layer for the map)
- Person ID (auto-generated from op_id, s_dev_id, ts, and serial number)
- Found GPS Address (point on map)
- GPS Address (point on map)
- address location (using local landmarks / street names / etc.)
- Phone
- Relatives, Note which ones are found in the database.
- Comments
Required:
- Person Name
- Age (with a toggle of Approximate or Exact)
- Gender
- Last known position GPS (point on map)
- Last Seen
- address location (using local landmarks / street names / etc.)
- Phone
- Relatives, Note which ones are found in the database
- Comments
Required:
- Deceased Name
- Age (with a toggle of Approximate or Exact)
- Gender
- Person ID (auto-generated from op_id, s_dev_id, ts, and serial number)
- Current Location (morgue ID) (layer for the map)
- Found GPS Address (point on map)
- Address / Phone Number (layer for the map)
- Relatives, Note which ones are found in the database
- Comments
Required:
- Person Name (if Unknown, please tag person with record number)
- Age (with a toggle of Approximate or Exact)
- Gender
- Health status: healthy? minor wounds? broken bones? ambulatory (can-walk)? unconscious? (series of check-boxes?)
- Current Location (refugee center ID / GPS coords / hospital) (layer for the map)
- Person ID (auto-generated from op_id, s_dev_id, ts, and serial number)
- Comments
Meant as an order to count response personnel, to make sure all are accounted for.
Required:
- Comment
To report the results of a headcount
Required:
- Comment
- Reference to Response Personnel records (if they are entered)
To schedule a meeting of response personnel, and/or others.
Required:
- GPS Location (point on the map)
- Address (streets / landmarks)
- Datetime of the meeting
- Comments
- Remove from Map (toggle, presumably it’s fixed)
This is an alert that can be raised by any refugee center / morgue / personnel
Required:
- Type of Resource: (gas stations, medical supplies, food, potable water, place of religious significance)
- GPS Location
- Address (Streets / landmarks)
- Amount of resource (estimate)
- Comments
- Remove from Map (toggle, presumably it’s fixed)
Required:
- degree of severity (sliding scale)
- Service required: Emergency Evacuation (number of people?) / Fire Force / Volunteers for a messy job / Medical help / other
- GPS location (may be different from device’s location) (layer on Map)
- address location (using local landmarks / street names / etc.)
- Comment (if any)
- Remove from Map (toggle, presumably it’s fixed)
Required:
- GPS location (may be different from device’s location) (layer on Map)
- Headcount of people involved (default to 0 = Unknown)
- address location (using local landmarks / street names / etc.)
- Comment (if any) would tell the nature of the crime (murder / sexual depravity / looting / arson / riotous behavior / etc)
- Remove from Map (toggle, presumably it’s fixed)
Required:
- Original record GID
- List of Updated Parameters
Required:
- reference message GID (<op_id></op_id><s_dev_id></s_dev_id><ts></ts>)
- CSV of related message GIDs to cross-link
- response message (Comment) NOTE: Comment parameters are only appended, not replaced.
This option sends SOS calls.
Required:
- GPS Location (note that in most cases, the GPS can be read from the devices internal GPS, but the option should be there to manually choose a place on the map.)
- Comment
- Remove from Map (toggle, presumably it’s fixed)