Java Code Examples for no.nordicsemi.android.ble.data.Data#IntFormat

The following examples show how to use no.nordicsemi.android.ble.data.Data#IntFormat . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private static Data create(final byte opCode, final byte operator,
						   @NonNull final FilterType filter,
						   @Data.IntFormat final int formatType,
						   final int... parameters) {
	final int parameterLen = formatType & 0x0F;

	final MutableData data = new MutableData(new byte[2 + 1 + parameters.length * parameterLen]);
	data.setByte(opCode, 0);
	data.setByte(operator, 1);
	if (parameters.length > 0) {
		data.setByte(filter.type, 2);
		data.setValue(parameters[0], formatType, 3);
	}
	if (parameters.length == 2) {
		data.setValue(parameters[1], formatType, 3 + parameterLen);
	}
	return data;
}
 
Example 2
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
private static Data create(final byte opCode, final byte operator,
						   @NonNull final FilterType filter,
						   @Data.IntFormat final int formatType,
						   final int... parameters) {
	final int parameterLen = formatType & 0x0F;

	final MutableData data = new MutableData(new byte[2 + 1 + parameters.length * parameterLen]);
	data.setByte(opCode, 0);
	data.setByte(operator, 1);
	if (parameters.length > 0) {
		data.setByte(filter.type, 2);
		data.setValue(parameters[0], formatType, 3);
	}
	if (parameters.length == 2) {
		data.setValue(parameters[1], formatType, 3 + parameterLen);
	}
	return data;
}
 
Example 3
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportStoredRecordsLessThenOrEqualTo(@NonNull final FilterType filter,
														@Data.IntFormat final int formatType,
														final int parameter) {
	return create(OP_CODE_REPORT_STORED_RECORDS, OPERATOR_LESS_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 4
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportNumberOfStoredRecordsFromRange(@NonNull final FilterType filter,
														@Data.IntFormat final int formatType,
														final int start, final int end) {
	return create(OP_CODE_REPORT_NUMBER_OF_RECORDS, OPERATOR_WITHING_RANGE,
			filter, formatType, start, end);
}
 
Example 5
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportNumberOfStoredRecordsGreaterThenOrEqualTo(@NonNull final FilterType filter,
																   @Data.IntFormat final int formatType,
																   final int parameter) {
	return create(OP_CODE_REPORT_NUMBER_OF_RECORDS, OPERATOR_GREATER_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 6
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportNumberOfStoredRecordsLessThenOrEqualTo(@NonNull final FilterType filter,
																@Data.IntFormat final int formatType,
																final int parameter) {
	return create(OP_CODE_REPORT_NUMBER_OF_RECORDS, OPERATOR_LESS_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 7
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data deleteStoredRecordsFromRange(@NonNull final FilterType filter,
												@Data.IntFormat final int formatType,
												final int start, final int end) {
	return create(OP_CODE_DELETE_STORED_RECORDS, OPERATOR_WITHING_RANGE,
			filter, formatType, start, end);
}
 
Example 8
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data deleteStoredRecordsGreaterThenOrEqualTo(@NonNull final FilterType filter,
														   @Data.IntFormat  int formatType,
														   final int parameter) {
	return create(OP_CODE_DELETE_STORED_RECORDS, OPERATOR_GREATER_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 9
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data deleteStoredRecordsLessThenOrEqualTo(@NonNull final FilterType filter,
														@Data.IntFormat final int formatType,
														final int parameter) {
	return create(OP_CODE_DELETE_STORED_RECORDS, OPERATOR_LESS_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 10
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportStoredRecordsFromRange(@NonNull final FilterType filter,
												@Data.IntFormat final int formatType,
												final int start, final int end) {
	return create(OP_CODE_REPORT_STORED_RECORDS, OPERATOR_WITHING_RANGE,
			filter, formatType, start, end);
}
 
Example 11
Source File: RecordAccessControlPointData.java    From Android-BLE-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportStoredRecordsGreaterThenOrEqualTo(@NonNull final FilterType filter,
														   @Data.IntFormat final int formatType,
														   final int parameter) {
	return create(OP_CODE_REPORT_STORED_RECORDS, OPERATOR_GREATER_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 12
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportStoredRecordsLessThenOrEqualTo(@NonNull final FilterType filter,
														@Data.IntFormat final int formatType,
														final int parameter) {
	return create(OP_CODE_REPORT_STORED_RECORDS, OPERATOR_LESS_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 13
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportNumberOfStoredRecordsFromRange(@NonNull final FilterType filter,
														@Data.IntFormat final int formatType,
														final int start, final int end) {
	return create(OP_CODE_REPORT_NUMBER_OF_RECORDS, OPERATOR_WITHING_RANGE,
			filter, formatType, start, end);
}
 
Example 14
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportNumberOfStoredRecordsGreaterThenOrEqualTo(@NonNull final FilterType filter,
																   @Data.IntFormat final int formatType,
																   final int parameter) {
	return create(OP_CODE_REPORT_NUMBER_OF_RECORDS, OPERATOR_GREATER_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 15
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportNumberOfStoredRecordsLessThenOrEqualTo(@NonNull final FilterType filter,
																@Data.IntFormat final int formatType,
																final int parameter) {
	return create(OP_CODE_REPORT_NUMBER_OF_RECORDS, OPERATOR_LESS_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 16
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data deleteStoredRecordsFromRange(@NonNull final FilterType filter,
												@Data.IntFormat final int formatType,
												final int start, final int end) {
	return create(OP_CODE_DELETE_STORED_RECORDS, OPERATOR_WITHING_RANGE,
			filter, formatType, start, end);
}
 
Example 17
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data deleteStoredRecordsGreaterThenOrEqualTo(@NonNull final FilterType filter,
														   @Data.IntFormat  int formatType,
														   final int parameter) {
	return create(OP_CODE_DELETE_STORED_RECORDS, OPERATOR_GREATER_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 18
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data deleteStoredRecordsLessThenOrEqualTo(@NonNull final FilterType filter,
														@Data.IntFormat final int formatType,
														final int parameter) {
	return create(OP_CODE_DELETE_STORED_RECORDS, OPERATOR_LESS_THEN_OR_EQUAL,
			filter, formatType, parameter);
}
 
Example 19
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportStoredRecordsFromRange(@NonNull final FilterType filter,
												@Data.IntFormat final int formatType,
												final int start, final int end) {
	return create(OP_CODE_REPORT_STORED_RECORDS, OPERATOR_WITHING_RANGE,
			filter, formatType, start, end);
}
 
Example 20
Source File: RecordAccessControlPointData.java    From Android-BLE-Common-Library with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public static Data reportStoredRecordsGreaterThenOrEqualTo(@NonNull final FilterType filter,
														   @Data.IntFormat final int formatType,
														   final int parameter) {
	return create(OP_CODE_REPORT_STORED_RECORDS, OPERATOR_GREATER_THEN_OR_EQUAL,
			filter, formatType, parameter);
}