The IoT Services use data called a Scan Packet, and this is just as it sounds. A Scan Packet is a packet of data that contains information about the end device; a Scan Packet is also only sent by Hubs. For example, if a Hub sees a temperature-humidity device the scan packet will contain:

Scan Packets usually are in an array, meaning you can send more than one Scan Packet into the IoT Service at a time. You can send up to 100 every second.

You can customize Scan Packets in any way; there are a few required fields; however, the rest of the packet is up to you!

Type Definitions

ELSData: Object

{
  location: Boolean
  deviceType: String
}

ELSscans: Object

{
  adData: String
  rssi: Number
  node: String
  time?: String
  name?: String
  latitude?: Number
  longitude?: Number
}

Scan Packet Breakdown

{
    hubId: "MyHub1",
    data: {
        location: false,
        deviceType: "echolo"
    },
    scan: [
        {
            adData: "0000001010101",
            rssi: -28,
            node: "AB:CD:EF:12:34:56",
            time: "Tue Aug 29 04:44:36 2017",
            name: "MY Device Name"
        },
        {
            adData: "8765467893232244000000033234ac3b21cb34e33f3d33a2ab3ca30",
            rssi: -51,
            node: "BB:CD:EF:12:34:00",
            time: "Tue Aug 29 04:44:36 2017",
            name: "Echolo Beacon"
        }
    ]
}

hubId: String (required)

The first level of the JSON object requires that you ID what Hub this data is coming from. An example: If Hub1 is scanning for devices it may see hundreds of devices and report them in the scan packet but it must include it's hubId only once in the hubId key.

Key Required Description
hubId Yes The id of the hub that sees the devices can be the MAC address, a custom string, or a number.

data: ELSData (required)

The data key is an object that includes two items, and both are required. The first is a key named location and expects a boolean, this is used for offering up a location on the platform or not. See the Location Packet guide for more information on the location key.