mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-16 04:43:25 +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,59 @@
|
||||
// Code generated by "stringer -type=Error -trimprefix=Err"; 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[ErrTimeoutChipReady-1]
|
||||
_ = x[ErrTimeoutChipSelect-2]
|
||||
_ = x[ErrCheckStartCmd-3]
|
||||
_ = x[ErrWaitRsp-4]
|
||||
_ = x[ErrUnexpectedLength-224]
|
||||
_ = x[ErrNoParamsReturned-225]
|
||||
_ = x[ErrIncorrectSentinel-226]
|
||||
_ = x[ErrCmdErrorReceived-239]
|
||||
_ = x[ErrNotImplemented-240]
|
||||
_ = x[ErrUnknownHost-241]
|
||||
_ = x[ErrSocketAlreadySet-242]
|
||||
_ = x[ErrConnectionTimeout-243]
|
||||
_ = x[ErrNoData-244]
|
||||
_ = x[ErrDataNotWritten-245]
|
||||
_ = x[ErrCheckDataError-246]
|
||||
_ = x[ErrBufferTooSmall-247]
|
||||
_ = x[ErrNoSocketAvail-255]
|
||||
}
|
||||
|
||||
const (
|
||||
_Error_name_0 = "TimeoutChipReadyTimeoutChipSelectCheckStartCmdWaitRsp"
|
||||
_Error_name_1 = "UnexpectedLengthNoParamsReturnedIncorrectSentinel"
|
||||
_Error_name_2 = "CmdErrorReceivedNotImplementedUnknownHostSocketAlreadySetConnectionTimeoutNoDataDataNotWrittenCheckDataErrorBufferTooSmall"
|
||||
_Error_name_3 = "NoSocketAvail"
|
||||
)
|
||||
|
||||
var (
|
||||
_Error_index_0 = [...]uint8{0, 16, 33, 46, 53}
|
||||
_Error_index_1 = [...]uint8{0, 16, 32, 49}
|
||||
_Error_index_2 = [...]uint8{0, 16, 30, 41, 57, 74, 80, 94, 108, 122}
|
||||
)
|
||||
|
||||
func (i Error) String() string {
|
||||
switch {
|
||||
case 1 <= i && i <= 4:
|
||||
i -= 1
|
||||
return _Error_name_0[_Error_index_0[i]:_Error_index_0[i+1]]
|
||||
case 224 <= i && i <= 226:
|
||||
i -= 224
|
||||
return _Error_name_1[_Error_index_1[i]:_Error_index_1[i+1]]
|
||||
case 239 <= i && i <= 247:
|
||||
i -= 239
|
||||
return _Error_name_2[_Error_index_2[i]:_Error_index_2[i+1]]
|
||||
case i == 255:
|
||||
return _Error_name_3
|
||||
default:
|
||||
return "Error(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user