Mr-Markus / ZigbeeNet

A .NET Standard library for working with ZigBee
Eclipse Public License 1.0
130 stars 46 forks source link

Permit Join with XBee #170

Open sbroszat opened 2 years ago

sbroszat commented 2 years ago

Im unable to permit Join with an XBee, because the XBee seems to ignore the ZigBeeStd for this.

I have a workaround for this with the ZigbeeNet XBee framehandler:

        ZigBeeSerialPort zigbeePort = new ZigBeeSerialPort("/dev/ttyS0");
        IXBeeFrameHandler FH = new XBeeFrameHandler();
        FH.Start(zigbeePort);
        var command = new XBeeAtCommand();
        command.SetAtCommand("CB");                 //Push Commissioning button
        command.SetParameterValue(new int[] {2});   //Enable joining for 1 minute
        command.SetFrameId(0);                      //Not Used
        command.SetFrameType(8);                    //AT Command
        FH.SendRequest(command);
        FH.Close();
        IZigBeeTransportTransmit dongle = new ZigBeeDongleXBee(zigbeePort);
        Control.NetworkManager = new ZigBeeNetworkManager(dongle);

So every time I start my Zigbee Gateway it opens first the Network for 60s and then starts the NetworkManager. Is there any possibility to call the framehandler over the NetworkManager or any other way to send an AT-Command with an also running NetworkManager?