OpenthReadDotnet 은 스레드 네트워크와 함께 작동하도록 설계된 .NET 라이브러리입니다. 6LOWPAN 응용 프로그램을 개발하려면 OpenThread Network 공동 프로세서 (NCP)로 실행되는 라디오 모듈이 필요합니다. 자세한 내용은 웹 페이지 https://openthread.io/platforms/co-processor에서 확인할 수 있습니다
현재 라이브러리는 Net Core 플랫폼 및 .NET CLR, Nanoframework (https://nanoframework.net/) 및 Tinyclr (https://www.ghielectronics.com/tinyclr/features/) 플랫폼에서 Net Core 플랫폼에서 작동합니다.
최종 장치는 지원되는 플랫폼의 모든 모듈에서 NCP 펌웨어를 사용하여 지원되는 플랫폼 https://openthread.io/platforms에서 사용할 수 있습니다. 도서관은 Ti CC2652 기반 보드 http://www.ti.com/tool/launchxl-cc26x2r1 및 nrf52840 기반 모듈에서 테스트되었습니다. http://www.skylabmodule.com/skylab-125k-ram-industry-grade-low-ergy-multiprotocol-5-0-ant-bluetooth-module/
OpenthReadDotnet 프로젝트는 스레드 네트워크를 관리하기 위해 .NET Spinel 프로토콜 및 고 레벨 API 구현입니다.
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 ) ;
}
}