Android Open Source - lifx-sdk-android Lx Protocol Sensor






From Project

Back to project page lifx-sdk-android.

License

The source code is released under:

MIT License

If you think the Android project lifx-sdk-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

//
//  LxProtocolSensor.java
//  LIFX//from www  .ja  v  a 2 s .c om
//
//  Created by Jarrod Boyes on 24/03/14.
//  Copyright (c) 2014 LIFX Labs. All rights reserved.
//

// Start File: @./LxProtocolSensor.java 

package lifx.java.android.entities.internal.structle;

/*
  **** GENERATED CODE ****
  Start Of File: LxProtocolSensor.java 
*/

import java.util.HashMap;

import android.annotation.SuppressLint;

import lifx.java.android.entities.internal.structle.StructleTypes.Bool8;
import lifx.java.android.entities.internal.structle.StructleTypes.Float32;
import lifx.java.android.entities.internal.structle.StructleTypes.Int16;
import lifx.java.android.entities.internal.structle.StructleTypes.Int32;
import lifx.java.android.entities.internal.structle.StructleTypes.Int64;
import lifx.java.android.entities.internal.structle.StructleTypes.LxProtocolTypeBase;
import lifx.java.android.entities.internal.structle.StructleTypes.ProtocolField;
import lifx.java.android.entities.internal.structle.StructleTypes.RoutingField;
import lifx.java.android.entities.internal.structle.StructleTypes.UInt16;
import lifx.java.android.entities.internal.structle.StructleTypes.UInt32;
import lifx.java.android.entities.internal.structle.StructleTypes.UInt64;
import lifx.java.android.entities.internal.structle.StructleTypes.UInt8;

@SuppressLint( "UseSparseArrays")
@SuppressWarnings( "unused")
public class LxProtocolSensor
{

  
  public static class GetAmbientLight extends LxProtocolTypeBase    // Struct: Lx::Protocol::Sensor::GetAmbientLight 
  {
  
  private static final int PAYLOAD_SIZE = 0;
  
      public GetAmbientLight( byte[] bytes)
      {
        this( bytes, 0);
      }
  
      public GetAmbientLight( byte[] bytes, int initialOffset)
      {
        }
        
        public GetAmbientLight( Object padding
          )
        {
        }
        
        
        public void printMessageData()
        {
        }
        
        public static void loadMessageDataWithPayloadAtOffset( byte[] messageData, int offset
          )
        {
          byte[] memberData;    // = name.getBytes();
        
        }
        
        public static void loadMessageDataWithPayloadAtDefaultOffset( byte[] messageData
          )
        {
          int offset = PAYLOAD_OFFSET;
          
          loadMessageDataWithPayloadAtOffset( messageData, offset
          );
        }
        
        public byte[] getBytes()
        {
          int offset = 0;
        
          byte[] bytes = new byte[getPayloadSize()];
          
          byte[] memberData;
          
          
          return bytes;
        }
        
        public static int getPayloadSize()
        {
          return PAYLOAD_SIZE;
        }
  }
  
  public static class StateAmbientLight extends LxProtocolTypeBase    // Struct: Lx::Protocol::Sensor::StateAmbientLight 
  {
      // Fields: lux;
      private Float32 lux;        // Field: lux - Structle::Float byte offset: 0
  
  private static final int PAYLOAD_SIZE = 4;
  
      public StateAmbientLight( byte[] bytes)
      {
        this( bytes, 0);
      }
  
      public StateAmbientLight( byte[] bytes, int initialOffset)
      {
      byte[] member0Data = new byte[4];
      member0Data[0] = bytes[initialOffset + 0];
      member0Data[1] = bytes[initialOffset + 1];
      member0Data[2] = bytes[initialOffset + 2];
      member0Data[3] = bytes[initialOffset + 3];
        
          
        lux = new Float32( member0Data);
        
        }
        
        public StateAmbientLight( Object padding
      , Float32 lux
          )
        {
          this.lux = lux;
        }
        
      public Float32  getLux()
        {
          return lux;
        }        
        
        public void printMessageData()
        {
      lux.printValue( "lux");        // Field: lux - Structle::Float byte offset: 4
        }
        
