Пример #1
0
        public bool WriteRoute(byte[] data, int dataLen, RouteInfoBase routeInfo)
        {
            if (data == null)
            {
                return(false);
            }

            if (!Connected)
            {
                ADebug.LogError("WriteRoute but there's no Connection");
                return(false);
            }

            if (dataLen > data.Length || dataLen < 0)
            {
                dataLen = data.Length;
            }

            byte[] buf;
            routeInfo.Encode(out buf);
            if (buf == null)
            {
                ADebug.LogError("WriteRoute Encode error!");
                return(false);
            }
            return(gcloud_connector_writeRoute(ObjectId, data, dataLen, buf, buf.Length));
        }
Пример #2
0
        public void SetRouteInfo(RouteInfoBase routeInfo)
        {
            if (routeInfo == null)
            {
                ADebug.LogError("SetRouteInfo: routeInfo is null");
            }

            byte[] buf;
            routeInfo.Encode(out buf);
            if (buf == null)
            {
                ADebug.LogError("SetRouteInfo: routeInfo Encode error");
            }
            else
            {
                gcloud_connector_setRouteInfo(ObjectId, buf, buf.Length);
            }
        }