@Override public UShort getServiceNumber() { return new UShort(0); }
@Override public UShort getAreaNumber() { return new UShort(0); }
/** * Generates an ObjectType from the objectTypeId (aka subkey) * * @param subkey Subkey of the COM object * @return ObjectType object */ public static ObjectType objectTypeId2objectType(Long subkey) { final long unwrap = (long) subkey; return new ObjectType(new UShort((short) (unwrap >> 48)), new UShort((short) (unwrap >> 32)), new UOctet((byte) (unwrap >> 24)), new UShort((short) (unwrap))); }
@Override public UShort decodeUShort() throws MALException { return new UShort(sourceBuffer.getUnsignedInt16()); }
@Override public UShort decodeUShort() throws MALException { return new UShort(sourceBuffer.getUnsignedInt16()); }
/** * Generates a COM ObjectType object from the area, service, version and * object number. Deprecated because this used to be needed when the * services didn't provide the static COM Objects ObjectType. This can now * be found in the service Helper. For example, for the Parameter service, * the parameter definition can be found in: * ParameterHelper.PARAMETERDEFINITION_OBJECT_TYPE * * @param area Area number * @param service Service number * @param version Version number * @param number Object number * @return The ObjectType object */ @Deprecated public static ObjectType generateCOMObjectType(int area, int service, int version, int number) { return new ObjectType( new UShort(area), new UShort(service), new UOctet((short) version), new UShort(number) ); }
public static void generateObjectTypeFromSubKey(ObjectType objectType, Long secondSubKey) { long subkey = secondSubKey; // Get the object number from the bottom 3 bytes. objectType.setNumber(new UShort((int) (subkey & 0xFFFFFF))); // Version comes from the next byte. objectType.setVersion(new UOctet((short) ((subkey >> 24) & 0xFF))); // Service comes from the next 2 bytes. objectType.setService(new UShort((int) ((subkey >> 32) & 0xFFFF))); // Arean comes from the next 2 bytes. objectType.setArea(new UShort((int) ((subkey >> 48) & 0xFFFF))); }
return new UShort();
return new UShort(Integer.parseInt(value));
public static byte[] createExchangeMessage(int index, UpdateHeaderList headerList, List[] valueLists, MALElementStreamFactory streamFactory) throws MALException { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); MALElementOutputStream enc = streamFactory.createOutputStream(baos); enc.writeElement(new UShort(valueLists.length + 1), null); writeListElement(index, headerList, enc); for (List valueList : valueLists) { writeListElement(index, valueList, enc); } enc.flush(); enc.close(); return baos.toByteArray(); } catch (Throwable ex) { throw new MALException("Internal error encoding message", ex); } }
static public void getValuesFromEntityKey(EntityKey key, KeyParts keyParts) { // Get the area/service/version from the second sub key generateObjectTypeFromSubKey(keyParts.objectType, key.getSecondSubKey()); // Add object number from first subkey keyParts.objectType.setNumber( new UShort(Integer.parseInt(key.getFirstSubKey().toString()))); // Instance number is 3rd keyParts.objectInstance = key.getThirdSubKey(); // Source object is all from the 4th generateObjectTypeFromSubKey(keyParts.sourceObjectType, key.getFourthSubKey()); }
new UShort(0), new UOctet((short) 0)); final ServiceFilter sf2 = new ServiceFilter(new Identifier(NMFProvider.NANOSAT_MO_SUPERVISOR_NAME), domain, new Identifier("*"), null, new Identifier("*"), sk, new UIntegerList());