pub enum Response<'a> {
Show 19 variants
Error(&'a str),
NetStarted,
NetStopped,
NetLocalAddr([u8; 6]),
NetAdvertised,
NetIncoming([u8; 6], &'a [u8]),
NetNoIncoming,
NetSent,
NetSendStatus(SendStatus),
Input(Option<(u16, u16)>, u8),
WifiScan([&'a str; 6]),
WifiStatus(u8),
WifiConnected,
WifiDisconnected,
TcpConnected,
TcpStatus(u8),
TcpSent,
TcpChunk(&'a [u8]),
TcpClosed,
}Expand description
Response that the IO chip sends back to the main chip.
Variants§
Error(&'a str)
NetStarted
Confirmation for Request::NetStart.
NetStopped
Confirmation for Request::NetStop.
NetLocalAddr([u8; 6])
Response for Request::NetLocalAddr.
NetAdvertised
Confirmation for Request::NetAdvertise.
NetIncoming([u8; 6], &'a [u8])
NetNoIncoming
NetSent
Confirmation for Request::NetSend.
NetSendStatus(SendStatus)
Response for Request::NetSendStatus.
Input(Option<(u16, u16)>, u8)
Response for Request::ReadInput.
The first item is the touch coordinates on the pad (if any). The second is serialized bitflags of pressed buttons.
WifiScan([&'a str; 6])
List of SSIDs of up to 6 available wifi Access Points.
Includes 6 of the first detected APs. So, it’s not the top closest APs but the closer AP the higher its chance to make it to the list.
SSID is up to 30 bytes. 6 SSIDs take up to 180 bits. The SPI packet size is limited to 255 bits because we use a single byte to transfer the packet size.
WifiStatus(u8)
The status of current connection to a wifi AP.
For firefly-types and firefly-runtime, it’s opaque. It doesn’t know which integer corresponds to which state. The status is encoded in firefly-io and decoded in firefly-installer. firefly-hal is also aware of status encoding, though, for the purpose of mocking wifi on the hosted environment (emulator).
WifiConnected
Confirmation for Request::WifiConnect.
The connection request is async, so the response doesn’t mean
that the device is actually connected to the AP (yet).
Use Request::WifiStatus to get the actual connection status.
WifiDisconnected
Confirmation for Request::WifiDisconnect.
TcpConnected
Confirmation for Request::TcpConnect.
TcpStatus(u8)
Response for Request::TcpStatus.
TcpSent
Confirmation for Request::TcpSend.
TcpChunk(&'a [u8])
Response for Request::TcpRecv.
TcpClosed
Confirmation for Request::TcpClose.