Thread THCI Network Event Field Definitions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Thread THCI Network Event Field Definitions

Jump to solution
1,437 Views
ryanbryngelson
Contributor I
What are the values in the EnergyDetectList array (what do they mean, what units, etc.) in an THR_EventNwkScan.Confirm?  For example...
RX: THR_EventNwkScan.Confirm 02 CF 50 2B 00 00 01 00 26 00 00 F8 FF 07 03 03 0A 00 10 43 77 6D 4D 2D 3D 7A 77 40 19 20 36 43 23 23 3A 02 01 00 BE FC 11 87 01 00 98 73 1A 3B AA
Sync [1 byte] = 02
OpGroup [1 byte] = CF
OpCode [1 byte] = 50
Length [2 bytes] = 00 2B
InstanceId [1 byte] = 00
EventStatus [2 bytes] = 00 01 (ScanResult)
DataSize [2 bytes] = 00 26
ScanChannelMask [4 bytes] = 07 FF F8 00
ScanType [1 byte] = 03 (EnergyDetectAndActiveScan)
ScanDuration [1 byte] = 03
maxThrNwkToDiscover [2 bytes] = 00 0A
EnergyDetectEntries [1 byte] = 10
EnergyDetectList [16 bytes] = [43, 77, 6D, 4D, 2D, 3D, 7A, 77, 40, 19, 20, 36, 43, 23, 23, 3A]
NwkDiscoveryEntries [1 byte] = 02
NumOfRcvdBeacons [2 bytes] = 00 01
PanId [2 bytes] = FC BE
Channel [1 byte] = 11
Reserved [1 byte] = 87
NumOfRcvdBeacons [2 bytes] = 00 01
PanId [2 bytes] = 73 98
Channel [1 byte] = 1A
Reserved [1 byte] = 3B
CRC [1 byte] = AA
What are the 201 bytes returned in a THR_EventNwkCreate.Confirm's Data field.  What does an EventStatus of SelectBestChannel indicate?  How do you force a network to be created on a specific channel?  For example...
RX: THR_EventNwkCreate.Confirm 02 CF 51 CE 00 00 03 00 C9 00 00 00 02 00 03 02 1E 00 01 00 00 00 CC 35 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 74 2B
Sync [1 byte] = 02
OpGroup [1 byte] = CF
OpCode [1 byte] = 51
Length [2 bytes] = 00 CE
InstanceId [1 byte] = 00
EventStatus [2 bytes] = 00 03 (SelectBestChannel)
DataSize [2 bytes] = 00 C9
Data [201 bytes] = [00, 00, 02, 00, 03, 02, 1E, 00, 01, 00, 00, 00, CC, 35, 00, 20, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 74]
CRC [1 byte] = 2B
The events that come through THCI_EvMonitor (in thci.c), are they defined anywhere?  THR_EventGeneral.Confirm and THR_EventNwkCommissioning.Indication are defined in the THCI reference manual, but seemingly not anywhere else.
Thanks,
Ryan
Labels (1)
0 Kudos
1 Solution
1,212 Views
jc_pacheco
NXP Employee
NXP Employee

Hello Ryan, 

- What are the values in the EnergyDetectList array (what do they mean, what units, etc.) in an THR_EventNwkScan.Confirm?

EnergyDetectList [16 bytes]  Displays the resulting list of the energy detected (hex) in the channels provided in "ScanChannelMask" when queried "THR_NwkScanRequest". These results are in dBm * (-1).  

ie. [43, 77, 6D,..] -->  [-67 dBm, -119 dBm, -109 dBm, ...]

- What are the 201 bytes returned in a THR_EventNwkCreate.Confirm's Data field.  

This data is the evntMonitorData_t --> aData[] (thrEventData_t) information resulted from the ChannelScan.

Which includes NwkScanResults, MacReceivedDifferentKeyIndex, BeaconInformation.

The size will depend on the number of channels to be scanned.

ie. If there's only 1 channel to scan: 201, if there are 16 channels to scan: 216

Last 1 (min) or 16(max) bytes contain the Energy Detect results per channel.

- What does an EventStatus of SelectBestChannel indicate?  

That the Network will be created based on the performed Channel Scan results from scanning the channel mask

(THR_SCANCHANNEL_MASK) to detect the less congested channel.

- How do you force a network to be created on a specific channel?

Prior creating the network, manually set an specific channel and panid. When this is performed, you will notice that the THR_EventNwkCreate.Confirm with Status of "SelectBestChannel" will be omitted.

ie.

shell:

   "thr set channel 17"

   "thr set panid 0x1234"

thcd:

   "THR_SetAttrRequest(AttributeID='Channel', Value = '17') "

   "THR_SetAttrRequest(AttributeID='ShortPanId', Value = '0x1234') "

Hope this helps,

JC

View solution in original post

0 Kudos
4 Replies
1,213 Views
jc_pacheco
NXP Employee
NXP Employee

Hello Ryan, 

- What are the values in the EnergyDetectList array (what do they mean, what units, etc.) in an THR_EventNwkScan.Confirm?

EnergyDetectList [16 bytes]  Displays the resulting list of the energy detected (hex) in the channels provided in "ScanChannelMask" when queried "THR_NwkScanRequest". These results are in dBm * (-1).  

ie. [43, 77, 6D,..] -->  [-67 dBm, -119 dBm, -109 dBm, ...]

- What are the 201 bytes returned in a THR_EventNwkCreate.Confirm's Data field.  

This data is the evntMonitorData_t --> aData[] (thrEventData_t) information resulted from the ChannelScan.

Which includes NwkScanResults, MacReceivedDifferentKeyIndex, BeaconInformation.

The size will depend on the number of channels to be scanned.

ie. If there's only 1 channel to scan: 201, if there are 16 channels to scan: 216

Last 1 (min) or 16(max) bytes contain the Energy Detect results per channel.

- What does an EventStatus of SelectBestChannel indicate?  

That the Network will be created based on the performed Channel Scan results from scanning the channel mask

(THR_SCANCHANNEL_MASK) to detect the less congested channel.

- How do you force a network to be created on a specific channel?

Prior creating the network, manually set an specific channel and panid. When this is performed, you will notice that the THR_EventNwkCreate.Confirm with Status of "SelectBestChannel" will be omitted.

ie.

shell:

   "thr set channel 17"

   "thr set panid 0x1234"

thcd:

   "THR_SetAttrRequest(AttributeID='Channel', Value = '17') "

   "THR_SetAttrRequest(AttributeID='ShortPanId', Value = '0x1234') "

Hope this helps,

JC

0 Kudos
1,212 Views
flaminatakam
Contributor II

please,

how to choose the right scan channel? i have tried to use the default one set in test tool but i have not obtained result

Thanks

0 Kudos
1,212 Views
ryanbryngelson
Contributor I

Also, what are the possible values for EventStatus?

0 Kudos
1,212 Views
jc_pacheco
NXP Employee
NXP Employee

Those are Network Create Events. See: thrEvCodesCreate_t

0 Kudos