Skip to content

KObject

Defined in: src/kobject.ts:15

Unlike Linux, we don’t use ksets, ktypes, or attribute groups.

new KObject(name, parent?): KObject

Defined in: src/kobject.ts:23

string

KObject | null

KObject

attributes: Map<string, Attribute>

Defined in: src/kobject.ts:21

These attributes use the kobject’s show and store.


children: Map<string, KEntry>

Defined in: src/kobject.ts:16


name: string

Defined in: src/kobject.ts:24


optional parent?: KObject | null

Defined in: src/kobject.ts:25

get path(): string

Defined in: src/kobject.ts:34

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

string

[dispose](): void

Defined in: src/kobject.ts:72

void


add_uevent_attr(): void

Defined in: src/kobject.ts:115

void


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

Defined in: src/kobject.ts:132

string

((kobj) => string) | null

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

number = ...

Defaults based on which of show and store were passed.

Attribute


dispose(): void

Defined in: src/kobject.ts:64

void


keys(): Iterable<string>

Defined in: src/kobject.ts:60

The names of everything in this kobject.

Iterable<string>


lookup(name): KEntry | undefined

Defined in: src/kobject.ts:44

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

string

KEntry | undefined


notify_uevent(action, env?): void

Defined in: src/kobject.ts:82

Notify listeners that something happened to kobj.

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

UEventEnv = {}

void


send_uevent(text): void

Defined in: src/kobject.ts:100

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


optional show(attr): string

Defined in: src/kobject.ts:76

Attribute

string


optional store(attr, value): void

Defined in: src/kobject.ts:77

Attribute

string

void


optional uevent(env): void

Defined in: src/kobject.ts:127

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

UEventEnv

void

notify_uevent