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


      1. Include device-service-client.h

      2. Create a BDeviceServiceInitializeParamsContainer with b_device_service_initialize_params_container_new and set the main storge directory with b_device_service_initialize_params_container_set_storage_dir

      3. If Matter support is included, additional related configuration should be provided by calls to

        • 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
      4. Create the BDeviceServiceClient instance with b_device_service_client_new

      5. Start the client with b_device_service_client_start

      6. Wire up any desired events using g_signal_connect. Some typical top-level signals of interest 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.

      7. Perform some action with the client such as commissioning a new Matter device with b_device_service_client_commission_deviceor changing a resource on a device to perform some action with b_device_service_client_write_resource