Open nicolaiw opened 5 years ago
Because there is already a changed event for the network state (see: https://github.com/zigbeenet/ZigbeeNet/blob/master/src/ZigBeeNet.Hardware.TI.CC2531/Network/NetworkManager.cs#L102) it should not be too difficult to refactor the Startup() method of the ZigBeeDongleTiCc2531 class returning a Task. For this I would recommend a TaskCompletionSource where the result will be set in the event handler.
I began work on branch https://github.com/zigbeenet/ZigbeeNet/tree/feature/asyncStartup_issue46 and most code is implemented, but there is one thing which does not work.
When I start the sample application the hardware sends first requests sucessfully and gets responses, but while calling CreateEndpoint method and sending an AFRegister Request the response is null: https://github.com/zigbeenet/ZigbeeNet/blob/e005f2f4898742b486e577a7abc216ccd3403d15/libraries/ZigBeeNet.Hardware.TI.CC2531/ZigBeeDongleTiCc2531.cs#L321-L325
Does anyone have an idea?
I will fix this issue before creating the first release, because it is an breaking change for the caller of the library
Closed due to inactivity. Does not break programm
Hello Markus,
would you mind to reopen this Issue ? Just as a reminder.
Regards, Nicolai
Avoid while (true) { .. } during TI CC2531 startup
see: https://github.com/zigbeenet/ZigbeeNet/blob/master/src/ZigBeeNet.Hardware.TI.CC2531/ZigBeeDongleTiCc2531.cs#L234