LLDev.TI.CC2531 8.0.2

dotnet add package LLDev.TI.CC2531 --version 8.0.2                
NuGet\Install-Package LLDev.TI.CC2531 -Version 8.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LLDev.TI.CC2531" Version="8.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LLDev.TI.CC2531 --version 8.0.2                
#r "nuget: LLDev.TI.CC2531, 8.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LLDev.TI.CC2531 as a Cake Addin
#addin nuget:?package=LLDev.TI.CC2531&version=8.0.2

// Install LLDev.TI.CC2531 as a Cake Tool
#tool nuget:?package=LLDev.TI.CC2531&version=8.0.2                

LLDev.TI.CC2531

This package allow to communicate with ZigBee devices using Texas Instruments CC2531 as a ZigBee network controller in .NET projects.

CC2531 Setup

CC2531 should have ZStack firmware. Internet have many instructions how to flash firmware to the device. Here are some of them:

ZStack firmware could be found here.

Using the package

To use the package, first of all it should be added to .NET dependency injection system. To to it, you need to define port that package should use. It can be done by adding port to appsettings.json file:

"MyJsonSection": {
  "PortName": "COM0" // in windows,
  //"PortName": "/dev/ttyACM0" // in linux
},

If you are catching "Cannot receive response within specified duration X ms" exception, you could also increase wait duration from appsettings:

"MyJsonSection": {
  "PortName": "..."
  "WaitResponseTimeoutMs": 9999
},

Default wait duration is 2 seconds.

Then you need to call AddZigBeeServices method:

using LLDev.TI.CC2531.Extensions;

...
IConfiguration configuration;
IServiceCollection services;
services.AddZigBeeServices(configuration.GetSection("MyJsonSection"));

It will add LLDev.TI.CC2531.Handlers.INetworkHandler object to dependency injection system as a singleton.

When it is done, you need to start the network and allow devices to join it. It could be done so:

using LLDev.TI.CC2531.Handlers;

LLDev.TI.CC2531.Handlers.INetworkHandler networkHandler;

networkHandler.StartZigBeeNetwork();
networkHandler.PermitNetworkJoin(true);

LLDev.TI.CC2531.Handlers.INetworkHandler have 2 events:

event DeviceAnnouncedHandler? DeviceAnnouncedAsync;
event EndDeviceMessageReceivedHandler? DeviceMessageReceivedAsync;

DeviceAnnouncedAsync event will be called when device is connecting to the network.

DeviceMessageReceivedAsync event will be called when device message received.

NB! Currently this package is allowing to receive device messages, and do not allow to send messages to ZigBee device.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.2 131 9/24/2024
8.0.2-rc 81 9/23/2024
8.0.1-rc 81 9/22/2024