Skip to content

DeviceKObject

Defined in: src/device.ts:78

A device’s kobject, i.e. /sys/devices/.../<name>.

new DeviceKObject(device, parent): DeviceKObject

Defined in: src/device.ts:79

Device

KObject

DeviceKObject

KObject.constructor

attributes: Map<string, Attribute>

Defined in: src/kobject.ts:23

These attributes use the kobject’s show and store.

KObject.attributes


children: Map<string, KEntry>

Defined in: src/kobject.ts:18

KObject.children


readonly device: Device

Defined in: src/device.ts:80


readonly mode: number = 0o555

Defined in: src/kobject.ts:16

KObject.mode


name: string

Defined in: src/kobject.ts:26

KObject.name


optional parent?: KObject | null

Defined in: src/kobject.ts:27

KObject.parent

get path(): string

Defined in: src/kobject.ts:36

The path of this kobject, relative to the root of sysfs.

string

KObject.path

[dispose](): void

Defined in: src/kobject.ts:74

void

KObject.[dispose]


add_uevent_attr(): void

Defined in: src/kobject.ts:117

void

KObject.add_uevent_attr


create_attribute(name, show?, store?, mode?): Attribute

Defined in: src/kobject.ts:134

string

((kobj) => string) | null

((kobj, value) => void) | null

number = ...

Defaults based on which of show and store were passed.

Attribute

KObject.create_attribute


dispose(): void

Defined in: src/kobject.ts:66

void

KObject.dispose


keys(): Iterable<string>

Defined in: src/kobject.ts:62

The names of everything in this kobject.

Iterable<string>

KObject.keys


lookup(name): KEntry | undefined

Defined in: src/kobject.ts:46

Resolve a single entry by name. Attributes that use this kobject’s show and store are bound before being returned.

string

KEntry | undefined

KObject.lookup


notify_uevent(action, env?): void

Defined in: src/kobject.ts:84

Notify listeners that something happened to kobj.

"add" | "remove" | "change" | "move" | "online" | "offline" | "bind" | "unbind"

UEventEnv = {}

void

KObject.notify_uevent


send_uevent(text): void

Defined in: src/kobject.ts:102

Send a uevent described by text, an action optionally followed by KEY=VALUE pairs. This is what writing to a uevent attribute does.

string

void

KObject.send_uevent


optional show(attr): string

Defined in: src/kobject.ts:78

Attribute

string

KObject.show


optional store(attr, value): void

Defined in: src/kobject.ts:79

Attribute

string

void

KObject.store


uevent(env): void

Defined in: src/device.ts:86

Add variables to the environment of uevents sent for this kobject and its descendants.

UEventEnv

void

notify_uevent

KObject.uevent