github.com/haraldrudell/parl@v0.4.176/android-status.go (about) 1 /* 2 © 2023–present Harald Rudell <harald.rudell@gmail.com> https://haraldrudell.github.io/haraldrudell/) 3 ISC License 4 */ 5 6 package parl 7 8 // NewAndroidStatus returns Anddroid status of s 9 // - AndroidStatus is a single word of ANSII-set characters 10 func NewAndroidStatus(s string) (status AndroidStatus) { return AndroidStatus(s) } 11 12 // IsValid returns whether a conatins a valid Android device status 13 func (a AndroidStatus) IsValid() (isValid bool) { return len(string(a)) > 0 } 14 15 // IsOnline returns whether the Android status is device online, ie. ready for interactions 16 func (a AndroidStatus) IsOnline() (isOnline bool) { return a == AndroidOnline } 17 18 func (a AndroidStatus) String() (s string) { return string(a) }