Hi, I have the flutterdemo app running on Ubuntu Core 22, I have built the Gadget snap and added serial a serial port slot. This image is installed and working. I have modified the snapcraft.yaml for the Flutter project to enable the plug. I have connected the plug to the slot. This all seems to be working:
~$ snap connections
Interface Plug Slot Notes
content[graphics-core22] iot-example-graphical-snap:graphics-core22 mesa-core22:graphics-core22 -
content[graphics-core22] ubuntu-frame:graphics-core22 mesa-core22:graphics-core22 -
hardware-observe ubuntu-frame:hardware-observe :hardware-observe -
network-bind ubuntu-frame:network-bind :network-bind -
opengl iot-example-graphical-snap:opengl :opengl -
opengl ubuntu-frame:opengl :opengl -
serial-port iot-example-graphical-snap:serial0 pc:serial0 manual
wayland iot-example-graphical-snap:wayland ubuntu-frame:wayland -
snap interface serial-port
name: serial-port
summary: allows accessing a specific serial port
plugs:
- iot-example-graphical-snap:serial0
slots:
- pc:serial0
How do I now read and write to the serial port from my Flutter app. Does anyone have any Dart/Flutter examples of using the serial-port plug ?
Thanks