        public static void loadMessageDataWithPayloadAtOffset( byte[] messageData, int offset
      , Float32 lux
          )
        {
          byte[] memberData;    // = name.getBytes();
        
          
        
      memberData = lux.getBytes();
        
          for( int i = 0; i < (memberData.length); i++)
          {
            messageData[(offset + i)] = memberData[i];
          }
        
          offset += memberData.length;
        }
        
        public static void loadMessageDataWithPayloadAtDefaultOffset( byte[] messageData
      , Float32 lux
          )
        {
          int offset = PAYLOAD_OFFSET;
          
          loadMessageDataWithPayloadAtOffset( messageData, offset
      , lux
          );
        }
        
        public byte[] getBytes()
        {
          int offset = 0;
        
          byte[] bytes = new byte[getPayloadSize()];
          
          byte[] memberData;
          
          // = name.getBytes();            
      memberData = lux.getBytes();
        
          for( int i = 0; i < (memberData.length); i++)
          {
            bytes[(offset + i)] = memberData[i];
          }
          
          offset += memberData.length;
          
          return bytes;
        }
        
        public static int getPayloadSize()
        {
          return PAYLOAD_SIZE;
        }
  }
  
  public static class GetDimmerVoltage extends LxProtocolTypeBase    // Struct: Lx::Protocol::Sensor::GetDimmerVoltage 
  {
  
  private static final int PAYLOAD_SIZE = 0;
  
      public GetDimmerVoltage( byte[] bytes)
      {
        this( bytes, 0);
      }
  
      public GetDimmerVoltage( byte[] bytes, int initialOffset)
      {
        }
        
        public GetDimmerVoltage( Object padding
          )
        {
        }
        
        
        public void printMessageData()
        {
        }
        
        public static void loadMessageDataWithPayloadAtOffset( byte[] messageData, int offset
          )
        {
          byte[] memberData;    // = name.getBytes();
        
        }
        
        public static void loadMessageDataWithPayloadAtDefaultOffset( byte[] messageData
          )
        {
          int offset = PAYLOAD_OFFSET;
          
          loadMessageDataWithPayloadAtOffset( messageData, offset
          );
        }
        
        public byte[] getBytes()
        {
          int offset = 0;
        
          byte[] bytes = new byte[getPayloadSize()];
          
          byte[] memberData;
          
          
          return bytes;
        }
        
        public static int getPayloadSize()
        {
          return PAYLOAD_SIZE;
        }
  }
  
  public static class StateDimmerVoltage extends LxProtocolTypeBase    // Struct: Lx::Protocol::Sensor::StateDimmerVoltage 
  {
      // Fields: voltage;
      private UInt32 voltage;      // Field: voltage - Structle::Uint32 byte offset: 0
  
  private static final int PAYLOAD_SIZE = 4;
  
      public StateDimmerVoltage( byte[] bytes)
      {
        this( bytes, 0);
      }
  
      public StateDimmerVoltage( byte[] bytes, int initialOffset)
      {
      byte[] member0Data = new byte[4];
      member0Data[0] = bytes[initialOffset + 0];
      member0Data[1] = bytes[initialOffset + 1];
      member0Data[2] = bytes[initialOffset + 2];
      member0Data[3] = bytes[initialOffset + 3];
        
          
        voltage = new UInt32( member0Data); 
        
        }
        
        public StateDimmerVoltage( Object padding
      , UInt32 voltage
          )
        {
          this.voltage = voltage;
        }
        
      public UInt32  getVoltage()
        {
          return voltage;
        }      
        
        public void printMessageData()
        {
      voltage.printValue( "voltage");      // Field: voltage - Structle::Uint32 byte offset: 4
        }
        
        public static void loadMessageDataWithPayloadAtOffset( byte[] messageData, int offset
      , UInt32 voltage
          )
        {
          byte[] memberData;    // = name.getBytes();
        
          
        
      memberData = voltage.getBytes();
        
          for( int i = 0; i < (memberData.length); i++)
          {
            messageData[(offset + i)] = memberData[i];
          }
        
          offset += memberData.length;
        }
        
        public static void loadMessageDataWithPayloadAtDefaultOffset( byte[] messageData
      , UInt32 voltage
          )
        {
          int offset = PAYLOAD_OFFSET;
          
          loadMessageDataWithPayloadAtOffset( messageData, offset
      , voltage
          );
        }
        
