This article lists and describes all available Set types, descriptions and properties. The reader of this article should have basic understanding of the Spotsets concept. If not, please visit the Sets Introduction article first.
General required properties
The following properties are always required when a Spotset needs to be created. Spotsets can be created via the Brain REST Web API.
setid
Set identifier
This identifier is a number between 0 and 256, and should be unique within the collection of Sets for one Smartspot device. So this means that it's OK if you use this number to create the same Set type across a collection of Smartspots, but it's not OK to use this number multiple times for the same Smartspot device.
Argument
- Type: Number
- Range: 0 - 256
type
Set type
This indicates the type of Set. Each Set type requires different properties that need to be provided when a new Set is created. Each type and required properties is referenced in section Type Reference List.
Argument
- Type: String
- Accepted values: any, list, codemask, coderange, codelength, type, protocol, technology, areacode, extended
Type reference list
any
Wildcard Set
This type is a wildcard Set. All present Items match and belongs to this Set. This Set is default available for each Smartspot device using setid 0. No additional properties are required.
Note: This type cannot be created via the Web API.
list
List Set
This type is a list of Items. Each Item that has been added to this list belongs to this Set. This Set has some additional properties.
Properties
limit
- Type: Number
- Required: No
- Range: 0-4000, default 1000
- Maximum number of Items that can be stored in this list. Total Items stored by all List Sets in a Smartspot device cannot exceed 5000. This limit also includes Items that are used for presences.
itemlist
- Type: String, Resource Object ID,
- Required: No
- Resource identifier of a Brain ItemList Set whose content needs to be synchronized to the Smartspot.
restrictions
allow_spot_edit
- Type: Boolean
- Required: No, default is false
- Restrict the Smartspot to add or remove Items from the List (Remote Usage).
allow_server_edit
- Type: Boolean
- Required: No, default is true.
- Restrict the Brain Server to add or remove Items from the List (Local Usage).
Example
The example creates a new Spotset with setid 5 and synchronizes Items from Brain Item List Set (5b9a3b17b6ec870f9c3b0591) to the Smartspot device.
{
"setid": 5,
"type": "list",
"limit": 500,
"itemlist": "5b9a3b17b6ec870f9c3b0591",
"restrictions
": {
"allow_spot_edit": false,
"allow_server_edit": true,
}
}
codemask
Code mask Set
This type compares Item codes on bit level using a code and mask that indicates which parts (bits) of the code should be compared. Each Item that returns the same result belongs to this Set. The following method is used to test the requirement:
result(false/true) = (item.code & set.mask) == set.code
This Set has some additional required properties.
Required Properties
code
- Type: Hexadecimal formatted String.
- Length: Should be minimal the expected Item code length. Should have the same length as property mask.
- Set (part of) the code, or code format that needs to be compared.
mask
- Type: Hexadecimal formatted String.
- Length: Should be minimal the expected Item code length. Should have the same length as property code.
- The mask indicates which parts (bits) of the code should be compared.
Example Scenario
Design a Set that matches each Item code starting with a given prefix (hex) 12 30 55 67. The first 4 bits of the third byte (55) are not important and should be excluded from the mask. All Item codes are at least 12 bytes long.
Set properties:
- Code: (hex) 12 30 55 67 00 00 00 00 00 00 00 00
- Mask: (hex) FF FF F0 FF 00 00 00 00 00 00 00 00
- Result: (hex) 12 30 50 67 00 00 00 00 00 00 00 00
Items to test the results:
- Item 1:
- Code: (hex) 12 35 55 67 66 86 35 12 34 56 78 99
- Mask: (hex) FF FF F0 FF 00 00 00 00 00 00 00 00
- Result: (hex) 12 35 50 67 00 00 00 00 00 00 00 00
- This Item doesn't match, results are not equal.
- Item 2:
- Code: (hex) 12 30 55 67 45 86 35 99 87 65 43 21
- Mask: (hex) FF FF F0 FF 00 00 00 00 00 00 00 00
- Result: (hex) 12 30 50 67 00 00 00 00 00 00 00 00
- This Item does match, results are equal.
{
"setid": 6,
"type": "codemask",
"code": "123055670000000000000000",
"mask": "FFFFF0FF0000000000000000"
}
coderange
Code range Set
This type checks if an Item code is within a specified code range. In case that the Item code is within the range than this Item belongs to the Set. Start and end codes are also included.
This Set has some additional required properties.
Required Properties
start
- Type: Hexadecimal formatted String.
- The Item code that needs to be used as start of the range. This start code is also included.
end
- Type: Hexadecimal formatted String.
- The Item code that needs to be used to end the range. This end code is also included.
Example Scenario
Items in the following range should belong to this Set:
- Start (hex) 55 55 55 55 5a aa aa aa a1 00 00
- End (hex) 55 55 55 55 5a aa aa aa a1 FF FF
The total number of items within this range is 65536.
{
"setid": 7,
"type": "coderange",
"start": "555555555aaaaaaaa10000",
"end": "555555555aaaaaaaa1FFFF"
}
codelength
Code length Set
This type checks if the length of the Item code in bits equals the requirement. If the results is true than the Item belongs to the Set
This Set has some additional required properties.
Required Property
length_bits
- Type: Number, range: 0-512
- The required length of the code in bits. Note: One byte contains 8 bits.
Example Scenario
Items that have a 12 byte code should belong to this Set:
- Bytes to bits: 12 * 8 = 96 bits.
- Property length_bits should should be set to 96.
{
"setid": 8,
"type": "codelength",
"length_bits": 96
}
type
Item type Set
This Set type checks if the type of an Item is equal to the required type. If the result is true than the Item belongs to the Set. This Set has an additional required property.
Required Property
item_type
- Type: String
- Options:
- tag
- smarttag
- relay
- smartspot
- microspot
Example Scenario
Items that have the type tag should belong to this Set.
{
"setid": 9,
"type": "type",
"item_type": "tag"
}
protocol
Item protocol Set
This Set type checks if the protocol of an Item is equal to the required protocol. If the result is true than the Item belongs to the Set. This Set has an additional required property.
Required Property
item_protocol
- Type: String
- Options:
- epcgen2
- ibeacon
- eddystone
- nanoble
- generic
Example Scenario
Items that have the protocol epcgen2 should belong to this Set.
{
"setid": 10,
"type": "protocol",
"item_protocol": "epcgen2"
}
technology
Item technology Set
This Set type checks if the technology of an Item is equal to the required technology. If the result is true than the Item belongs to the Set. This Set has an additional required property.
Required Property
item_technology
- Type: String
- Options:
- rfid
- bluetooth
Example Scenario
Items that have the technology rfid should belong to this Set.
{
"setid": 11,
"type": "technology",
"item_technology": "rfid"
}
areacode
Item area code Set
This Set type checks if the Area Code of an Item is equal to the required Area Code. If the result is true than the Item belongs to the Set. This Set has an additional required property.
Required Property
area_code
- Type: Number
- Range: 0 - 255
Example Scenario
Items that have the Area Code set to 1 should belong to this Set.
{
"setid": 12,
"type": "areacode",
"area_code": 1
}
extended
Item Extended Data Set
Extended Data is specialized and non generic Item data. This type of data doesn't fit within the Item concept and the standard properties such as code, type, protocol or technology. Extended Data is a key value map which can dynamically be extended with an extra number of properties.
Items that have the Extended Data property (key) and match the requirement for value using the selected operator as specified. If the test returns true than the Item belongs to the Set.
Note: Extended data is at the moment only supported for RFID Items and needs to be enabled. At default this feature is disabled due to the time it takes to gather and assemble Extended Data. To enable this setting set code_mode in the Smartspot device from 0 to 1 or 2.
This Set has some additional required properties.
Required Property
key
- Type: String
- Options:
tid
- Value type: Hex formatted String
- RFID Tag Tid Memory Bank.
usr
- Value type: Hex formatted String
- RFID Tag user memory bank.
tmn
- Value type: Number.
- RFID Tag model number.
mdid
- Value type: Number.
- RFID Tag Mask Designer Identification.
value
- Type: Expected type depends on key.
operator
- Type: String
- Options:
gt
Greater Thangte
Greater Than or Equaleq
Equalslt
Lower Thanlte
Lower Than or Equalstarts
Sequence starts with pattern, like this: pattern*in
Wildcard operator, pattern exists in sequence, like this: *pattern*ends
Sequence ends with pattern, like this: *pattern
Example Scenario
All RFID Items that have an extended data map should be checked whether the key usr exists. If this key exists and the value starts with (hex) 0330, than this Item belongs to the Set.
{
"setid": 13,
"type": "extended",
"key": "usr",
"operator": "starts",
"value": "0330"
}
Comments
0 comments
Please sign in to leave a comment.