Exemplo n.º 1
0
        public static unsafe Error OpenModality(string robotID, OpenModalityProto openModality)
        {
            var buffer = openModality.ToByteArray();

            fixed(byte *p = buffer)
            {
                IntPtr ptr       = (IntPtr)p;
                var    protoMsgC = new ProtoMessageC
                {
                    data = new SWIGTYPE_p_void(ptr, false),
                    len  = (uint)buffer.Length
                };
                var sdkReturn = animus_client_sdk.OpenModalityGo(robotID, protoMsgC);

                if (sdkReturn == null)
                {
                    return(new Error {
                        Success = false
                    });
                }

                var err = new Error();

                err.MergeFrom(sdkReturn.GetBytes());
                return(err);
            }
        }