Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The Barton Reference App provides a CLI for interactively interfacing with Barton Device Service.
    • Interacting with Barton from your Code

      • Setup and Initialization
        • Include device-service-client.h
        • Create
      a BDeviceServiceInitializeParamsContainer
        • initialization parameters with b_device_service_initialize_params_container_new
      and set the main storge directory
        • Configure storage location with b_device_service_initialize_params_container_set_storage_dir
      If
        • For Matter support
      is included
        • , provide additional
      related configuration should be provided by calls to
        • configuration:
          • b_device_service_initialize_params_container_set_matter_storage_dir
          • b_device_service_initialize_params_container_set_matter_attestation_trust_store_dir
          • b_device_service_initialize_params_container_set_network_credentials_provider
      • Client Creation and Startup
        • Create the
      BDeviceServiceClient
        • client instance with b_device_service_client_new
      Start
        • Initialize the
      client
        • connection with b_device_service_client_start
      Wire up any desired
      • Event Registration
        • Connect to system events using g_signal_connect
      . Some typical top-level signals of interest
        • Common signals include:
          • B_DEVICE_SERVICE_CLIENT_SIGNAL_NAME_DISCOVERY_STARTED
          • B_DEVICE_SERVICE_CLIENT_SIGNAL_NAME_DISCOVERY_STOPPED
          • B_DEVICE_SERVICE_CLIENT_SIGNAL_NAME_DEVICE_DISCOVERED
          • B_DEVICE_SERVICE_CLIENT_SIGNAL_NAME_DEVICE_REJECTED
          • B_DEVICE_SERVICE_CLIENT_SIGNAL_NAME_DEVICE_ADDED
          • B_DEVICE_SERVICE_CLIENT_SIGNAL_NAME_ENDPOINT_ADDED
          • B_DEVICE_SERVICE_CLIENT_SIGNAL_NAME_DEVICE_DISCOVERY_COMPLETED
          • B_DEVICE_SERVICE_CLIENT_SIGNAL_NAME_DEVICE_DISCOVERY_FAILED

          Once devices are added, additional signals can be connected to get events from those as well.

              • Discovery events (DISCOVERY_STARTED, DISCOVERY_STOPPED)
              • Device lifecycle events (DEVICE_DISCOVERED, DEVICE_ADDED)
              • Endpoint events (ENDPOINT_ADDED)
              • Status events (DEVICE_DISCOVERY_COMPLETED, DEVICE_DISCOVERY_FAILED)
          • Device Interaction
            • Commission new devices with b_device_service_client_commission_device
            • Control devices by writing to resources with b_device_service_client_write_resource
            • Read device state
          Perform some action with the client such as commissioning a new Matter device
            • with b_device_service_client_
          commission
            • get_
          device or changing a resource on a device to perform some action
            • resource_by_uri
            • Execute device functions with b_device_service_client_
          write
            • execute_resource