Documentation
¶
Index ¶
Constants ¶
View Source
const (
InvalidTimestamp uint64 = math.MaxUint64
)
View Source
const RadioMessagePsduOffset = 1
RadioMessagePsduOffset is the offset of mPsdu data in a received OpenThread RadioMessage, from OT-RFSIM platform, radio.h.
struct RadioMessage
{
uint8_t mChannel;
uint8_t mPsdu[OT_RADIO_FRAME_MAX_SIZE];
} OT_TOOL_PACKED_END;
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Delay uint64
Type EventType
MsgId uint64
//DataLen uint16
Data []byte
// metadata kept locally for this Event.
NodeId types.NodeId
Timestamp uint64
MustDispatch bool
Conn net.Conn
// supplementary payload data stored in Event.Data, depends on the event type.
RadioCommData RadioCommEventData
RadioStateData RadioStateEventData
NodeInfoData NodeInfoEventData
RfSimParamData RfSimParamEventData
MsgToHostData MsgToHostEventData
}
func (*Event) Deserialize ¶
Deserialize deserializes []byte Event fields (as received from OpenThread node) into the Event object e. It returns the number of bytes used from `data` for the Deserialize operation, or 0 if the data buffer is incomplete i.e. does not contain one entire serialized Event.
type EventType ¶
type EventType = uint8
const ( // Event type IDs (external, shared between OT-NS and OT node) EventTypeAlarmFired EventType = 0 EventTypeRadioReceived EventType = 1 EventTypeUartWrite EventType = 2 EventTypeRadioSpinelWrite EventType = 3 EventTypePostCmd EventType = 4 EventTypeStatusPush EventType = 5 EventTypeRadioCommStart EventType = 6 EventTypeRadioTxDone EventType = 7 EventTypeRadioChannelSample EventType = 8 EventTypeRadioState EventType = 9 EventTypeRadioRxDone EventType = 10 EventTypeExtAddr EventType = 11 EventTypeNodeInfo EventType = 12 EventTypeNodeDisconnected EventType = 14 EventTypeRadioLog EventType = 15 EventTypeRadioRfSimParamGet EventType = 16 EventTypeRadioRfSimParamSet EventType = 17 EventTypeRadioRfSimParamRsp EventType = 18 EventTypeLogWrite EventType = 19 EventTypeUdpToHost EventType = 20 EventTypeIp6ToHost EventType = 21 EventTypeUdpFromHost EventType = 22 EventTypeIp6FromHost EventType = 23 )
type MsgToHostEventData ¶
type NodeInfoEventData ¶
type RadioCommEventData ¶
type RadioStateEventData ¶
type RadioStateEventData struct {
Channel uint8
PowerDbm int8
RxSensDbm int8
EnergyState types.RadioStates
SubState types.RadioSubStates
State types.RadioStates
RadioTime uint64
}
type RfSimParamEventData ¶
type RfSimParamEventData struct {
Param types.RfSimParam
Value int32
}
Click to show internal directories.
Click to hide internal directories.