private void EnqueueUserData(ASDU asdu) { //TODO problem -> buffer frame needs own buffer so that the message can be stored. BufferFrame bf = new BufferFrame(buffer, 0); asdu.Encode(bf, parameters); linkLayerUnbalanced.SendConfirmed(slaveAddress, bf); }
private void EnqueueUserData(ASDU asdu) { if (linkLayerUnbalanced != null) { //TODO problem -> buffer frame needs own buffer so that the message can be stored. BufferFrame frame = new BufferFrame(buffer, 0); asdu.Encode(frame, appLayerParameters); linkLayerUnbalanced.SendConfirmed(slaveAddress, frame); } else { lock (userDataQueue) { BufferFrame frame = new BufferFrame(new byte[256], 0); asdu.Encode(frame, appLayerParameters); userDataQueue.Enqueue(frame); } } }