Documentation ¶
Index ¶
- Constants
- type ChannelId
- type Message
- func (m *Message) AppendData(data []byte) bool
- func (m *Message) Bytes() []byte
- func (m *Message) ChannelId() ChannelId
- func (m *Message) DataToString() string
- func (m *Message) IsSystemMessage() bool
- func (m *Message) NodeId() NodeId
- func (m *Message) SetChannelId(cid ChannelId) *Message
- func (m *Message) SetNodeId(nodeid NodeId) *Message
- func (m *Message) SetSystemFunctionParam(fn MessageType, pr uint8) *Message
- func (m *Message) String() string
- func (m *Message) SystemFunctionParam() (MessageType, uint8)
- func (m *Message) SystemParam() uint8
- type MessageType
- type NodeId
Constants ¶
View Source
const ( MAX_NODE_N = 128 NOCANID_MASK_FIRST = (1 << 28) NOCANID_MASK_LAST = (1 << 20) NOCANID_MASK_SYSTEM = (1 << 18) NOCANID_MASK_MESSAGE = ^(uint32((1 << 28) | (1 << 20))) )
View Source
const ( DEFAULT_TIMEOUT = 3 * time.Second EXTENDED_TIMEOUT = 12 * time.Second )
View Source
const ( UNDEFINED_NODE NodeId = NodeId(-1) UNDEFINED_CHANNEL ChannelId = ChannelId(0xFFFF) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
func NewMessage ¶
func NewPublishMessage ¶
func NewSystemMessage ¶
func NewSystemMessage(node NodeId, fn MessageType, param uint8, data []byte) *Message
func (*Message) AppendData ¶
func (*Message) DataToString ¶
func (*Message) IsSystemMessage ¶
func (*Message) SetChannelId ¶
func (*Message) SetSystemFunctionParam ¶
func (m *Message) SetSystemFunctionParam(fn MessageType, pr uint8) *Message
func (*Message) SystemFunctionParam ¶
func (m *Message) SystemFunctionParam() (MessageType, uint8)
func (*Message) SystemParam ¶
type MessageType ¶
type MessageType byte
const ( PUBLISH MessageType = iota SYS_ADDRESS_REQUEST //= 1 SYS_ADDRESS_CONFIGURE //= 2 SYS_ADDRESS_CONFIGURE_ACK //= 3 SYS_ADDRESS_LOOKUP //= 4 SYS_ADDRESS_LOOKUP_ACK //= 5 SYS_NODE_BOOT_REQUEST //= 6 SYS_NODE_BOOT_ACK //= 7 SYS_NODE_PING //= 8 SYS_NODE_PING_ACK //= 9 SYS_CHANNEL_REGISTER //= 10 SYS_CHANNEL_REGISTER_ACK //= 11 SYS_CHANNEL_UNREGISTER //= 12 SYS_CHANNEL_UNREGISTER_ACK //= 13 SYS_CHANNEL_SUBSCRIBE //= 14 SYS_CHANNEL_UNSUBSCRIBE //= 15 SYS_CHANNEL_LOOKUP //= 16 SYS_CHANNEL_LOOKUP_ACK //= 17 SYS_BOOTLOADER_GET_SIGNATURE //= 18 SYS_BOOTLOADER_GET_SIGNATURE_ACK //= 19 SYS_BOOTLOADER_SET_ADDRESS //= 20 SYS_BOOTLOADER_SET_ADDRESS_ACK //= 21 SYS_BOOTLOADER_WRITE //= 22 SYS_BOOTLOADER_WRITE_ACK //= 23 SYS_BOOTLOADER_READ //= 24 SYS_BOOTLOADER_READ_ACK //= 25 SYS_BOOTLOADER_LEAVE //= 26 SYS_BOOTLOADER_LEAVE_ACK //= 27 SYS_BOOTLOADER_ERASE //= 28 SYS_BOOTLOADER_ERASE_ACK //= 29 SYS_RESERVED //= 30 SYS_DEBUG_MESSAGE //= 31 MESSAGE_TYPE_COUNT )
func (MessageType) String ¶
func (mt MessageType) String() string
Click to show internal directories.
Click to hide internal directories.