mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-19 14:14:00 +00:00
wifinina: add generated strings, improved debugging system and messages
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// Code generated by "stringer -type=ConnectionStatus -trimprefix=Status"; DO NOT EDIT.
|
||||
|
||||
package wifinina
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[StatusNoShield-255]
|
||||
_ = x[StatusIdle-0]
|
||||
_ = x[StatusNoSSIDAvail-1]
|
||||
_ = x[StatusScanCompleted-2]
|
||||
_ = x[StatusConnected-3]
|
||||
_ = x[StatusConnectFailed-4]
|
||||
_ = x[StatusConnectionLost-5]
|
||||
_ = x[StatusDisconnected-6]
|
||||
}
|
||||
|
||||
const (
|
||||
_ConnectionStatus_name_0 = "IdleNoSSIDAvailScanCompletedConnectedConnectFailedConnectionLostDisconnected"
|
||||
_ConnectionStatus_name_1 = "NoShield"
|
||||
)
|
||||
|
||||
var (
|
||||
_ConnectionStatus_index_0 = [...]uint8{0, 4, 15, 28, 37, 50, 64, 76}
|
||||
)
|
||||
|
||||
func (i ConnectionStatus) String() string {
|
||||
switch {
|
||||
case i <= 6:
|
||||
return _ConnectionStatus_name_0[_ConnectionStatus_index_0[i]:_ConnectionStatus_index_0[i+1]]
|
||||
case i == 255:
|
||||
return _ConnectionStatus_name_1
|
||||
default:
|
||||
return "ConnectionStatus(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user