Device Attribute Registry

Each Afero device will have a number of attributes associated with it. Attributes are identified by a 2-byte ID and can contain a variable amount of information based on the type of attribute. Attributes can come in many types and have specific ID ranges.

ID Description Data Type Usage Notes
1‑1023 Afero Cloud, Device MCU An attribute residing on an external MCU defined by the third-party developer. The size and meaning of these attributes are defined by the developer using the Afero Profile Editor. To get the default value of one of these attributes, the MCU must call af_lib_get_attribute.
1024 I/O 0 Value Attribute LED on Afero dev board.
1026 I/O 1 Value Attribute Configurable
1028 I/O 2 Value Attribute Configurable
1030 I/O 3 Value Attribute Button on Afero dev board
1201 UTC Time SINT32 Local UTC time on ASR should the MCU need/want it. If present in the Profile, ASR will deliver it to the MCU periodically.
1202 Device ID BYTES If the MCU requires the ASR Device ID, the MCU can do a GET on this attribute to retrieve the ID.
1203 Association ID BYTES Should the MCU require the Association ID of the ASR it can do a GET on this attribute to retrieve it.
1204 Company Code SINT8 Should the MCU require the Company Code of the ASR it can do a GET on this attribute to retrieve it.
1205 Online Status BYTES This three-byte array describes the online status of the device according to the following formula:
  • First byte: 0 = Offline, 1 = Online
  • Second byte: 1 = BLE, 2 = Wi-Fi
  • Third byte: Number of Wi-Fi bars (if second byte is 2)
1206 Device Capabilities BYTES A bit field in which the device states to the MCU what capabilities it supports. Bits are indexed from left to right, allowing additional bytes to be appended to support additional capabilities. The bits are:
  • Bit 0: MCU OTA Support
1207 afLib Capabilities BYTES A bit field in which afLib states to ASR what capabilities it supports. Bits are indexed from left to right, allowing additional bytes to be appended to support additional capabilities.
1301 OTA MCU Info BYTES N-byte array used to hold state and other information related to the OTA.
1302 OTA MCU Transfer BYTES N-byte array used for transmitting the image data to the MCU. By default this will be 510 bytes for Modulo-1 and 2046 bytes for Modulo-2, but the MCU can limit the amount of data it receives each time by lowering the size of this attribute.
2001 Bootloader Version SINT64 The bootloader is always the first thing to be upgraded as it is responsible for installing firmware images. This firmware type is used for the Afero Secure Hub and Afero Secure Radios.
2002 BLE Stack Version SINT64 This is the Bluetooth stack for the radio module. This will likely never be updated, but is included here for completeness. If the stack is updated, the application must always be updated at the same time, before the device is rebooted.
2003 FW Application Version SINT64 This is the radio module application responsible for reading the device description and handling attributes. This firmware type is used for the Afero Secure Hub and Afero Secure Radios.
2004 Device Description SINT64 The description of the attributes for a particular Afero application.
2005 Hub SINT64 This is the entire firmware package for the hub including the software that runs on the Freescale processor. The Freescale package is signed separately using the same firmware type id, and then is included in the OpenWrt package. At boot time, only one version number is reported for the entire firmware package.
2006 Wi-Fi SINT64 This is the version for the Wi-Fi chip (e.g., WINC3400).
2007 Wi-Fi Certificates SINT64 This is the package of Wi-Fi certificates used by the Wi-Fi chip to talk to the Cloud. This includes specific server certificates for Conclave and OTA servers as well as their root certificates. There is only one slot for this image type and the binary image is signed on the way to the device.
2008 WAN APN List SINT64 This package contains a single file that comprises all the different WAN APNs the device supports.
65001 UTC offset data BYTES Contains the current UTC offset in minutes, the next timestamp to change the UTC offset, and the new UTC offset to apply at the previous timestamp, in that order (2-bytes signed short, 4-bytes int, 2-bytes signed short).
65004 Configured SSID UTF8S The SSID the Afero Secure Hub is currently configured to use.
65005 Wi-Fi Bars SINT8 Integer, read-only attribute for Wi-Fi signal strength, for UI purposes.
65006 Wi-Fi Steady State SINT8 Wi-Fi steady state:
  • 0 = Not connected
  • 1 = Pending
  • 2 = Connected
  • 3 = Unknown failure
  • 4 = Association failed
  • 5 = Handshake failed
  • 6 = Echo failed
  • 7 = SSID (Network Name) Not found
  • 8 = NTP (Network Time Protocol) failed

This value is used to communicate the Wi-Fi state to the apps outside the Wi-Fi setup.

65012 Command BYTES

This value will have a one-byte command followed by parameters, if any. The format of the last three bytes are dictated by the first byte. The device will return a two-byte array indicating the result of the command to the server. The first byte will be the command and the second byte will be the result:

  • NO_ERROR = 0
  • COMMAND_FAILED = 0xFF
  • NOT_SUPPORTED = 0xFE, PARSE_ERROR = 0xFD

