OpenthReadDotnet是一個.NET庫,旨在與線程網絡一起使用。要開發6LOWPAN應用程序,您將需要一個無線電模塊作為Openthread Network處理器(NCP)運行。有關更多信息,請訪問網頁https://openthread.io/platforms/co-processor
當前圖書館在Net Core Platform和.NET CLR,Nanoframework(https://nanaframework.net/)和TinyClr(https://wwwww.ghielectronics.com/tinyclr/featrr/features/)平台上工作。
最終設備可以從受支持平台的任何模塊上使用https://openthread.io/platforms帶有NCP固件。在TI CC2652測試的庫http://www.ti.com/tool/launchxl-cc26x2r1和NRF52840基於的模塊http://www.skylabmodule.com/skylab-125k-ram-industry-lad-low-energy-energy-multiprotocol-5-0-ant-ant-ant-bluetooth-module/
OpenthReadDotnet項目是用於管理線程網絡的尖晶石協議和高級API的.NET實現。
LowPancMD項目是管理線程網絡的控制台應用程序。類似於Pyspinel應用。
SampleSnetCore , samplesNanoframework和SamplestinyClr是如何使用OpenthReadDotnet庫的基本示例。
使用OpenthReadDotnet庫可以掃描附近的無線網絡,加入無線網絡並形成新的無線網絡網絡。
形成一個新的線程無線網絡和UDP服務器,我們只需要6行代碼。
StreamUART uartStream = new StreamUART ( "COMxx" ) ;
ncpInterface = new NcpInterface ( ) ;
ncpInterface . Open ( uartStream ) ;
ncpInterface . Form ( "Networkname" , 11 , "00112233445566778899AABBCCDDEEFF" , 1234 ) ;
UdpSocket receiver = new UdpSocket ( ) ;
receiver . Bind ( IPv6Address . IPv6Any , 1000 ) ;
IPv6EndPoint remoteIp = null ;
while ( true )
{
if ( receiver . Poll ( - 1 , SelectMode . SelectRead ) )
{
byte [ ] data = receiver . Receive ( ref remoteIp ) ;
string message = Encoding . ASCII . GetString ( data ) ;
Console . WriteLine ( " n " ) ;
Console . WriteLine ( "{0} bytes from {1} {2} {3}" , message . Length , remoteIp . Address , remoteIp . Port , message ) ;
}
}