Brillo - Exploring BDK code



bdk/device/generic/brillo/
     brillo_emulator_ALL
     kconfig, fconfig, sensor, sepolicy, wifi_driver_hal
     examples (dbus, lights, service)
     .mk & .sh setup files

bdk/device/generic/goldfish/: qemu peripherals (audio, camera, fingerprint, lights, sensors, vibrator)


bdk/device/generic/mini_emulator_ALL and generic/x86_64 (installed HW): .mk files


bdk/device/intel/edison/flash_tools/ brillo-flashall-edison.*




bdk/external/dbus


bdk/external/libbrillo/brillo/
     daemons, dbus, glib, http, minijail, and individual utils/support files?


bdk/external/libbrillo/policy/: device_policy, libpolicy


bdk/external/libweave/
bdk/external/libweave/examples/daemon/ledflasher/ledflasher.cc:
class LedFlasherHandler {
  void Register(weave::Device* device) {
    :
    device->AddCommandDefinitionsFromJson(R"({      "_ledflasher": {         "_set":{           "parameters": {             "_led": {"minimum": 1, "maximum": 3},             "_on": "boolean"           }         },         "_toggle":{           "parameters": {             "_led": {"minimum": 1, "maximum": 3}           }        }      }    })");
device->AddCommandHandler(
"_ledflasher._toggle", ...);
device->AddCommandHandler(
"_ledflasher._set", ...);
:
 
  }
void OnFlasherSetCommand(const std::weak_ptr<weave::Command>& command) {
    UpdateLedState() ==> device_->SetStateProperty("_ledflasher._leds", list, nullptr);
    cmd->Complete(...);
    }


int main(int argc, char** argv) {
  Daemon daemon{opts};
  LedFlasherHandler handler;
  handler.Register(daemon.GetDevice());
  daemon.Run();
  return 0;
}
Above appears to be implementation of
bdk/product/google/example-ledflasher/src/ledflasher/etc/weaved/commands/ledflasher.json


bdk/external/libweave/examples/daemon/README: "Acquire Registration Ticket"
Google Developers - OAuth 2.0 Playground
Obtain URL to initialize the playground with the current configuration (includes OAuth credentials and OAuth tokens in the link): https://developers.google.com/oauthplayground/



bdk/external/libweave/include
bdk/external/libweave/src/
     commands, notification, privet, states
     device_manager.cc: StartPrivet, GetGcdState, AddCommandDefinitions, AddCommand, SetStateProperty, ..
     config.cc: Load(), Config::Transaction::LoadState()

bdk/external/libweave/third_party/: chromium, modp_b64

bdk/external/: dbus, iptables, jpeg, lib*, rootdev, selinux, toybox, wpa_supplicant_8

bdk/frameworks/av/: camera, drm, media, radio, services, sound_trigger


bdk/frameworks/native/: cmds
bdk/frameworks/native/data/etc/: android.hardware.*.xml
         <permissions>
             <feature name="android.hardware.* " />
bdk/frameworks/native/include/: android, diskusage, gui, input, media, powermanager, private, ui
bdk/frameworks/native/libs/: binder, diskusage, gui, input, ui
bdk/frameworks/native/opengl
bdk/frameworks/native/services/: battery, powermanager, sensor

bdk/frameworks/rs/: Render Script (?)
bdk/frameworks/wilhelm/: OpenMAXAL, OpenSLES

bdk/hardware/:
     broadcom/libbt
     bsp/intel/peripheral/: audio, bluetooth, libmraa, libupm, light, sensors, wifi
     bsp/intel/soc/edison/: bootctrl, sepolicy
     bsp/kernel/common/android-3.18
     bsp/kernel/intel/edison-3.10
     libhardware/modules/: audio, camera, input, nfc, power, radio, sensors, soundtrigger, vibrator
     libhardware_legacy

bdk/libnativehelper/: JNI

bdk/out/target/product/brilloemulator_x86_64/
     system/bin - Linux?
     system/etc/init/brillo.rc
     system/etc/os-release.d/bdk_version & product_version
     system/etc/weaved/weaved.conf
     boot.img, kernel, ramdisk.img, system.img, userdata.img

bdk/prebuilts

bdk/product/google/:
     common/brillo_gpios/src/gpio_playground/gpio_playground.cpp: Export "/sys/class/gpio" & file stream
     common/brillo_leds/src/brillo_led_tool/brillo_led_tool.cpp: Toggle "/sys/class/leds/led*/brightness"
     common/sensors_example: Accelerometer and other sensors hw_get_module(SENSORS_HARDWARE_MODULE_ID?

bdk/product/google/
     example-ledflasher/config/brillo/product_id: developer-boards:ledflasher
         Used by the backends to route metrics/crash reports to the right customer.

     example-ledflasher/src/ledflasher/etc/weaved/commands/ledflasher.json
{
  "_ledflasher": {
    "_set": {
      "parameters": {
        "_led": {"minimum": 1, "maximum": 4},
        "_on": "boolean"      }
    },
    "_toggle": {
      "parameters": {
        "_led": {"minimum": 1, "maximum": 4}
      }
    },
    "_animate": {
      "parameters": {
        "_duration": {"minimum": 0.1, "maximum": 100.0},
        "_type": ["none", "marquee_left", "marquee_right", "blink"]
      }
    }
  }
}
     example-ledflasher/src/ledflasher/etc/weaved/states/ledflasher.schema.json
{
  "_ledflasher": {
    "_status": {
      "enum": ["idle", "animating"],
      "default": "idle"    },
    "_leds": {"items": "boolean"}
  }
}
     These two look identical (except additional "animation" in ledflasher.cpp):
         bdk/external/libweave/examples/daemon/ledflasher/ledflasher.cc
         bdk/product/google/example-ledflasher/src/ledflasher/ledflasher.cpp
     But I couldn't decide whether they are interacting with same device & using identical mode of interaction.

     example-ledflasher/src/
     example-ledflasher/src/ledservice/ledstatus.cpp
     example-ledflasher/src/ledservice/dbus_bindings/com.android.LEDService.Service.dbus-xml
    <node name="/com/android/LEDService/Service"
          xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
      <interface name="com.android.LEDService.Service">
        <method name="SetLED">
    :

     example-ledflasher/src/ledservice/dbus_bindings/dbus-service-config.json
{
  "service_name": "com.android.LEDService",
  "object_manager": {
    "name": "com.android.LEDService.ObjectManager",
    "object_path": "/com/android/LEDService"  }
}
     example-ledflasher/src/ledservice/etc/dbus-1/com.android.LEDService.conf
     example-ledflasher/weaved.conf
bdk/system/attestation/server/dbus_service.cc
bdk/system/attestation/server/attestation_service.cc



No comments:

Post a Comment