Ejemplo n.º 1
0
    private async void Recieved(SyrusPacket packet)
    {
        switch (packet.id)
        {
        case 20:         // Update message
        {
            for (int i = 0; i < 9; i++)
            {
                points[i] = readVector(packet.data, 12 * i);
            }

            break;
        }

        case 21:         // Screen tap gesture
        {
            Debug.Log("Gesture: Tap");
            Vector3 pos = readVector(packet.data, 0);
            Vector3 dir = readVector(packet.data, 12).normalized;

            break;
        }

        case 22:         // Swipe gesture
        {
            Debug.Log("Gesture: Swipe");
            Vector3 pos = readVector(packet.data, 0);
            Vector3 dir = readVector(packet.data, 12).normalized;
            break;
        }
        }
    }
Ejemplo n.º 2
0
    private async void Recieved(SyrusPacket packet)
    {
        switch (packet.id)
        {
        case 24: {
            break;
        }

        case 20:
        {
            for (int i = 0; i < 9; i++)
            {
                points[i] = readVector(packet.data, 12 * i);
            }

            break;
        }

        case 21:
        {
            Vector3 pos = readVector(packet.data, 0);
            Vector3 dir = readVector(packet.data, 12).normalized;

            break;
        }
        }
    }
Ejemplo n.º 3
0
        private void InsertaLectura(SyrusPacket packet)
        {
            SqlGps gps = new SqlGps()
            {
                lng       = Convert.ToDouble(packet.Longitud),
                lat       = Convert.ToDouble(packet.Latitud),
                imei      = packet.ID,
                fecha     = packet.FechaHoraGps,
                velocidad = packet.Velocidad,
                datosJson = packet.DataJson
            };

            gps.InsertaLectura();
        }