LLDev.TI.CC2531 9.0.0

dotnet add package LLDev.TI.CC2531 --version 9.0.0                
NuGet\Install-Package LLDev.TI.CC2531 -Version 9.0.0                
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="9.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LLDev.TI.CC2531 --version 9.0.0                
#r "nuget: LLDev.TI.CC2531, 9.0.0"                
#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=9.0.0

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

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 net9.0 is compatible. 
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
9.0.0 118 11/28/2024
8.0.2 148 9/24/2024
8.0.2-rc 87 9/23/2024
8.0.1-rc 83 9/22/2024