jacdac.wssk

Submodules

Package Contents

Classes

WsskClient

Defines a binary protocol for IoT devices to talk to DeviceScript gateway over encrypted websockets.

class jacdac.wssk.WsskClient(bus: jacdac.bus.Bus, role: str)

Bases: jacdac.bus.Client

Defines a binary protocol for IoT devices to talk to DeviceScript gateway over encrypted websockets.
  • This is not used as a regular Jacdac service.

Implements a client for the WSSK service.

set_streaming(status: jacdac.wssk.constants.WsskStreamingType) None

Enable/disable forwarding of all Jacdac frames, exception reporting, and dmesg streaming.

ping_device(payload: bytes) None

Send from gateway when it wants to see if the device is alive. The device currently only support 0-length payload.

ping_cloud(payload: bytes) None

Send from device to gateway to test connection.

get_hash() None

Get SHA256 of the currently deployed program.

deploy_start(size: int) None

Start deployment of a new program.

deploy_write(payload: bytes) None

Payload length must be multiple of 32 bytes.

deploy_finish() None

Finish deployment.

c2d(datatype: jacdac.wssk.constants.WsskDataType, topic: str, payload: bytes) None

Upload a labelled tuple of values to the cloud. The tuple will be automatically tagged with timestamp and originating device.

jacdac_packet(frame: bytes) None

Sent both ways.