jacdac.codal_message_bus

Submodules

Package Contents

Classes

CodalMessageBusClient

A service that uses the [CODAL message bus](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/) to send and receive small messages.

class jacdac.codal_message_bus.CodalMessageBusClient(bus: jacdac.bus.Bus, role: str)

Bases: jacdac.bus.Client

A service that uses the [CODAL message bus](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/) to send and receive small messages.

Implements a client for the CODAL Message Bus service.

on_message(handler: jacdac.bus.EventHandlerFn) jacdac.bus.UnsubscribeFn

Raised by the server is triggered by the server. The filtering logic of which event to send over Jacdac is up to the server implementation.

send(source: int, value: int) None

Send a message on the CODAL bus. If source is 0, it is treated as wildcard.