public static byte[] CreateAssignSessionId(uint sessionId)
        {
            var fbb = new FlatBufferBuilder(1024);

            var oAssignSessionId = Messages.AssignSessionId.CreateAssignSessionId(fbb, sessionId);
            Messages.AssignSessionId.FinishAssignSessionIdBuffer(fbb, oAssignSessionId);

            return fbb.ToProtocolMessage(MessageIds.AssignSessionId);
        }
Beispiel #2
0
        public byte[] Serialize()
        {
            var fbb = new FlatBufferBuilder(1024);
            var msg = MetadataMsg.CreateMetadata(fbb,
                    ColorFrameWidth, ColorFrameHeight,
                    DepthFrameWidth, DepthFrameHeight);
            fbb.Finish(msg.Value);

            return fbb.ToProtocolMessage(MessageIds.Metadata);
        }
        public static byte[] CreateInputCommand(CommandFrame frame)
        {
            var fbb = new FlatBufferBuilder(1024);

            var oFrame = CreateCommandFrameOffset(frame, fbb);

            var oInputCommand = Messages.InputCommand.CreateInputCommand(fbb, oFrame);
            Messages.InputCommand.FinishInputCommandBuffer(fbb, oInputCommand);

            return fbb.ToProtocolMessage(MessageIds.InputCommand);
        }
Beispiel #4
0
        public byte[] Serialize()
        {
            var fbb = new FlatBufferBuilder(1024);

            var bodies = Array.ConvertAll(Bodies, body => body.Serialize(fbb));
            var msg = BodyFrameDataMsg.CreateBodyFrameData(fbb,
                    RelativeTime.Ticks,
                    BodyFrameDataMsg.CreateBodiesVector(fbb, bodies));
            fbb.Finish(msg.Value);

            return fbb.ToProtocolMessage(MessageIds.BodyFrameData);
        }
        public static byte[] CreateSyncFrame(CommandFrame[] frames)
        {
            var fbb = new FlatBufferBuilder(1024);

            var oFrames = CreateFrameOffsets(fbb, frames);
            var vFrames = Messages.SyncFrame.CreateFramesVector(fbb, oFrames);

            var oSyncFrame = Messages.SyncFrame.CreateSyncFrame(fbb, vFrames);
            Messages.SyncFrame.FinishSyncFrameBuffer(fbb, oSyncFrame);

            return fbb.ToProtocolMessage(MessageIds.SyncFrame);
        }