Skip to content

PQA019 — Abstract function cannot be used directly

A device type declares an abstract function in its functions: block.

Some functions in functions.yaml are declared abstract. They carry shape shared by a family — the states and events every connection-like function has — and concrete functions specialise them. ConnectionBase is the common example.

An abstract function has no complete state set of its own, so a Thing cannot carry it.

functions:
  ConnectionBase:          # abstract — specialise it instead

Why the build refuses this

The generated Thing would expose a function with nothing behind it. The state enum, the transition methods and the status surface all come from the concrete definition.

How to fix it

Declare the concrete function the device actually has. Look up the family in functions.yaml: the abstract entry names its specialisations, and the device's protocol says which one applies.

What is not reported

A function implicitly added by the framework. Connection, access synchronization, time synchronization and status poll are wired from detected code and capability flags, not from this block.

If you disagree with a report

Do not suppress it. A wrong report is a bug in the check — report it with the YAML that triggered it.