Restructured the source code in the Playdate bindings target.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
internal import CPlaydate
|
||||
|
||||
extension Network {
|
||||
/// A network error code (`PDNetErr`).
|
||||
public enum NetError: Int32, Swift.Error, Sendable {
|
||||
case noDevice = -1
|
||||
case busy = -2
|
||||
case writeError = -3
|
||||
case writeBusy = -4
|
||||
case writeTimeout = -5
|
||||
case readError = -6
|
||||
case readBusy = -7
|
||||
case readTimeout = -8
|
||||
case readOverflow = -9
|
||||
case frameError = -10
|
||||
case badResponse = -11
|
||||
case errorResponse = -12
|
||||
case resetTimeout = -13
|
||||
case bufferTooSmall = -14
|
||||
case unexpectedResponse = -15
|
||||
case notConnectedToAP = -16
|
||||
case notImplemented = -17
|
||||
case connectionClosed = -18
|
||||
case unknown = 1
|
||||
|
||||
init(_ error: PDNetErr) {
|
||||
self = NetError(rawValue: Int32(error.rawValue)) ?? .unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
extension Network {
|
||||
/// The device's wifi status.
|
||||
public enum WifiStatus: UInt32, Sendable {
|
||||
case notConnected = 0
|
||||
case connected = 1
|
||||
/// A connection was attempted but no configured access point was
|
||||
/// available.
|
||||
case notAvailable = 2
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user