#!/bin/bash # Add a decoder/parser config (POST /configs/beacons). # Usage: ./config/add_parser.sh or BASE_URL=http://host:port ./config/add_parser.sh SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" . "${SCRIPT_DIR}/../_common.sh" curl -s -X POST "${BASE_URL}/configs/beacons" \ -H "Content-Type: application/json" \ -d '{ "name": "Eddystone", "min": 4, "max": 255, "pattern": ["0x16", "0xAA", "0xFE", "0x20"], "configs": { "battery": {"offset": 6, "length": 2, "order": "bigendian"}, "temperature": {"offset": 8, "length": 2, "order": "fixedpoint"} } }' echo ""