        public byte[] getBytes()
        {
          int offset = 0;
        
          byte[] bytes = new byte[getPayloadSize()];
          
          byte[] memberData;
          
          // = name.getBytes();            
      memberData = voltage.getBytes();
        
          for( int i = 0; i < (memberData.length); i++)
          {
            bytes[(offset + i)] = memberData[i];
          }
          
          offset += memberData.length;
          
          return bytes;
        }
        
        public static int getPayloadSize()
        {
          return PAYLOAD_SIZE;
        }
  }
  
}

/*
  End Of File: LxProtocolSensor.java
*/




Java Source Code List

com.example.lifx_sdk_samples.LFXSDKLightEditLabelActivity.java
com.example.lifx_sdk_samples.LFXSDKLightListAdapter.java
com.example.lifx_sdk_samples.LFXSDKLightPowerActivity.java
com.example.lifx_sdk_samples.LFXSDKLightRandomColorActivity.java
com.example.lifx_sdk_samples.LFXSDKSamplesActivity.java
com.example.lifx_sdk_samples.LFXSDKTaggedLightCollectionListAdapter.java
lifx.java.android.client.LFXClient.java
lifx.java.android.constant.LFXSDKConstants.java
lifx.java.android.entities.LFXHSBKColor.java
lifx.java.android.entities.LFXLightTarget.java
lifx.java.android.entities.LFXTypes.java
lifx.java.android.entities.internal.LFXBinaryPath.java
lifx.java.android.entities.internal.LFXBinaryTargetID.java
lifx.java.android.entities.internal.LFXBinaryTypes.java
lifx.java.android.entities.internal.LFXDeviceMapping.java
lifx.java.android.entities.internal.LFXGatewayDescriptor.java
lifx.java.android.entities.internal.LFXMessageObservationDescriptor.java
lifx.java.android.entities.internal.LFXMessage.java
lifx.java.android.entities.internal.LFXSiteID.java
lifx.java.android.entities.internal.LFXTagMapping.java
lifx.java.android.entities.internal.LFXTarget.java
lifx.java.android.entities.internal.structle.LxProtocolDevice.java
lifx.java.android.entities.internal.structle.LxProtocolLight.java
lifx.java.android.entities.internal.structle.LxProtocolSensor.java
lifx.java.android.entities.internal.structle.LxProtocolWan.java
lifx.java.android.entities.internal.structle.LxProtocolWifi.java
lifx.java.android.entities.internal.structle.LxProtocol.java
lifx.java.android.entities.internal.structle.Lx.java
lifx.java.android.entities.internal.structle.StructleTypes.java
lifx.java.android.internal.LFXWiFiObserver.java
lifx.java.android.light.LFXLightCollection.java
lifx.java.android.light.LFXLight.java
lifx.java.android.light.LFXTaggedLightCollection.java
lifx.java.android.light.internal.LFXAllLightsCollection.java
lifx.java.android.network_context.LFXNetworkContext.java
lifx.java.android.network_context.internal.routing_table.LFXRoutingTable.java
lifx.java.android.network_context.internal.transport_manager.LFXTransportManager.java
lifx.java.android.network_context.internal.transport_manager.gateway_connection.LFXGatewayConnection.java
lifx.java.android.network_context.internal.transport_manager.gateway_connection.LFXSocketGeneric.java
lifx.java.android.network_context.internal.transport_manager.gateway_connection.LFXSocketTCP.java
lifx.java.android.network_context.internal.transport_manager.gateway_connection.LFXSocketUDP.java
lifx.java.android.network_context.internal.transport_manager.gateway_connection.LFXTCPGatewayConnection.java
lifx.java.android.network_context.internal.transport_manager.gateway_connection.LFXUDPGatewayConnection.java
lifx.java.android.network_context.internal.transport_manager.lan.LFXLANTransportManager.java
lifx.java.android.network_context.internal.transport_manager.lan.gateway_discovery.LFXGatewayDiscoveryController.java
lifx.java.android.network_context.internal.transport_manager.lan.gateway_discovery.LFXGatewayDiscoveryTableEntry.java
lifx.java.android.util.LFXByteUtils.java
lifx.java.android.util.LFXLog.java
lifx.java.android.util.LFXNetworkUtils.java
lifx.java.android.util.LFXTimerUtils.java