Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotmorten/zigbeenet
Portable Class Library for Zigbee. Supports .NET, Windows Store and Windows Phone.
https://github.com/dotmorten/zigbeenet
Last synced: 5 days ago
JSON representation
Portable Class Library for Zigbee. Supports .NET, Windows Store and Windows Phone.
- Host: GitHub
- URL: https://github.com/dotmorten/zigbeenet
- Owner: dotMorten
- License: other
- Created: 2013-08-23T04:13:41.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-06T02:31:57.000Z (over 10 years ago)
- Last Synced: 2024-05-01T21:42:12.042Z (6 months ago)
- Language: C#
- Size: 164 KB
- Stars: 4
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.txt
Awesome Lists containing this project
README
ZigbeeNet
=========Portable Class Library for Zigbee. Supports .NET, Windows Store and Windows Phone.
This project is in its very early stages. Only supports Smartenit CID API, and very limited set of commands.
.NET Example code:
private void Start()
{
SerialPort port = new SerialPort("COM3", 115200, Parity.None, 8, StopBits.One);
port.DataReceived += port_DataReceived;
port.Open();client = new ZigbeeNet.Smartenit.CidClient(port.BaseStream);
client.ResponseReceived += client_ResponseReceived;
client.SendPacket(CidPackets.SystemPing);
client.SendPacket(CidPackets.SystemGetTime);
client.SendPacket(CidPackets.SystemSetTime(DateTime.Now));
client.SendPacket(CidPackets.SystemGetTime);
client.SendPacket(CidPackets.SystemStartNetwork());
}private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
SerialPort port = sender as SerialPort;
int count = port.BytesToRead;
while (count > 0)
{
byte[] bytes = new byte[count];
int readBytes = port.Read(bytes, 0, count);
client.OnDataRecieved(bytes);
count = port.BytesToRead;
}
}private void client_ResponseReceived(object sender, ZigbeeNet.Smartenit.CidResponseItem e)
{
Console.WriteLine(
string.Format("{0}: {1}\n", e.GetType().Name, e.ToString());
);
}