コード例 #1
0
        private void ReceivePacketGetUserEqualizerControlACK(EqualizerControls control, GaiaPacket packet)
        {
            if (indexOfFeatures <= features.Length - 1)
            {
                GAIA.Status status = packet.GetStatus();
                if (status != GAIA.Status.NOT_SUPPORTED)
                {
                    UpdateLayoutEQ();
                }
            }
            else
            {
                GAIA.Status status = packet.GetStatus();
                if (status == GAIA.Status.SUCCESS)
                {
                    //byte[] payload = packet.GetPayload();
                    //int PAYLOAD_VALUE_OFFSET = 1;
                    //int PAYLOAD_VALUE_LENGTH = 1;
                    //int PAYLOAD_MIN_LENGTH = PAYLOAD_VALUE_LENGTH + 1; // ACK status length is 1

                    //if (payload.Length >= PAYLOAD_MIN_LENGTH)
                    //{
                    //    bool activate = payload[PAYLOAD_VALUE_OFFSET] == 0x01;
                    //    UpdateEqalizerButtons(control, activate);
                    //}
                }
                else
                {
                    //UpdateEqalizerButtons(control, false);
                    RefreshToast("User Equalizer not supported.");
                }
            }
        }
コード例 #2
0
 private void ReceivePacketGetRemoteControlACK(GaiaPacket packet)
 {
     if (indexOfFeatures <= features.Length)
     {
         GAIA.Status status = packet.GetStatus();
         if (status != GAIA.Status.NOT_SUPPORTED)
         {
             UpdateLayoutRemote();
         }
     }
     else
     {
         GAIA.Status status = packet.GetStatus();
         if (status != GAIA.Status.SUCCESS)
         {
             RefreshToast("The remote control feature is not supported.");
         }
     }
 }
コード例 #3
0
        private void ReceivePacketGetEqualizerControlACK(GaiaPacket packet)
        {
            GAIA.Status status = packet.GetStatus();
            if (status == GAIA.Status.SUCCESS)
            {
                //byte[] payload = packet.GetPayload();
                //int PAYLOAD_VALUE_OFFSET = 1;
                //int PAYLOAD_VALUE_LENGTH = 1;
                //int PAYLOAD_MIN_LENGTH = PAYLOAD_VALUE_LENGTH + 1; // ACK status length is 1

                //if (payload.Length >= PAYLOAD_MIN_LENGTH)
                //{
                //    int preset = payload[PAYLOAD_VALUE_OFFSET];
                //    UpdateEqalizerButtons((EqualizerPreset)preset);
                //}
            }
            else
            {
                RefreshToast("User Equalizer not supported.");
            }
        }
コード例 #4
0
        private void ReceivePacketGetLedControlACK(GaiaPacket packet)
        {
            GAIA.Status status = packet.GetStatus();
            if (status == GAIA.Status.SUCCESS)
            {
                byte[] payload = packet.GetPayload();
                int PAYLOAD_VALUE_OFFSET = 1;
                int PAYLOAD_VALUE_LENGTH = 1;
                int PAYLOAD_MIN_LENGTH = PAYLOAD_VALUE_LENGTH + 1; // ACK status length is 1

                if (payload.Length >= PAYLOAD_MIN_LENGTH)
                {
                    isLedActivated = payload[PAYLOAD_VALUE_OFFSET] == 0x01;
                    UpdateBtnLED(true);
                }
            }
            else
            {
                isLedActivated = false;
                UpdateBtnLED(false);
            }            
        }
コード例 #5
0
        private void ReceivePacketGetAPIVersionACK(GaiaPacket packet)
        {
            GAIA.Status status = packet.GetStatus();
            if (status == GAIA.Status.SUCCESS)
            {
                byte[] payload = packet.GetPayload();
                int PAYLOAD_VALUE_1_OFFSET = 1;
                int PAYLOAD_VALUE_2_OFFSET = PAYLOAD_VALUE_1_OFFSET + 1;
                int PAYLOAD_VALUE_3_OFFSET = PAYLOAD_VALUE_2_OFFSET + 1;
                int PAYLOAD_VALUE_LENGTH = 3;
                int PAYLOAD_MIN_LENGTH = PAYLOAD_VALUE_LENGTH + 1; // ACK status length is 1

                if (payload.Length >= PAYLOAD_MIN_LENGTH)
                {
                    UpdateLblInfo(payload[PAYLOAD_VALUE_1_OFFSET],
                            payload[PAYLOAD_VALUE_2_OFFSET],
                            payload[PAYLOAD_VALUE_3_OFFSET]);
                }
            }
            else
            {
                UpdateLblInfo(0, 0, 0);
            }
        }