Documentation ¶
Index ¶
- Constants
- Variables
- func Assert(cond bool)
- func DecodeCbor(cbor []byte) (interface{}, error)
- func DecodeCborMap(cbor []byte) (map[string]interface{}, error)
- func EncodeCbor(value interface{}) ([]byte, error)
- func EncodeCborMap(value map[string]interface{}) ([]byte, error)
- func Fragment(b []byte, mtu int) [][]byte
- func GetNextId() uint32
- func IsAlready(err error) bool
- func IsBleHost(err error) bool
- func IsBleSecurity(err error) bool
- func IsBleSesnDisconnect(err error) bool
- func IsRspTimeout(err error) bool
- func IsScanTmo(err error) bool
- func IsSesnAlreadyOpen(err error) bool
- func IsSesnClosed(err error) bool
- func IsXport(err error) bool
- func LogAddCoapListener(parentLevel int, desc string)
- func LogAddListener(parentLevel int, key interface{}, id uint32, name string)
- func LogAddNmpListener(parentLevel int, seq uint8)
- func LogListener(parentLevel int, title string, extra string)
- func LogRemoveCoapListener(parentLevel int, desc string)
- func LogRemoveListener(parentLevel int, key interface{}, id uint32, name string)
- func LogRemoveNmpListener(parentLevel int, seq uint8)
- func NextNmpSeq() uint8
- func NextToken() []byte
- func SeqToToken(seq uint8) []byte
- func SetLogLevel(level log.Level)
- func StopAndDrainTimer(timer *time.Timer)
- type AlreadyError
- type Bcaster
- type BleHostError
- type BleSecurityError
- type BleSesnDisconnectError
- type Blocker
- type ErrFunnel
- type ErrLessFn
- type ErrProcFn
- type RspTimeoutError
- type SRWaiter
- type ScanTmoError
- type SesnAlreadyOpenError
- type SesnClosedError
- type SingleResource
- type XportError
Constants ¶
const DURATION_FOREVER time.Duration = math.MaxInt64
Variables ¶
var Debug bool
var ListenLog = &log.Logger{ Out: os.Stderr, Formatter: &logFormatter, Level: log.DebugLevel, }
var OmpRes string = "/omgr"
Functions ¶
func DecodeCbor ¶
func DecodeCborMap ¶
func EncodeCbor ¶
func EncodeCborMap ¶
func IsBleSecurity ¶
func IsBleSesnDisconnect ¶
func IsRspTimeout ¶
func IsSesnAlreadyOpen ¶
func IsSesnClosed ¶
func LogAddCoapListener ¶
func LogAddListener ¶
func LogAddNmpListener ¶
func LogListener ¶
func LogRemoveCoapListener ¶
func LogRemoveListener ¶
func LogRemoveNmpListener ¶
func NextNmpSeq ¶
func NextNmpSeq() uint8
func SeqToToken ¶
func SetLogLevel ¶
func StopAndDrainTimer ¶
Types ¶
type AlreadyError ¶
type AlreadyError struct {
Text string
}
Indicates an attempt to transition to the already-current state.
func NewAlreadyError ¶
func NewAlreadyError(text string) *AlreadyError
func (*AlreadyError) Error ¶
func (err *AlreadyError) Error() string
type Bcaster ¶
type Bcaster struct {
// contains filtered or unexported fields
}
func (*Bcaster) SendAndClear ¶
func (b *Bcaster) SendAndClear(val interface{})
func (*Bcaster) StopListening ¶
func (b *Bcaster) StopListening(ch chan interface{})
type BleHostError ¶
func FmtBleHostError ¶
func FmtBleHostError(status int, format string, args ...interface{}) *BleHostError
func NewBleHostError ¶
func NewBleHostError(status int, text string) *BleHostError
func ToBleHost ¶
func ToBleHost(err error) *BleHostError
func (*BleHostError) Error ¶
func (e *BleHostError) Error() string
type BleSecurityError ¶
type BleSecurityError struct {
Text string
}
Represents a BLE pairing failure due to missing or mismatched key material.
func NewBleSecurityError ¶
func NewBleSecurityError(text string) *BleSecurityError
func ToBleSecurity ¶
func ToBleSecurity(err error) *BleSecurityError
func (*BleSecurityError) Error ¶
func (err *BleSecurityError) Error() string
type BleSesnDisconnectError ¶
func NewBleSesnDisconnectError ¶
func NewBleSesnDisconnectError(reason int, text string) *BleSesnDisconnectError
func (*BleSesnDisconnectError) Error ¶
func (e *BleSesnDisconnectError) Error() string
type Blocker ¶
type Blocker struct {
// contains filtered or unexported fields
}
Blocks a variable number of waiters until Unblock() is called. Subsequent waiters are unblocked until the next call to Block().
func (*Blocker) UnblockAndRestart ¶
func (b *Blocker) UnblockAndRestart(val interface{})
type ErrFunnel ¶
type ErrFunnel struct { LessCb ErrLessFn AccumDelay time.Duration // contains filtered or unexported fields }
Aggregates errors that occur close in time. The most severe error gets reported.
type RspTimeoutError ¶
type RspTimeoutError struct {
Text string
}
Represents a application-layer timeout (e.g., NMP or CoAP); request sent, but no response received.
func FmtRspTimeoutError ¶
func FmtRspTimeoutError(format string, args ...interface{}) *RspTimeoutError
func NewRspTimeoutError ¶
func NewRspTimeoutError(text string) *RspTimeoutError
func (*RspTimeoutError) Error ¶
func (e *RspTimeoutError) Error() string
type ScanTmoError ¶
type ScanTmoError struct {
Text string
}
func NewScanTmoError ¶
func NewScanTmoError(text string) *ScanTmoError
func (*ScanTmoError) Error ¶
func (e *ScanTmoError) Error() string
type SesnAlreadyOpenError ¶
type SesnAlreadyOpenError struct {
Text string
}
func NewSesnAlreadyOpenError ¶
func NewSesnAlreadyOpenError(text string) *SesnAlreadyOpenError
func (*SesnAlreadyOpenError) Error ¶
func (e *SesnAlreadyOpenError) Error() string
type SesnClosedError ¶
type SesnClosedError struct {
Text string
}
func NewSesnClosedError ¶
func NewSesnClosedError(text string) *SesnClosedError
func (*SesnClosedError) Error ¶
func (e *SesnClosedError) Error() string
type SingleResource ¶
type SingleResource struct {
// contains filtered or unexported fields
}
func NewSingleResource ¶
func NewSingleResource() SingleResource
func (*SingleResource) Abort ¶
func (s *SingleResource) Abort(err error)
func (*SingleResource) Acquire ¶
func (s *SingleResource) Acquire(token interface{}) <-chan error
Appends an entry to the wait queue and returns a channel for the caller to block on. The caller must either read from the channel or call StopWaiting().
func (*SingleResource) Acquired ¶
func (s *SingleResource) Acquired() bool
func (*SingleResource) Release ¶
func (s *SingleResource) Release() bool
@return true if a pending waiter acquired the resource;
false if the resource is now free.
func (*SingleResource) StopWaiting ¶
func (s *SingleResource) StopWaiting(token interface{}, err error)
type XportError ¶
type XportError struct {
Text string
}
Represents a low-level transport error.
func NewXportError ¶
func NewXportError(text string) *XportError
func (*XportError) Error ¶
func (e *XportError) Error() string