예제 #1
0
        public void Test_0470_QLDeviceGroup_GetFrame()
        {
            // Note: This only uses the initially chosen device.

            // Note: This could be much more robust (i.e., by checking the data
            // in the received frame for correctness).

            int     deviceGroupId;
            QLError error = QuickLink2API.QLDeviceGroup_Create(out deviceGroupId);

            Assert.AreEqual(QLError.QL_ERROR_OK, error);
            Assert.Greater(deviceGroupId, 0);

            error = QuickLink2API.QLDeviceGroup_AddDevice(deviceGroupId, Test_SetUp.Helper.DeviceId);
            Assert.AreEqual(QLError.QL_ERROR_OK, error);

            error = QuickLink2API.QLDevice_Start(deviceGroupId);
            Assert.AreEqual(QLError.QL_ERROR_OK, error);

            int numFrames = 1;

            QLFrameData[] frameDataArray = new QLFrameData[numFrames];
            frameDataArray[0] = new QLFrameData();
            error             = QuickLink2API.QLDeviceGroup_GetFrame(deviceGroupId, 2000, ref numFrames, frameDataArray);
            Assert.AreEqual(QLError.QL_ERROR_OK, error);
            Assert.AreEqual(1, numFrames);

            Assert.AreEqual(Test_SetUp.Helper.DeviceId, frameDataArray[0].DeviceId);

            error = QuickLink2API.QLDevice_Stop(deviceGroupId);
            Assert.AreEqual(QLError.QL_ERROR_OK, error);
        }