Current commands are listed below. Note that not all commands are available on all devices.

  • 1 = Reboot - Last three bytes are ignored.
  • 2 = Clear user data - Factory reset; last three bytes are ignored.
  • 3 = Enter factory test mode (i.e., softAP).
  • 4 = Enter factory mode (i.e., profiprogo).
  • 5 = Peripheral list change - The list of peripherals on the account has changed. The format of the parameters is [modification][device id length][device id], where:
    • [modification] (1 byte): 1 for added, 0 for removed
    • [device id length] (1 byte): Length of device ID
    • [device id] (device id length bytes): Device ID
  • 6 = Device view state change - Somebody has either started/stopped viewing a device. The format of the parameters is [viewing refresh time][viewer id length][viewer id][device id length][device id], where:
    • [viewing refresh time] (2 bytes): 0 for not viewing; otherwise, the time in seconds that viewing should be true
    • [viewer id length] (1 byte): Length of viewer ID
    • [viewer id] (viewer id length bytes): Viewer ID
    • [device id length] (1 byte): Length of device ID
    • [device id] (device id length bytes): Device ID
  • 7 = Claim state change - Somebody has either started/stopped claiming a device. The format of the parameters is [claim refresh time][claimant id length][claimant id][device id length][device id], where:
    • [claim refresh time] (2 bytes): 0 for disclaim; otherwise, the time in seconds that the claim should be true
    • [claimant id length] (1 byte): Length of claimant ID
    • [claimant id] (claimant id length bytes): Claimant ID
    • [device id length] (1 byte): Length of device ID
    • [device id] (device id length bytes): Device ID
  • 8 = Start/stop peripheral mode: Either start/stop advertising over BLE. The format of the parameters is [mode], where:
    • [mode] (1 byte): 1 to start advertising, 0 to stop advertising
  • 9 = Enable/disable Wi-Fi: Either enable/disable the use of Wi-Fi on a device. The format of the parameters is [mode], where:
    • [mode] (1 byte): 1 to enable, 0 to disable
  • A = Upload hub logs to the media service.
65013 ASR State (AF_SYSTEM_ASR_STATE) SINT8 This byte will hold ASR state information, including:
  • 0 = Rebooted (AF_MODULE_STATE_REBOOTED)
  • 1 = Linked (AF_MODULE_STATE_LINKED)
  • 2 = Updating (AF_MODULE_STATE_UPDATING)
  • 3 = Update ready to apply (reboot requested) (AF_MODULE_STATE_UPDATE_READY)
  • 4 = Initialized (AF_MODULE_STATE_INITIALIZED)
  • 5 = Re-linked (AF_MODULE_STATE_RELINKED)
  • 6 = Factory Reset (MODULE_STATE_FACTORY_RESET)
65014 Low Battery Warning SINT8

Applies to ASR-1 Only

This value will be updated by ASR-1 when the battery gets low. It will track the battery level as:

  • 0: voltage >2.7V
  • 1: 2.5V <voltage> 2.7V
  • 2: 2.3V <voltage> 2.5V
  • 3: 2.3V <voltage> 2.1V

At 2.1 volts, the ASR-1 will power down to avoid problems such as flash corruption.

65015 Linked Timestamp SINT32 The timestamp when the peripheral linked with the Cloud (as set by the Cloud upon successful linking). This is a Unix Epoch timestamp, which is the number of seconds since 1/1/1970.
65018 Attribute ACK SINT16 Reserved.
65019 Reboot Reason UTF8S

A comma-delimited string that always has the same number of fields: 23 in the current version (V1). The reboot reason code appears in the second field; possible code values are explained below:

  • 0 = Power on
  • 1 = Watchdog reset
  • 2 = Software reset
  • 3 = Reset pin asserted
  • 4 = Crystal failure
  • 5 = Brownout
  • 240 = Other
  • 255 = Unknown
65020 BLE Comms BYTES Reserved.
65021 MCU Interface SINT8 This attribute is required in the profile. The default value for this attribute is set by APE and any changes to the value at runtime are ignored. The following values are valid:
  • 0 = No MCU
  • 1 = SPI SLAVE
  • 2 = UART
65066 Device Capability BYTES

A bit field in which the device states what capabilities it supports. The bits are:

Bit Index Name Description
0 COMMAND_ACK Command Attribute sets are acknowledged with command response.
1 VIEW Accepts view command attribute values.
2 ADD_REMOVE_DEVICE Accepts add/remove peripheral command attribute values.
3 PERIPHERAL_MODE Accepts peripheral mode enable/disable command attribute values.
4 WIFI_MODE Accepts Wi-Fi enable/disable command attribute values.
5 CLAIM Accepts claim command attribute values.
6 ROUTER Can route messages to other devices when visible.
65067 Rate Limit Config BYTES Optional list of rate limit configs used by the attribute store to rate limit how often a given attribute is updated when being either viewed or not viewed. An individual config is six (6) bytes long and has the following format: [attribute][viewing update interval][non viewing update interval], where:
  • [attribute] (2 bytes): Attribute to which the following rate limits apply
  • [viewing update interval] (2 bytes): Viewing update interval in seconds
  • [non viewing update interval] (2 bytes): Non viewing update interval in seconds

The behavior is as follows: For a given viewing state, the attribute store will enforce that the given attribute will not be updated more frequently than the value specified in the config. The first update after a reboot and any responses to server SET messages will be exempt from this policy.

65068 Queued Attributes Config BYTES This is an optional list of queued attribute configs used by the attribute store to queue a given attribute instead of overwriting when offline. An individual config is five (5) bytes long and has the following format: [attribute][queue policy][queue size], where:
  • [attribute] (2 bytes): Attribute to which the following rate limits apply.
  • [queue policy] (1 byte): Queue order and replacement policy. (See All About Queuing.)
  • [queue size] (2 bytes): Maximum number of elements.
65069 MCU SPI Config BYTES Binary byte array with the following formatted values (in little endian hex):
  • Bytes 0-1: Maximum Tx/Rx SPI transfer size: Range 1-2048, Default 0xFF (255).
  • Bytes 2-5: Start transfer delay in microseconds: range 1-1,000,000, Default: 0x0FA0(4000).
  • Bytes 6-9: Pulse width (or Interrupt pulse interval) in microseconds: Range 1 - 1,000, 000, Default 0x2710 (10000).