### Install PyBeacon Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/PyBeacon/README.md Standard installation command for the PyBeacon package. ```bash sudo pip install PyBeacon ``` -------------------------------- ### Install CocoaPods Dependencies Source: https://github.com/google/eddystone/blob/master/tools/gatt-config/ios/README.md Run this command in the terminal from your project's directory to install necessary dependencies via CocoaPods. Ensure you have CocoaPods and Xcode installed. ```bash pod install ``` -------------------------------- ### Start Eddystone-URL Advertisement on Linux Source: https://context7.com/google/eddystone/llms.txt Uses the `advertise-url` script to start broadcasting a specified URL. Requires BlueZ and Python 3. ```bash # Using advertise-url script # Start advertising a URL ./advertise-url -u http://example.com ``` -------------------------------- ### Arduino Eddystone-URL Beacon Example Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/README.md This is an example of an Eddystone-URL beacon implementation for Arduino using the BLEPeripheral library. Ensure you have compatible hardware and the library installed. ```ino #include // Define the Eddystone-URL service UUID #define EDDYSTONE_URL_SERVICE_UUID "0xFEAA" // Define the Eddystone-URL service characteristics #define EDDYSTONE_URL_SERVICE_CHAR "0x2A03" // Define the URL to be broadcast #define URL_TO_BROADCAST "https://www.google.com" BLEPeripheral peripheral; void setup() { Serial.begin(9600); Serial.println("Starting Eddystone-URL beacon..."); // Initialize the BLE peripheral peripheral.begin(); // Set the device name peripheral.setDeviceName("Eddystone-URL"); // Add the Eddystone-URL service peripheral.addAttribute(EddystoneURLService()); // Start advertising the Eddystone-URL service peripheral.advertise(); Serial.println("Advertising Eddystone-URL..."); } void loop() { // The Eddystone-URL service is advertised automatically by the library // No additional code is needed in the loop for basic advertising. delay(1000); } // EddystoneURLService class definition (simplified for example) class EddystoneURLService : public BLEService { public: EddystoneURLService() : BLEService(EDDYSTONE_URL_SERVICE_UUID) { // Add the Eddystone-URL characteristic addAttribute(EddystoneURLCharacteristic()); } private: class EddystoneURLCharacteristic : public BLECharacteristic { public: EddystoneURLCharacteristic() : BLECharacteristic(EDDYSTONE_URL_SERVICE_CHAR, BLERights::BLERightRead) { // Set the initial value of the characteristic (URL data) setValue((uint8_t*)URL_TO_BROADCAST, strlen(URL_TO_BROADCAST)); } }; }; ``` -------------------------------- ### Install PyBeacon Package Source: https://context7.com/google/eddystone/llms.txt Installs the PyBeacon Python package using pip, which provides command-line tools for Eddystone scanning and advertising. ```bash # Using PyBeacon (pip package) sudo pip install PyBeacon ``` -------------------------------- ### Install Bluez Dependencies Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/PyBeacon/README.md Required system-level dependencies for PyBeacon on Linux. ```bash sudo apt-get install bluez bluez-hcidump ``` -------------------------------- ### Install EID Tools Dependencies Source: https://context7.com/google/eddystone/llms.txt Installs Python dependencies required for the EID Tools utility, including pycrypto and hkdf. ```bash # Install dependencies pip install pycrypto hkdf ``` -------------------------------- ### Advertise URL with Eddystone-URL Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/linux/README.md Use this command to start advertising a specific URL using the Eddystone-URL protocol. Ensure the URL is correctly formatted. ```bash ./advertise-url -u http://your/url ``` -------------------------------- ### Install Linux BlueZ Dependencies Source: https://context7.com/google/eddystone/llms.txt Installs the necessary BlueZ packages for Bluetooth operations on Debian-based Linux systems. ```bash # Installation sudo apt-get install bluez bluez-hcidump python3 ``` -------------------------------- ### Import Eddystone Advertisement Module Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md This snippet shows how to import the 'eddystone-advertisement' module. Ensure this module is installed in your project. ```javascript const advertisement = require('eddystone-advertisement') ``` -------------------------------- ### Register Eddystone URL Advertisement Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Use this function to register and start advertising a URL. It returns a promise that resolves with an advertisement object. Ensure the 'eddystone' object is available globally. ```javascript let registered_adv; eddystone.registerAdvertisement({ type: 'url', url: 'https://example.com', advertisedTxPower: -20 }).then(advertisement => { registered_adv = advertisement; console.log('Advertising: ' + advertisement.url) }).catch(error => console.log(error.message)); ``` -------------------------------- ### Upgrade PyBeacon Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/PyBeacon/README.md Command to update an existing PyBeacon installation to the latest version. ```bash sudo pip install PyBeacon --upgrade ``` -------------------------------- ### GET Capabilities (Characteristic 1) Source: https://github.com/google/eddystone/blob/master/configuration-service/README.md Retrieves the beacon's capabilities, including supported slots, frame types, and radio power levels. ```APIDOC ## GET a3c87501-8ed3-4bdf-8a39-a01bebede295 ### Description Returns a byte array detailing the beacon's hardware and software capabilities. ### Method GET ### Endpoint a3c87501-8ed3-4bdf-8a39-a01bebede295 ### Response #### Success Response (200) - **version_byte** (uint8) - Spec version - **max_supported_total_slots** (uint8) - Max concurrent slots - **max_supported_eid_slots** (uint8) - Max EID slots - **capabilities_bit_field** (uint8) - Bit field for variable support (0x01: Var Adv, 0x02: Var Tx Power) - **supported_frame_types_bit_field** (uint16) - Supported frame types (UID, URL, TLM, EID) - **supported_radio_tx_power** (array) - List of supported Tx power values in dBm ``` -------------------------------- ### Full Registration Simulation with EID Tools Source: https://context7.com/google/eddystone/llms.txt Simulates a full beacon registration process using `eidtools.py`. Requires the service public key, rotation exponent, and current Unix timestamp. ```bash # Full registration simulation python eidtools.py registration \ h \ 10 \ $(date +%s) # Current Unix timestamp ``` -------------------------------- ### PyBeacon Usage Syntax Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/PyBeacon/README.md Command-line interface options for scanning and advertising URLs. ```bash PyBeacon [-h] [-u [URL]] [-s] [-t] [-o] [-v] [-V] ``` -------------------------------- ### Simulate Beacon Broadcast with EID Tools Source: https://context7.com/google/eddystone/llms.txt Simulates a beacon broadcast at a specific time using `eidtools.py`. Requires the identity key, rotation exponent, beacon initial time, and service initial time. ```bash # Simulate beacon broadcast at current time python eidtools.py beacon \ b \ 10 \ 1234567890 \ $(date +%s -d '2024-01-01') # Service initial time ``` -------------------------------- ### Advertise URL with PyBeacon Source: https://context7.com/google/eddystone/llms.txt Uses the PyBeacon command-line tool to advertise a specified URL. ```bash # Advertise a URL PyBeacon -u http://example.com ``` -------------------------------- ### platform() Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Detects what API is available in the platform and returns a wrapper for the underlying BLE Advertising API. ```APIDOC ## platform() ### Description Detects what API is available in the platform. ### Response - **Returns** (Object) - An object that wraps the underlying BLE Advertising API. ### Errors - Error: If the platform is unsupported. ``` -------------------------------- ### Compile Eddystone-URL Project Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/BlueGiga-BLED112/README.md Command to compile the project source files into a hex file using the BlueGiga build tool. ```bash bgbuild eddystone-url.bgproj ``` -------------------------------- ### Kiosk Mode Configuration for manifest.json Source: https://github.com/google/eddystone/blob/master/tools/eddystone-chrome-app-sample/README.md For deployment, add 'kiosk_enabled' and 'kiosk_only' to true in your manifest.json file to enable BLE Advertising in Single App Kiosk Mode. ```json "kiosk_enabled": true, "kiosk_only": true ``` -------------------------------- ### Scan for URLs with PyBeacon Source: https://context7.com/google/eddystone/llms.txt Uses the PyBeacon command-line tool to scan for nearby Eddystone-URL beacons. ```bash # Scan for URLs PyBeacon -s ``` -------------------------------- ### Eddystone-URL Configuration Service Overview Source: https://github.com/google/eddystone/blob/master/eddystone-url/docs/config-service-spec.md Overview of the service declaration and return codes for the Eddystone-URL Configuration Service. ```APIDOC ## Service Declaration ### Service UUID ee0c2080-8786-40ba-ab96-99b91ac981d8 ### Return Codes | Code | Description | | :--- | :--- | | 0x00 | Success | | 0x03 | Write Not Permitted | | 0x08 | Insufficient Authorization | | 0x0d | Invalid Attribute Length | ``` -------------------------------- ### Continuous Eddystone-URL Scanning on Linux Source: https://context7.com/google/eddystone/llms.txt Uses the `scan-for-urls` script to continuously scan for Eddystone-URL beacons. ```bash # Continuous scanning ./scan-for-urls ``` -------------------------------- ### Compute EID with EID Tools Source: https://context7.com/google/eddystone/llms.txt Computes an EID (Ephemeral Identifier) from an identity key, rotation exponent, and beacon time. Supports various input formats for the identity key. ```bash # Compute EID from identity key python eidtools.py eid \ b \ 10 \ 1234567890 # Beacon time in seconds ``` -------------------------------- ### EddystoneURL.constructServiceData Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Constructs a valid Eddystone-URL service data from a URL and a Tx Power value. ```APIDOC ## EddystoneURL.constructServiceData ### Description Constructs a valid Eddystone-URL service data from a URL and a Tx Power value. ### Parameters #### Parameters - **url** (string) - Required - The URL to use in the service data. - **advertisedTxPower** (number) - Required - The Tx Power to use in the service data. ### Response - **Returns** (Array) - The service data. ``` -------------------------------- ### Verbose Scanning with PyBeacon Source: https://context7.com/google/eddystone/llms.txt Uses the PyBeacon command-line tool with the verbose flag for debugging output during scans. ```bash # Verbose output for debugging PyBeacon -s -V ``` -------------------------------- ### Continuous Scan for URLs Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/linux/README.md This command initiates a continuous scan for URLs, displaying any detected Eddystone-URL advertisements in real-time. It's ideal for ongoing monitoring. ```bash ./scan-for-urls ``` -------------------------------- ### Scan for Eddystone-URLs on Linux Source: https://context7.com/google/eddystone/llms.txt Uses the `scan-for-urls` script to perform a single scan for nearby Eddystone-URL beacons. ```bash # Using scan-for-urls script # Single scan for nearby URLs ./scan-for-urls -s ``` -------------------------------- ### EID Registration and Key Derivation Source: https://context7.com/google/eddystone/llms.txt Commands for generating keys, computing shared secrets, and deriving identity keys using eidtools.py and HKDF-SHA256. ```python # EID Registration using eidtools.py # Step 1: Generate beacon key pair from random source python eidtools.py keygen h$(openssl rand -hex 32) # Output: # Private: [32-byte private key] # Public: [32-byte beacon public key] # Step 2: Compute shared secret python eidtools.py shared h h # Output: [32-byte shared secret] # Step 3: Derive identity key from shared secret python eidtools.py ik h h h # Output: [16-byte identity key] # Step 4: Generate EID for verification python eidtools.py eid b 10 1234567890 # Arguments: identity_key, rotation_exponent, beacon_time_seconds # Output: [8-byte ephemeral identifier] # Full registration flow (automated): python eidtools.py registration h 10 1234567890 # Generates random beacon keypair and outputs: # - Beacon public key # - Shared secret # - Identity key # - Initial EID # - Registration request JSON # - Broadcast command for testing # Identity Key Derivation (HKDF-SHA256): salt = service_public_key + beacon_public_key # 64 bytes prk = HKDF_Extract(salt, shared_secret) identity_key = HKDF_Expand(prk, "", 32)[:16] # Truncate to 128 bits ``` -------------------------------- ### Scan for Single URL with PyBeacon Source: https://context7.com/google/eddystone/llms.txt Uses the PyBeacon command-line tool to perform a single scan and detect only one URL. ```bash # Scan for single URL only PyBeacon -s -o ``` -------------------------------- ### Construct Eddystone-UID Service Data Source: https://context7.com/google/eddystone/llms.txt Manually construct service data for an Eddystone-UID frame. Requires Tx power, namespace, and instance. The output is a byte array. ```javascript const EddystoneUID = require('eddystone-uid'); // UID service data: [frame_type, tx_power, ...namespace, ...instance, rfu, rfu] const uidServiceData = EddystoneUID.constructServiceData( -10, // Tx power '8b0ca750095477cb3e77', // Namespace (hex string) '010203040506' // Instance (hex string) ); ``` -------------------------------- ### Stop Advertising with PyBeacon Source: https://context7.com/google/eddystone/llms.txt Uses the PyBeacon command-line tool to terminate any active URL advertisements. ```bash # Stop advertising PyBeacon -t ``` -------------------------------- ### Generate Curve25519 Keypair with EID Tools Source: https://context7.com/google/eddystone/llms.txt Generates a Curve25519 keypair using `eidtools.py` from a random hexadecimal source. The input format is specified by a prefix (e.g., 'h' for hex). ```bash # Generate Curve25519 keypair from random source python eidtools.py keygen h$(openssl rand -hex 32) ``` -------------------------------- ### Perform Single Scan for URLs Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/linux/README.md Run a single scan to detect and list any nearby URLs being advertised over Eddystone-URL. This is suitable for one-time checks. ```bash ./scan-for-urls -s ``` -------------------------------- ### Beacon Configuration Data Source: https://github.com/google/eddystone/blob/master/eddystone-url/docs/config-service-spec.md Endpoints for managing URI data, flags, and transmission power levels. ```APIDOC ## READ/WRITE ee0c2084-8786-40ba-ab96-99b91ac981d8 ### Description Reads or writes the URI data. Must be unlocked to write. ### Method READ/WRITE ### Endpoint ee0c2084-8786-40ba-ab96-99b91ac981d8 ### Request Body - **URI Data** (uint8[0..18]) - Required - The URI structure containing scheme prefix and encoded URL. ## READ/WRITE ee0c2085-8786-40ba-ab96-99b91ac981d8 ### Description Reads or writes the flags. Must be unlocked to write. ### Method READ/WRITE ### Endpoint ee0c2085-8786-40ba-ab96-99b91ac981d8 ### Request Body - **Flags** (uint8) - Required - The flag value (currently fixed at 0x10). ## READ/WRITE ee0c2086-8786-40ba-ab96-99b91ac981d8 ### Description Reads or writes the Advertised TX Power Levels array. Must be unlocked to write. ### Method READ/WRITE ### Endpoint ee0c2086-8786-40ba-ab96-99b91ac981d8 ### Request Body - **TX Power Levels** (int8[4]) - Required - Array of power levels in dBm. ``` -------------------------------- ### Continuous Scan and Resolve Short URLs Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/linux/README.md Combine a continuous URL scan with a URL resolver to automatically convert short Eddystone-URL advertisements to their full, long-form URLs. Specify the target URLs for resolution using the -u flag. ```bash ./scan-for-urls | ./resolve-urls -u [URLs] ``` -------------------------------- ### Characteristic 7: Unlock Source: https://github.com/google/eddystone/blob/master/configuration-service/README.md Handles the challenge-response authentication process to unlock the beacon for configuration. ```APIDOC ## GET a3c87507-8ed3-4bdf-8a39-a01bebede295 ### Description Reads a 128-bit challenge token for one-time use to initiate the unlock process. ### Method GET ### Endpoint a3c87507-8ed3-4bdf-8a39-a01bebede295 ### Response #### Success Response (200) - **challenge** (byte_array) - 16-byte challenge token. ## POST a3c87507-8ed3-4bdf-8a39-a01bebede295 ### Description Writes a 128-bit encrypted unlock_token to verify the client knows the beacon's lock code. ### Method POST ### Endpoint a3c87507-8ed3-4bdf-8a39-a01bebede295 ### Request Body - **unlock_token** (byte_array) - 16-byte encrypted value generated via AES-128-ECB. ``` -------------------------------- ### Register Eddystone-UID Advertisement Source: https://context7.com/google/eddystone/llms.txt Register an Eddystone-UID advertisement with namespace, instance, and optional advertisedTxPower. The promise resolves with advertisement details or rejects on error. ```javascript // Register an Eddystone-UID advertisement eddystone.registerAdvertisement({ type: 'uid', namespace: '8b0ca750095477cb3e77', // 10-byte hex string instance: '010203040506', // 6-byte hex string advertisedTxPower: -10 }).then(advertisement => { console.log('Advertising UID'); console.log('Namespace: ' + advertisement.namespace); console.log('Instance: ' + advertisement.instance); }).catch(error => console.error(error.message)); ``` -------------------------------- ### Construct Eddystone-UID Service Data Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Constructs Eddystone-UID service data using the provided transmission power, namespace, and instance. Ensure the namespace and instance are provided as either arrays of numbers or strings. Refer to the UID Frame Specification for details. ```javascript EddystoneUID.constructServiceData(advertisedTxPower, namespace, instance) ``` -------------------------------- ### Common Tx Power Values and Ranges Source: https://context7.com/google/eddystone/llms.txt Lists common Tx power values used in Eddystone frames and their approximate broadcast ranges. ```text +4 dBm (0x04) = High power, ~50m range -8 dBm (0xF8) = Medium power, ~10m range -20 dBm (0xEC) = Low power, ~3m range ``` -------------------------------- ### Register Eddystone BLE Advertisement on ChromeOS Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Use this method to register an Eddystone BLE advertisement on ChromeOS. It requires an options object specifying the advertisement's characteristics. The method returns a promise that resolves with the registered advertisement or rejects with an error. ```javascript EddystoneChromeOS.registerAdvertisement(options) ``` -------------------------------- ### Tx Power Calibration Procedure Source: https://context7.com/google/eddystone/llms.txt Explains the procedure for calibrating the Tx power value advertised by an Eddystone beacon. This involves measuring the actual signal strength at 1 meter and adding a constant offset. ```text Tx Power Measurement Procedure: 1. Measure actual signal at 1 meter from beacon 2. Add 41 dBm (free-space path loss at 1m for 2.4GHz) 3. Result = Tx power value to advertise ``` -------------------------------- ### Resolve Shortened URLs from Scan Source: https://context7.com/google/eddystone/llms.txt Pipes the output of `scan-for-urls` to `resolve-urls` to resolve any shortened URLs detected. ```bash # Scan and resolve shortened URLs ./scan-for-urls | ./resolve-urls ``` -------------------------------- ### WRITE Characteristic 11: Factory Reset Source: https://github.com/google/eddystone/blob/master/configuration-service/README.md Resets the beacon to its factory state by writing a specific value, provided the beacon is unlocked. ```APIDOC ## WRITE a3c8750b-8ed3-4bdf-8a39-a01bebede295 ### Description Resets the beacon to its factory state if the value 0x0B is written. This destroys all user-configured slot data but preserves the unlock key. ### Method WRITE ### Endpoint a3c8750b-8ed3-4bdf-8a39-a01bebede295 ### Parameters #### Request Body - **reset_boolean** (uint8) - Required - Must be 0x0B to trigger the reset. ``` -------------------------------- ### Derive Identity Key with EID Tools Source: https://context7.com/google/eddystone/llms.txt Derives an identity key from a shared secret, service public key, and beacon public key. Requires keys in specific formats (hexadecimal or base64). ```bash # Derive identity key from shared secret python eidtools.py ik \ h \ h \ h ``` -------------------------------- ### Register Eddystone-URL Advertisement Source: https://context7.com/google/eddystone/llms.txt Use this to register an Eddystone-URL advertisement. It requires the URL and optionally advertisedTxPower. The promise resolves with advertisement details or rejects on error. ```javascript // Register an Eddystone-URL advertisement let registered_adv; eddystone.registerAdvertisement({ type: 'url', url: 'https://example.com', advertisedTxPower: -20 // dBm at 0 meters }).then(advertisement => { registered_adv = advertisement; console.log('Advertising URL: ' + advertisement.url); console.log('Advertisement ID: ' + advertisement.id); }).catch(error => { console.error('Failed to register: ' + error.message); }); ``` -------------------------------- ### Lock State Management Source: https://github.com/google/eddystone/blob/master/eddystone-url/docs/config-service-spec.md Endpoints for reading the lock state, locking, and unlocking the beacon. ```APIDOC ## GET ee0c2081-8786-40ba-ab96-99b91ac981d8 ### Description Reads the current lock state of the beacon. ### Method GET ### Endpoint ee0c2081-8786-40ba-ab96-99b91ac981d8 ### Response - **Lock State** (boolean) - Returns true if the device is locked. ## WRITE ee0c2082-8786-40ba-ab96-99b91ac981d8 ### Description Locks the beacon and sets the single-use lock-code. ### Method WRITE ### Endpoint ee0c2082-8786-40ba-ab96-99b91ac981d8 ### Request Body - **Lock Code** (uint128) - Required - The lock code to set. ## WRITE ee0c2083-8786-40ba-ab96-99b91ac981d8 ### Description Unlocks the beacon and clears the single-use lock-code. ### Method WRITE ### Endpoint ee0c2083-8786-40ba-ab96-99b91ac981d8 ### Request Body - **Unlock Key** (uint128) - Required - The key to unlock the beacon. ``` -------------------------------- ### Construct ChromeOS Advertisement Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Constructs the specific advertisement format required by ChromeOS. This method may throw errors if the frame type, Tx Power value, URL scheme prefix, or URL characters are invalid or unsupported. ```javascript EddystoneChromeOS._constructAdvertisement() ``` -------------------------------- ### Generate Eddystone Service Keypair Source: https://context7.com/google/eddystone/llms.txt Generates a new keypair for an Eddystone service. The public key is shared with beacons for registration. ```python python eidtools.py keygen aSERVICE_SECRET_SEED_32_BYTES ``` -------------------------------- ### Service Characteristics Source: https://github.com/google/eddystone/blob/master/eddystone-url/docs/config-service-spec.md List of mandatory and optional characteristics available for configuration. ```APIDOC ## Characteristics - **Lock State** (Mandatory) - **Lock** (Optional) - **Unlock** (Optional) - **URI Data** (Mandatory) - **URI Flags** (Mandatory) - **Advertised Tx Power Levels** (Mandatory) - **Tx Power Mode** (Mandatory) - **Beacon Period** (Mandatory) - **Reset** (Mandatory) *Note: Characteristics marked with an asterisk (*) require the device to be in an unlocked state for write operations.* ``` -------------------------------- ### Monitor Current Beacon EID Source: https://context7.com/google/eddystone/llms.txt Monitors the current ephemeral ID (EID) of a beacon using its identity key and timing information. Requires beacon identity key, configuration, and timing parameters. ```python python eidtools.py beacon b 10 ``` -------------------------------- ### EddystoneUID.constructServiceData Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Constructs valid Eddystone-UID service data. ```APIDOC ## EddystoneUID.constructServiceData ### Description Constructs a valid Eddystone-UID service data from a Tx Power value, namespace, and instance. ### Parameters #### Request Body - **advertisedTxPower** (number) - Required - The Tx Power included in the service data. - **namespace** (Array | string) - Required - The namespace to advertise. - **instance** (Array | string) - Required - The instance to advertise. ### Response #### Success Response (200) - **serviceData** (Array) - The constructed service data. ``` -------------------------------- ### Characteristic 8: Public ECDH Key Source: https://github.com/google/eddystone/blob/master/configuration-service/README.md Provides access to the beacon's 256-bit public ECDH key. ```APIDOC ## GET a3c87508-8ed3-4bdf-8a39-a01bebede295 ### Description Reads the beacon's 256-bit public ECDH key (little-endian). ### Method GET ### Endpoint a3c87508-8ed3-4bdf-8a39-a01bebede295 ### Response #### Success Response (200) - **key** (byte_array) - 32-byte public ECDH key. ``` -------------------------------- ### EddystoneChromeOS.registerAdvertisement Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Registers an Eddystone BLE advertisement on ChromeOS. ```APIDOC ## EddystoneChromeOS.registerAdvertisement ### Description Registers an Eddystone BLE advertisement. ### Parameters #### Request Body - **options** (EddystoneAdvertisementOptions) - Required - The characteristics of the advertisement. ### Response #### Success Response (200) - **advertisement** (EddystoneAdvertisement) - The registered advertisement object. ``` -------------------------------- ### Stop Eddystone-URL Advertisement on Linux Source: https://context7.com/google/eddystone/llms.txt Uses the `advertise-url` script to stop any active URL advertisements. ```bash # Stop advertising ./advertise-url -s ``` -------------------------------- ### ADV Slot Data Configuration Formats Source: https://context7.com/google/eddystone/llms.txt Defines the byte-level write formats for the ADV Slot Data characteristic (750a) to configure different beacon frame types. ```text ADV Slot Data Characteristic (750a): Write UID Frame (17 bytes): | 0x00 | Namespace (10 bytes) | Instance (6 bytes) | Example: 00 8B0CA750095477CB3E77 010203040506 Write URL Frame (3-19 bytes): | 0x10 | Scheme | Encoded URL (1-17 bytes) | Example: 10 03 676F6F676C6507 (https://google.com) Write TLM Frame (1 byte): | 0x20 | Beacon automatically broadcasts TLM with current telemetry. If EID slot exists, broadcasts encrypted TLM (ETLM). Write EID Frame - ECDH Method (34 bytes): | 0x30 | Service Public Key (32 bytes, little-endian) | Exponent | Beacon generates keypair, computes shared secret and identity key. Write EID Frame - Shared Key Method (18 bytes): | 0x30 | Encrypted Identity Key (16 bytes, little-endian) | Exponent | Identity key is AES-128-ECB encrypted with lock code. Clear Slot (1 byte): | 0x00 | Stops broadcasting and destroys slot state (including EID keys). Read Response Formats: - UID/URL/TLM: Raw broadcast data including Tx power - EID (14 bytes): | 0x30 | Exponent | Clock (4 bytes) | EID (8 bytes) | - Empty slot: Empty array or single 0x00 byte ``` -------------------------------- ### Eddystone-UID Frame Structure Source: https://context7.com/google/eddystone/llms.txt Defines the 20-byte structure for the UID frame, including namespace and instance identifiers. ```text Frame Structure (20 bytes total): Offset | Field | Description -------|--------------|---------------------------------- 0 | Frame Type | Value = 0x00 1 | Ranging Data | Calibrated Tx power at 0m (dBm) 2-11 | NID[0-9] | 10-byte Namespace ID 12-17 | BID[0-5] | 6-byte Instance ID 18-19 | RFU | Reserved, must be 0x00 Example UID Frame (hex): 00 F4 8B0CA750095477CB3E77 010203040506 0000 | | | | | | | | | +-- RFU bytes | | | +-- Instance: 010203040506 | | +-- Namespace: 8B0CA750095477CB3E77 | +-- Tx Power: -12 dBm (0xF4 signed) +-- Frame Type: UID ``` -------------------------------- ### Register Eddystone Beacon Source: https://context7.com/google/eddystone/llms.txt Registers a beacon with the service by providing the service's public key, beacon configuration, and current timestamp. Outputs the beacon's public key, identity key, and initial EID. ```python python eidtools.py registration h1234...5678 10 $(date +%s) ``` -------------------------------- ### Enable BLE Advertising Flag Source: https://github.com/google/eddystone/blob/master/tools/eddystone-chrome-app-sample/README.md For development, enable the 'enable-ble-advertising-in-apps' flag in chrome://flags to allow advertising without Kiosk Mode. This is specific to Chrome OS. ```text chrome://flags/#enable-ble-advertising-in-apps ``` -------------------------------- ### Construct Eddystone-URL Service Data Source: https://context7.com/google/eddystone/llms.txt Manually construct service data for an Eddystone-URL frame. This is useful for custom implementations. The output is a byte array. ```javascript // Construct service data manually (for custom implementations) const EddystoneURL = require('eddystone-url'); // URL service data: [frame_type, tx_power, scheme, ...encoded_url] const urlServiceData = EddystoneURL.constructServiceData( 'https://google.com', -20 // Tx power in dBm ); // Returns: [0x10, 0xEC, 0x03, 0x67, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x07] ``` -------------------------------- ### ADV Slot Data Configuration Source: https://context7.com/google/eddystone/llms.txt Details on how to write frame data to the ADV Slot Data characteristic (750a). ```APIDOC ## WRITE ADV Slot Data (750a) ### Description Configures the broadcast frame type and data for a specific slot. ### Request Formats - **UID Frame**: `0x00` + Namespace (10 bytes) + Instance (6 bytes) - **URL Frame**: `0x10` + Scheme + Encoded URL (1-17 bytes) - **TLM Frame**: `0x20` - **EID Frame (ECDH)**: `0x30` + Service Public Key (32 bytes) + Exponent - **EID Frame (Shared Key)**: `0x30` + Encrypted Identity Key (16 bytes) + Exponent - **Clear Slot**: `0x00` (Stops broadcasting and destroys slot state) ### Response Formats - **UID/URL/TLM**: Raw broadcast data including Tx power. - **EID**: `0x30` + Exponent + Clock (4 bytes) + EID (8 bytes). ``` -------------------------------- ### Stop Eddystone-URL Advertisement Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/linux/README.md Execute this command to stop any ongoing URL advertisements. This is useful for managing active broadcasts. ```bash ./advertise-url -s ``` -------------------------------- ### Eddystone URL Flags Source: https://github.com/google/eddystone/blob/master/eddystone-url/implementations/BlueGiga-BLED112/attributes.txt Retrieves or sets the Eddystone URL flags. ```APIDOC ## GET/POST /google/eddystone/esurl_flags ### Description Retrieves the Eddystone URL flags or sets new flags. ### Method GET, POST ### Endpoint /google/eddystone/esurl_flags ### Parameters #### Query Parameters (for GET) - **flags** (integer) - Optional - The flags to set. #### Request Body (for POST) - **flags** (integer) - Required - The Eddystone URL flags to set. ### Request Example (POST) ```json { "flags": 1 } ``` ### Response #### Success Response (200) - **flags** (integer) - The Eddystone URL flags. #### Response Example (GET) ```json { "flags": 1 } ``` ``` -------------------------------- ### Eddystone Advertisement Options Source: https://github.com/google/eddystone/blob/master/libraries/javascript/eddystone-advertising/README.md Defines the structure for Eddystone advertisement options. ```APIDOC ### EddystoneAdvertisementOptions Object that contains the characteristics of the package to advertise. **Properties** - **type** (EddystoneFrameType) - Required - Type of Eddystone. For now only 'url' is supported. - **url** (string | undefined) - Optional - The URL to advertise. - **advertisedTxPower** (number | undefined) - Optional - The Tx Power to advertise. ``` -------------------------------- ### Advertising Interval Source: https://github.com/google/eddystone/blob/master/configuration-service/README.md Manages the advertising interval for the Eddystone beacon. This can be read and written if variable advertising is supported. If not, writes affect all slots and reads return the last set value. Values are clamped to legal ranges. ```APIDOC ## GET /adv_interval ### Description Reads the current advertising interval in milliseconds. ### Method GET ### Endpoint /adv_interval ### Parameters None ### Request Example None ### Response #### Success Response (200) - **adv_interval** (uint16_t) - The advertising interval in milliseconds (big-endian). #### Response Example ```json { "adv_interval": 100 } ``` ## POST /adv_interval ### Description Writes the advertising interval in milliseconds. If IS_VARIABLE_ADV_SUPPORTED is not set, this affects all slots. ### Method POST ### Endpoint /adv_interval ### Parameters None ### Request Body - **adv_interval** (uint16_t) - The desired advertising interval in milliseconds (big-endian). ### Request Example ```json { "adv_interval": 150 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Lock State Source: https://github.com/google/eddystone/blob/master/configuration-service/README.md Manages the lock state of the beacon. The current state can be read, and the beacon can be locked or unlocked by writing specific byte values. ```APIDOC ## GET /lock_state ### Description Reads the current lock state of the beacon. ### Method GET ### Endpoint /lock_state ### Parameters None ### Request Example None ### Response #### Success Response (200) - **lock_state** (uint8_t) - The current lock state (0x00: LOCKED, 0x01: UNLOCKED, 0x02: UNLOCKED AND AUTOMATIC RELOCK DISABLED). #### Response Example ```json { "lock_state": 1 } ``` ## POST /lock_state ### Description Writes to change the lock state of the beacon. Requires a lock byte and optionally encrypted keys. ### Method POST ### Endpoint /lock_state ### Parameters None ### Request Body - **lock_byte** (uint8_t) - The byte value to set the lock state (e.g., 0x00 to lock, 0x01 to unlock). - **encrypted_key** (byte_array[16]) - Optional 16-byte encrypted key for state transitions. ### Request Example To lock the beacon: ```json { "lock_byte": 0 } ``` To unlock the beacon (assuming a valid key): ```json { "lock_byte": 1, "encrypted_key": "00000000000000000000000000000000" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success or failure of the operation. #### Response Example ```json { "status": "success" } ``` ```