Add transport status events (#790)
* Transport status events Add symbol docs Emit transport status events Transport test suite * Review fixes * Remove core dependency * HTTP transport use AbortSignal, error handling in TransportNode * Improve stream handling * Update packages/transport-web-serial/src/transport.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix linting --------- Co-authored-by: philon- <philon-@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
philon-
parent
449fb3ac36
commit
d7e32e9b03
@@ -7,6 +7,19 @@ export const decodePacket = (device: MeshDevice) =>
|
||||
new WritableStream<DeviceOutput>({
|
||||
write(chunk) {
|
||||
switch (chunk.type) {
|
||||
case "status": {
|
||||
const { status, reason } = chunk.data as {
|
||||
status: Types.DeviceStatusEnum;
|
||||
reason?: string;
|
||||
};
|
||||
|
||||
device.updateDeviceStatus(status);
|
||||
device.log.info(
|
||||
Types.Emitter[Types.Emitter.ConnectionStatus],
|
||||
`🔗 ${Types.DeviceStatusEnum[status]} ${reason ? `(${reason})` : ""}`,
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "debug": {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user