Documentation ¶
Index ¶
- func DeleteResource(s Sesn, resType ResourceType, uri string, o TxOptions) (coap.COAPCode, []byte, error)
- func GetResource(s Sesn, resType ResourceType, uri string, o TxOptions) (coap.COAPCode, []byte, error)
- func PostResource(s Sesn, resType ResourceType, uri string, value []byte, o TxOptions) (coap.COAPCode, []byte, error)
- func PutCborResource(s Sesn, resType ResourceType, uri string, value map[string]interface{}, ...) (coap.COAPCode, map[string]interface{}, error)
- func PutResource(s Sesn, resType ResourceType, uri string, value []byte, o TxOptions) (coap.COAPCode, []byte, error)
- func TxNmp(s Sesn, m *nmp.NmpMsg, o TxOptions) (nmp.NmpRsp, error)
- type MgmtProto
- type OnCloseFn
- type PeerSpec
- type ResourceType
- type Sesn
- type SesnCfg
- type SesnCfgBle
- type SesnCfgBleCentral
- type TxOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteResource ¶
func GetResource ¶
func PostResource ¶
func PutCborResource ¶
func PutResource ¶
Types ¶
type ResourceType ¶
type ResourceType int
const ( RES_TYPE_PUBLIC ResourceType = iota RES_TYPE_UNAUTH RES_TYPE_SECURE )
func ParseResType ¶
func ParseResType(s string) (ResourceType, error)
func (ResourceType) String ¶
func (r ResourceType) String() string
type Sesn ¶
type Sesn interface { // Initiates communication with the peer. For connection-oriented // transports, this creates a connection. // Returns: // * nil: success. // * nmxutil.SesnAlreadyOpenError: session already open. // * other error Open() error // Ends communication with the peer. For connection-oriented transports, // this closes the connection. // * nil: success. // * nmxutil.SesnClosedError: session not open. // * other error Close() error // Indicates whether the session is currently open. IsOpen() bool // Retrieves the maximum data payload for incoming data packets. MtuIn() int // Retrieves the maximum data payload for outgoing data packets. MtuOut() int MgmtProto() MgmtProto // Indicates whether the session uses the TCP form of CoAP. CoapIsTcp() bool // Stops a receive operation in progress. This must be called from a // separate thread, as sesn receive operations are blocking. AbortRx(nmpSeq uint8) error // Performs a blocking transmit a single NMP message and listens for the // response. // * nil: success. // * nmxutil.SesnClosedError: session not open. // * other error TxNmpOnce(m *nmp.NmpMsg, opt TxOptions) (nmp.NmpRsp, error) TxCoapOnce(m coap.Message, resType ResourceType, opt TxOptions) (coap.COAPCode, []byte, error) }
Represents a communication session with a specific peer. The particulars vary according to protocol and transport. Several Sesn instances can use the same Xport.
type SesnCfg ¶
type SesnCfg struct { // General configuration. MgmtProto MgmtProto PeerSpec PeerSpec OnCloseCb OnCloseFn // Transport-specific configuration. Ble SesnCfgBle }
func NewSesnCfg ¶
func NewSesnCfg() SesnCfg
type SesnCfgBle ¶
type SesnCfgBle struct { // General configuration. OwnAddrType bledefs.BleAddrType EncryptWhen bledefs.BleEncryptWhen CloseTimeout time.Duration WriteRsp bool // Central configuration. Central SesnCfgBleCentral }
type SesnCfgBleCentral ¶
Click to show internal directories.
Click to hide internal directories.