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 ) ;
}
}