mirror of
https://github.com/Maschell/HIDtoVPADNetworkClient.git
synced 2024-11-22 14:09:17 +01:00
Merge branch 'master' of https://github.com/QuarkTheAwesome/HIDToVPADNetworkClient
This commit is contained in:
commit
6fd6c9aeaf
@ -6,7 +6,11 @@
|
|||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" path="resources"/>
|
<classpathentry excluding="**" kind="src" output="target/classes" path="resources">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ hs_err_pid*
|
|||||||
bin/
|
bin/
|
||||||
target/
|
target/
|
||||||
.settings/
|
.settings/
|
||||||
|
config/hidtovpad.properties
|
||||||
|
295
eclipse_code_convention.xml
Normal file
295
eclipse_code_convention.xml
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<profiles version="12">
|
||||||
|
<profile kind="CodeFormatterProfile" name="HIDtoVPADNetworkClient Code Convention" version="12">
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="160"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||||
|
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
@ -32,10 +32,8 @@ import net.ash.HIDToVPADNetworkClient.util.Settings;
|
|||||||
* TODO finish HidController
|
* TODO finish HidController
|
||||||
* TODO locale
|
* TODO locale
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("Hello World!");
|
|
||||||
Settings.loadSettings();
|
Settings.loadSettings();
|
||||||
try {
|
try {
|
||||||
new Thread(ActiveControllerManager.getInstance()).start();
|
new Thread(ActiveControllerManager.getInstance()).start();
|
||||||
|
@ -29,9 +29,10 @@ import net.ash.HIDToVPADNetworkClient.util.Settings;
|
|||||||
import net.ash.HIDToVPADNetworkClient.util.Utilities;
|
import net.ash.HIDToVPADNetworkClient.util.Utilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main controller interface, extended by controller drivers.
|
* Main controller interface, extended by controller drivers. <br>
|
||||||
* <br><br>
|
* <br>
|
||||||
* See {@link LinuxDevInputController} for a full implementation.
|
* See {@link LinuxDevInputController} for a full implementation.
|
||||||
|
*
|
||||||
* @author ash
|
* @author ash
|
||||||
*/
|
*/
|
||||||
public abstract class Controller implements Runnable {
|
public abstract class Controller implements Runnable {
|
||||||
@ -60,7 +61,7 @@ public abstract class Controller implements Runnable{
|
|||||||
public void run() {
|
public void run() {
|
||||||
boolean shutdownState = shutdown;
|
boolean shutdownState = shutdown;
|
||||||
while (!shutdownState) {
|
while (!shutdownState) {
|
||||||
Utilities.sleep(Settings.getDetectControllerInterval());
|
Utilities.sleep(Settings.DETECT_CONTROLLER_INTERVAL);
|
||||||
while (isActive()) {
|
while (isActive()) {
|
||||||
byte[] newData = pollLatestData();
|
byte[] newData = pollLatestData();
|
||||||
if (newData != null) {
|
if (newData != null) {
|
||||||
@ -78,7 +79,7 @@ public abstract class Controller implements Runnable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void doSleepAfterPollingData() {
|
protected void doSleepAfterPollingData() {
|
||||||
Utilities.sleep(Settings.getSleepAfterPolling());
|
Utilities.sleep(Settings.SLEEP_AFER_POLLING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Synchronized("dataLock")
|
@Synchronized("dataLock")
|
||||||
@ -100,16 +101,15 @@ public abstract class Controller implements Runnable{
|
|||||||
public abstract byte[] pollLatestData();
|
public abstract byte[] pollLatestData();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up the driver.
|
* Sets up the driver. <br>
|
||||||
* <br>
|
|
||||||
* During this method call, a connection will be made with the controller hardware (if required).
|
* During this method call, a connection will be made with the controller hardware (if required).
|
||||||
*
|
*
|
||||||
* @param arg Driver-specific init argument, see {@link ControllerManager} and {@link ControllerDetector}.
|
* @param arg
|
||||||
|
* Driver-specific init argument, see {@link ControllerManager} and {@link ControllerDetector}.
|
||||||
* @return Whether initialization was successful.
|
* @return Whether initialization was successful.
|
||||||
*/
|
*/
|
||||||
public abstract boolean initController(String identifier);
|
public abstract boolean initController(String identifier);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroys the controller driver and ends the polling thread.
|
* Destroys the controller driver and ends the polling thread.
|
||||||
*/
|
*/
|
||||||
@ -123,7 +123,6 @@ public abstract class Controller implements Runnable{
|
|||||||
*/
|
*/
|
||||||
public abstract void destroyDriver();
|
public abstract void destroyDriver();
|
||||||
|
|
||||||
|
|
||||||
private void endThread() {
|
private void endThread() {
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -176,20 +175,14 @@ public abstract class Controller implements Runnable{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj) return true;
|
||||||
return true;
|
if (obj == null) return false;
|
||||||
if (obj == null)
|
if (getClass() != obj.getClass()) return false;
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
Controller other = (Controller) obj;
|
Controller other = (Controller) obj;
|
||||||
if (identifier == null) {
|
if (identifier == null) {
|
||||||
if (other.identifier != null)
|
if (other.identifier != null) return false;
|
||||||
return false;
|
} else if (!identifier.equals(other.identifier)) return false;
|
||||||
} else if (!identifier.equals(other.identifier))
|
if (type != other.type) return false;
|
||||||
return false;
|
|
||||||
if (type != other.type)
|
|
||||||
return false;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,8 @@ public class LinuxDevInputController extends Controller implements Runnable{
|
|||||||
|
|
||||||
setVID((short) (identifier.hashCode() & 0xFFFF));
|
setVID((short) (identifier.hashCode() & 0xFFFF));
|
||||||
setPID((short) ((identifier.hashCode() >> Short.BYTES) & 0xFFFF));
|
setPID((short) ((identifier.hashCode() >> Short.BYTES) & 0xFFFF));
|
||||||
System.out.println("[LinuxDevInputController] " + identifier.toString() + " fakevid: " + Integer.toHexString((int)getVID() & 0xFFFF) + " fakepid: " + Integer.toHexString((int)getPID() & 0xFFFF));
|
System.out.println("[LinuxDevInputController] " + identifier.toString() + " fakevid: " + Integer.toHexString((int) getVID() & 0xFFFF) + " fakepid: "
|
||||||
|
+ Integer.toHexString((int) getPID() & 0xFFFF));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -128,7 +129,8 @@ public class LinuxDevInputController extends Controller implements Runnable{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSleepAfterPollingData() {
|
protected void doSleepAfterPollingData() {
|
||||||
//This is event driven (aka pollLatestData() is blocking anyway until we have data), we don't need to sleep it all.
|
// This is event driven (aka pollLatestData() is blocking anyway until
|
||||||
|
// we have data), we don't need to sleep it all.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -141,7 +143,8 @@ public class LinuxDevInputController extends Controller implements Runnable{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[" + super.toString() + ";VID," + Integer.toHexString((int)getVID() & 0xFFFF) + ";PID," + Integer.toHexString((int)getPID() & 0xFFFF) + ";run," + isActive() + ((controller == null) ? ";uninitialised]" : ";initialised]");
|
return "[" + super.toString() + ";VID," + Integer.toHexString((int) getVID() & 0xFFFF) + ";PID," + Integer.toHexString((int) getPID() & 0xFFFF)
|
||||||
|
+ ";run," + isActive() + ((controller == null) ? ";uninitialised]" : ";initialised]");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -36,12 +36,13 @@ import purejavahidapi.InputReportListener;
|
|||||||
public class PureJavaHidController extends Controller implements InputReportListener {
|
public class PureJavaHidController extends Controller implements InputReportListener {
|
||||||
public static Controller getInstance(String deviceIdentifier) throws IOException, ControllerInitializationFailedException {
|
public static Controller getInstance(String deviceIdentifier) throws IOException, ControllerInitializationFailedException {
|
||||||
HidDevice device = PureJavaHidApiManager.getDeviceByPath(deviceIdentifier);
|
HidDevice device = PureJavaHidApiManager.getDeviceByPath(deviceIdentifier);
|
||||||
//We use a special version to optimize the data for the switch pro controller
|
// We use a special version to optimize the data for the switch pro
|
||||||
if(device.getHidDeviceInfo().getVendorId() == SwitchProController.SWITCH_PRO_CONTROLLER_VID &&
|
// controller
|
||||||
device.getHidDeviceInfo().getProductId() == SwitchProController.SWITCH_PRO_CONTROLLER_PID){
|
if (device.getHidDeviceInfo().getVendorId() == SwitchProController.SWITCH_PRO_CONTROLLER_VID
|
||||||
|
&& device.getHidDeviceInfo().getProductId() == SwitchProController.SWITCH_PRO_CONTROLLER_PID) {
|
||||||
return new SwitchProController(deviceIdentifier);
|
return new SwitchProController(deviceIdentifier);
|
||||||
}else if(device.getHidDeviceInfo().getVendorId() == DS4NewController.DS4_NEW_CONTROLLER_VID &&
|
} else if (device.getHidDeviceInfo().getVendorId() == DS4NewController.DS4_NEW_CONTROLLER_VID
|
||||||
device.getHidDeviceInfo().getProductId() == DS4NewController.DS4_NEW_CONTROLLER_PID){
|
&& device.getHidDeviceInfo().getProductId() == DS4NewController.DS4_NEW_CONTROLLER_PID) {
|
||||||
return new DS4NewController(deviceIdentifier);
|
return new DS4NewController(deviceIdentifier);
|
||||||
} else {
|
} else {
|
||||||
return new PureJavaHidController(deviceIdentifier);
|
return new PureJavaHidController(deviceIdentifier);
|
||||||
@ -57,8 +58,7 @@ public class PureJavaHidController extends Controller implements InputReportList
|
|||||||
|
|
||||||
protected int PACKET_LENGTH = 64;
|
protected int PACKET_LENGTH = 64;
|
||||||
|
|
||||||
@Getter @Setter(AccessLevel.PRIVATE)
|
@Getter @Setter(AccessLevel.PRIVATE) private HidDevice hidDevice;
|
||||||
private HidDevice hidDevice;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean initController(String identifier) {
|
public boolean initController(String identifier) {
|
||||||
|
@ -25,29 +25,37 @@ import java.awt.event.WindowEvent;
|
|||||||
import java.awt.event.WindowListener;
|
import java.awt.event.WindowListener;
|
||||||
|
|
||||||
import net.ash.HIDToVPADNetworkClient.Main;
|
import net.ash.HIDToVPADNetworkClient.Main;
|
||||||
|
import net.ash.HIDToVPADNetworkClient.util.Settings;
|
||||||
|
|
||||||
public class GuiCloseListener implements WindowListener {
|
public class GuiCloseListener implements WindowListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void windowClosing(WindowEvent arg0) {
|
public void windowClosing(WindowEvent arg0) {
|
||||||
|
Settings.saveSettings();
|
||||||
Main.initiateShutdown();
|
Main.initiateShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void windowActivated(WindowEvent arg0) {}
|
public void windowActivated(WindowEvent arg0) {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void windowClosed(WindowEvent arg0) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void windowDeactivated(WindowEvent arg0) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void windowDeiconified(WindowEvent arg0) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void windowIconified(WindowEvent arg0) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void windowOpened(WindowEvent arg0) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void windowClosed(WindowEvent arg0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void windowDeactivated(WindowEvent arg0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void windowDeiconified(WindowEvent arg0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void windowIconified(WindowEvent arg0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void windowOpened(WindowEvent arg0) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -60,7 +60,8 @@ public class GuiControllerList extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void updateControllerList() {
|
public synchronized void updateControllerList() {
|
||||||
//System.out.println("[GuiControllerList] Updating controller list..."); //XXX debug text
|
// System.out.println("[GuiControllerList] Updating controller
|
||||||
|
// list..."); //XXX debug text
|
||||||
|
|
||||||
boolean repaintNeeded = false;
|
boolean repaintNeeded = false;
|
||||||
|
|
||||||
|
@ -85,18 +85,13 @@ public class GuiControllerListItem extends JPanel implements ActionListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj) return true;
|
||||||
return true;
|
if (obj == null) return false;
|
||||||
if (obj == null)
|
if (getClass() != obj.getClass()) return false;
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
GuiControllerListItem other = (GuiControllerListItem) obj;
|
GuiControllerListItem other = (GuiControllerListItem) obj;
|
||||||
if (controller == null) {
|
if (controller == null) {
|
||||||
if (other.controller != null)
|
if (other.controller != null) return false;
|
||||||
return false;
|
} else if (!controller.equals(other.controller)) return false;
|
||||||
} else if (!controller.equals(other.controller))
|
|
||||||
return false;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,6 @@ public class GuiInputControls extends JPanel implements ActionListener {
|
|||||||
connectButton = new JButton(CONNECT);
|
connectButton = new JButton(CONNECT);
|
||||||
connectButton.setAlignmentX(Component.CENTER_ALIGNMENT);
|
connectButton.setAlignmentX(Component.CENTER_ALIGNMENT);
|
||||||
|
|
||||||
|
|
||||||
ipTextBox = new JTextField();
|
ipTextBox = new JTextField();
|
||||||
ipTextBox.setColumns(15);
|
ipTextBox.setColumns(15);
|
||||||
ipTextBox.setText(Settings.getIpAddr());
|
ipTextBox.setText(Settings.getIpAddr());
|
||||||
@ -134,6 +133,7 @@ public class GuiInputControls extends JPanel implements ActionListener {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
Settings.setIpAddr(ipTextBox.getText());
|
||||||
if (NetworkManager.getInstance().isReconnecting()) {
|
if (NetworkManager.getInstance().isReconnecting()) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -50,6 +50,7 @@ public class GuiMain extends JPanel {
|
|||||||
|
|
||||||
private GuiControllerList leftControllerList;
|
private GuiControllerList leftControllerList;
|
||||||
private GuiInputControls rightSideControls;
|
private GuiInputControls rightSideControls;
|
||||||
|
|
||||||
public GuiMain() {
|
public GuiMain() {
|
||||||
super(new BorderLayout());
|
super(new BorderLayout());
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ public class ActiveControllerManager implements Runnable{
|
|||||||
while (true) {
|
while (true) {
|
||||||
updateControllerStates();
|
updateControllerStates();
|
||||||
ControllerManager.detectControllers();
|
ControllerManager.detectControllers();
|
||||||
Utilities.sleep(Settings.getDetectControllerInterval());
|
Utilities.sleep(Settings.DETECT_CONTROLLER_INTERVAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
@ -63,13 +63,14 @@ public class ActiveControllerManager implements Runnable{
|
|||||||
public void run() {
|
public void run() {
|
||||||
while (true) {
|
while (true) {
|
||||||
handleControllerInputs();
|
handleControllerInputs();
|
||||||
Utilities.sleep(Settings.getHandleInputsInterval());
|
Utilities.sleep(Settings.HANDLE_INPUTS_INTERVAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<Controller, NetworkHIDDevice> activeControllers = new HashMap<Controller, NetworkHIDDevice>();
|
private Map<Controller, NetworkHIDDevice> activeControllers = new HashMap<Controller, NetworkHIDDevice>();
|
||||||
|
|
||||||
public void updateControllerStates() {
|
public void updateControllerStates() {
|
||||||
List<Controller> currentControllers = ControllerManager.getActiveControllers();
|
List<Controller> currentControllers = ControllerManager.getActiveControllers();
|
||||||
|
|
||||||
|
@ -37,15 +37,15 @@ import com.ivan.xinput.exceptions.XInputNotLoadedException;
|
|||||||
import lombok.Synchronized;
|
import lombok.Synchronized;
|
||||||
import net.ash.HIDToVPADNetworkClient.controller.Controller;
|
import net.ash.HIDToVPADNetworkClient.controller.Controller;
|
||||||
import net.ash.HIDToVPADNetworkClient.controller.Controller.ControllerType;
|
import net.ash.HIDToVPADNetworkClient.controller.Controller.ControllerType;
|
||||||
import net.ash.HIDToVPADNetworkClient.controller.PureJavaHidController;
|
|
||||||
import net.ash.HIDToVPADNetworkClient.controller.LinuxDevInputController;
|
import net.ash.HIDToVPADNetworkClient.controller.LinuxDevInputController;
|
||||||
|
import net.ash.HIDToVPADNetworkClient.controller.PureJavaHidController;
|
||||||
import net.ash.HIDToVPADNetworkClient.controller.XInput13Controller;
|
import net.ash.HIDToVPADNetworkClient.controller.XInput13Controller;
|
||||||
import net.ash.HIDToVPADNetworkClient.controller.XInput14Controller;
|
import net.ash.HIDToVPADNetworkClient.controller.XInput14Controller;
|
||||||
import net.ash.HIDToVPADNetworkClient.controller.XInputController;
|
import net.ash.HIDToVPADNetworkClient.controller.XInputController;
|
||||||
import net.ash.HIDToVPADNetworkClient.exeption.ControllerInitializationFailedException;
|
import net.ash.HIDToVPADNetworkClient.exeption.ControllerInitializationFailedException;
|
||||||
import net.ash.HIDToVPADNetworkClient.util.PureJavaHidApiManager;
|
import net.ash.HIDToVPADNetworkClient.util.PureJavaHidApiManager;
|
||||||
|
import net.ash.HIDToVPADNetworkClient.util.Settings;
|
||||||
import purejavahidapi.HidDeviceInfo;
|
import purejavahidapi.HidDeviceInfo;
|
||||||
import purejavahidapi.PureJavaHidApi;
|
|
||||||
|
|
||||||
public class ControllerManager {
|
public class ControllerManager {
|
||||||
private static Map<String, Controller> attachedControllers = new HashMap<String, Controller>();
|
private static Map<String, Controller> attachedControllers = new HashMap<String, Controller>();
|
||||||
@ -55,24 +55,15 @@ public class ControllerManager{
|
|||||||
*/
|
*/
|
||||||
@Synchronized("attachedControllers")
|
@Synchronized("attachedControllers")
|
||||||
public static void detectControllers() {
|
public static void detectControllers() {
|
||||||
String os = System.getProperty("os.name");
|
|
||||||
//System.out.println("[ControllerDetector] OS: " + os);
|
|
||||||
|
|
||||||
Map<String, ControllerType> connectedDevices = new HashMap<String, ControllerType>();
|
Map<String, ControllerType> connectedDevices = new HashMap<String, ControllerType>();
|
||||||
|
|
||||||
if (os.contains("Linux")) {
|
if (Settings.isLinux()) {
|
||||||
connectedDevices.putAll(detectLinuxControllers());
|
connectedDevices.putAll(detectLinuxControllers());
|
||||||
} else if (os.contains("Windows")) {
|
} else if (Settings.isWindows()) {
|
||||||
connectedDevices.putAll(detectWindowsControllers());
|
connectedDevices.putAll(detectWindowsControllers());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (os.contains("Mac OS X")) {
|
|
||||||
connectedDevices.putAll(detectOSXHIDDevices());
|
|
||||||
PureJavaHidApiManager.MAC_OS_X = true;
|
|
||||||
} else {
|
|
||||||
connectedDevices.putAll(detectHIDDevices());
|
connectedDevices.putAll(detectHIDDevices());
|
||||||
PureJavaHidApiManager.MAC_OS_X = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove detached devices
|
// Remove detached devices
|
||||||
List<String> toRemove = new ArrayList<String>();
|
List<String> toRemove = new ArrayList<String>();
|
||||||
@ -109,9 +100,7 @@ public class ControllerManager{
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO: Currently the XInput will be set active automatically. But this should move to something for the settings?
|
||||||
* Currently the XInput will be set active automatically.
|
|
||||||
* But this should move to something for the settings?
|
|
||||||
*/
|
*/
|
||||||
case XINPUT14:
|
case XINPUT14:
|
||||||
try {
|
try {
|
||||||
@ -132,7 +121,8 @@ public class ControllerManager{
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(c != null){ //I don't like that starting the Thread happens here =/
|
if (c != null) { // I don't like that starting the Thread
|
||||||
|
// happens here =/
|
||||||
new Thread(c).start();
|
new Thread(c).start();
|
||||||
attachedControllers.put(deviceIdentifier, c);
|
attachedControllers.put(deviceIdentifier, c);
|
||||||
}
|
}
|
||||||
@ -148,22 +138,11 @@ public class ControllerManager{
|
|||||||
private static Map<String, ControllerType> detectHIDDevices() {
|
private static Map<String, ControllerType> detectHIDDevices() {
|
||||||
Map<String, ControllerType> connectedDevices = new HashMap<String, ControllerType>();
|
Map<String, ControllerType> connectedDevices = new HashMap<String, ControllerType>();
|
||||||
|
|
||||||
for (HidDeviceInfo info : PureJavaHidApi.enumerateDevices()) {
|
for (HidDeviceInfo info : PureJavaHidApiManager.getAttachedController()) {
|
||||||
if(info.getUsagePage() == 0x05 || info.getUsagePage() == 0x04 || (info.getVendorId() == 0x57e) || (info.getVendorId() == 0x054c) ){
|
String path = info.getPath();
|
||||||
connectedDevices.put(info.getPath(),ControllerType.PureJAVAHid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return connectedDevices;
|
if (Settings.isMacOSX()) path = path.substring(0, 13);
|
||||||
}
|
connectedDevices.put(path, ControllerType.PureJAVAHid);
|
||||||
|
|
||||||
private static Map<String, ControllerType> detectOSXHIDDevices() {
|
|
||||||
Map<String,ControllerType> connectedDevices = new HashMap<String,ControllerType>();
|
|
||||||
|
|
||||||
for (HidDeviceInfo info : PureJavaHidApi.enumerateDevices()) {
|
|
||||||
if(info.getUsagePage() == 0x05 || info.getUsagePage() == 0x04 || (info.getVendorId() == 0x57e) || (info.getVendorId() == 0x054c) ){
|
|
||||||
connectedDevices.put(info.getPath().substring(0, 13),ControllerType.PureJAVAHid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return connectedDevices;
|
return connectedDevices;
|
||||||
|
@ -35,7 +35,6 @@ import net.ash.HIDToVPADNetworkClient.network.commands.DetachCommand;
|
|||||||
import net.ash.HIDToVPADNetworkClient.network.commands.DeviceCommand;
|
import net.ash.HIDToVPADNetworkClient.network.commands.DeviceCommand;
|
||||||
import net.ash.HIDToVPADNetworkClient.network.commands.ReadCommand;
|
import net.ash.HIDToVPADNetworkClient.network.commands.ReadCommand;
|
||||||
import net.ash.HIDToVPADNetworkClient.util.HandleFoundry;
|
import net.ash.HIDToVPADNetworkClient.util.HandleFoundry;
|
||||||
import net.ash.HIDToVPADNetworkClient.util.Utilities;
|
|
||||||
|
|
||||||
public class NetworkHIDDevice {
|
public class NetworkHIDDevice {
|
||||||
@Getter private final short vid;
|
@Getter private final short vid;
|
||||||
@ -73,6 +72,7 @@ public class NetworkHIDDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private byte[] lastdata = null;
|
private byte[] lastdata = null;
|
||||||
|
|
||||||
public void sendRead(byte[] data) {
|
public void sendRead(byte[] data) {
|
||||||
if (!Arrays.equals(lastdata, data)) {
|
if (!Arrays.equals(lastdata, data)) {
|
||||||
synchronized (readCommandLock) {
|
synchronized (readCommandLock) {
|
||||||
@ -108,15 +108,11 @@ public class NetworkHIDDevice {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if (this == obj) return true;
|
||||||
return true;
|
if (obj == null) return false;
|
||||||
if (obj == null)
|
if (getClass() != obj.getClass()) return false;
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
NetworkHIDDevice other = (NetworkHIDDevice) obj;
|
NetworkHIDDevice other = (NetworkHIDDevice) obj;
|
||||||
if (hidHandle != other.hidHandle)
|
if (hidHandle != other.hidHandle) return false;
|
||||||
return false;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package net.ash.HIDToVPADNetworkClient.network;
|
package net.ash.HIDToVPADNetworkClient.network;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -70,6 +71,7 @@ public class NetworkManager implements Runnable{
|
|||||||
* We want to remove them at the end of a cycle. To make sure the detach was send before removing.
|
* We want to remove them at the end of a cycle. To make sure the detach was send before removing.
|
||||||
*/
|
*/
|
||||||
@Getter private List<NetworkHIDDevice> toRemove = new ArrayList<NetworkHIDDevice>();
|
@Getter private List<NetworkHIDDevice> toRemove = new ArrayList<NetworkHIDDevice>();
|
||||||
|
|
||||||
@Synchronized("toRemove")
|
@Synchronized("toRemove")
|
||||||
public void removeHIDDevice(NetworkHIDDevice device) {
|
public void removeHIDDevice(NetworkHIDDevice device) {
|
||||||
device.sendDetach();
|
device.sendDetach();
|
||||||
@ -81,8 +83,8 @@ public class NetworkManager implements Runnable{
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
proccessCommands();
|
proccessCommands();
|
||||||
Utilities.sleep(Settings.getProcessCmdInterval());
|
Utilities.sleep(Settings.PROCESS_CMD_INTERVAL);
|
||||||
if(i++ > Settings.getPingInterval() / Settings.getProcessCmdInterval()){
|
if (i++ > Settings.PING_INTERVAL / Settings.PROCESS_CMD_INTERVAL) {
|
||||||
ping();
|
ping();
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
@ -95,7 +97,9 @@ public class NetworkManager implements Runnable{
|
|||||||
|
|
||||||
public void proccessCommands() {
|
public void proccessCommands() {
|
||||||
List<DeviceCommand> commands = new ArrayList<DeviceCommand>();
|
List<DeviceCommand> commands = new ArrayList<DeviceCommand>();
|
||||||
commands.addAll(ownCommands); //TODO: Does this need a synchronized block? It _should_ be only access from this thread. Need to think about it
|
commands.addAll(ownCommands); // TODO: Does this need a synchronized
|
||||||
|
// block? It _should_ be only access from
|
||||||
|
// this thread. Need to think about it
|
||||||
ownCommands.clear();
|
ownCommands.clear();
|
||||||
synchronized (toRemove) {
|
synchronized (toRemove) {
|
||||||
synchronized (devices) {
|
synchronized (devices) {
|
||||||
@ -152,7 +156,7 @@ public class NetworkManager implements Runnable{
|
|||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Utilities.sleep(Settings.getSendingCmdSleepIfNotConnected());
|
Utilities.sleep(Settings.SENDING_CMD_SLEEP_IF_NOT_CONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the command again on errors
|
// Add the command again on errors
|
||||||
|
@ -48,34 +48,24 @@ public class Protocol {
|
|||||||
|
|
||||||
public static final byte UDP_CMD_DATA = 0x03;
|
public static final byte UDP_CMD_DATA = 0x03;
|
||||||
|
|
||||||
|
|
||||||
public static final byte TCP_CMD_ATTACH_CONFIG_FOUND = (byte) 0xE0;
|
public static final byte TCP_CMD_ATTACH_CONFIG_FOUND = (byte) 0xE0;
|
||||||
public static final byte TCP_CMD_ATTACH_CONFIG_NOT_FOUND = (byte) 0xE1;
|
public static final byte TCP_CMD_ATTACH_CONFIG_NOT_FOUND = (byte) 0xE1;
|
||||||
public static final byte TCP_CMD_ATTACH_USERDATA_OKAY = (byte) 0xE8;
|
public static final byte TCP_CMD_ATTACH_USERDATA_OKAY = (byte) 0xE8;
|
||||||
public static final byte TCP_CMD_ATTACH_USERDATA_BAD = (byte) 0xE9;
|
public static final byte TCP_CMD_ATTACH_USERDATA_BAD = (byte) 0xE9;
|
||||||
|
|
||||||
private Protocol(){}
|
private Protocol() {
|
||||||
|
}
|
||||||
|
|
||||||
public enum HandshakeReturnCode {
|
public enum HandshakeReturnCode {
|
||||||
BAD_HANDSHAKE,
|
BAD_HANDSHAKE, SAME_CLIENT, NEW_CLIENT
|
||||||
SAME_CLIENT,
|
|
||||||
NEW_CLIENT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] getRawAttachDataToSend(AttachCommand command) throws IOException {
|
public static byte[] getRawAttachDataToSend(AttachCommand command) throws IOException {
|
||||||
return ByteBuffer.allocate(9)
|
return ByteBuffer.allocate(9).put(Protocol.TCP_CMD_ATTACH).putInt(command.getHandle()).putShort(command.getVid()).putShort(command.getPid()).array();
|
||||||
.put(Protocol.TCP_CMD_ATTACH)
|
|
||||||
.putInt(command.getHandle())
|
|
||||||
.putShort(command.getVid())
|
|
||||||
.putShort(command.getPid())
|
|
||||||
.array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] getRawDetachDataToSend(DetachCommand command) throws IOException {
|
public static byte[] getRawDetachDataToSend(DetachCommand command) throws IOException {
|
||||||
return ByteBuffer.allocate(5)
|
return ByteBuffer.allocate(5).put(Protocol.TCP_CMD_DETACH).putInt(command.getHandle()).array();
|
||||||
.put(Protocol.TCP_CMD_DETACH)
|
|
||||||
.putInt(command.getHandle())
|
|
||||||
.array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] getRawPingDataToSend(PingCommand command) {
|
public static byte[] getRawPingDataToSend(PingCommand command) {
|
||||||
|
@ -44,8 +44,7 @@ public class TCPClient {
|
|||||||
private DataOutputStream out;
|
private DataOutputStream out;
|
||||||
@Getter private int clientID = HandleFoundry.next();
|
@Getter private int clientID = HandleFoundry.next();
|
||||||
|
|
||||||
@Getter @Setter(AccessLevel.PRIVATE)
|
@Getter @Setter(AccessLevel.PRIVATE) private int shouldRetry = Settings.MAXIMUM_TRIES_FOR_RECONNECTING;
|
||||||
private int shouldRetry = Settings.getMaxTriesForReconnecting();
|
|
||||||
|
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
@ -65,7 +64,9 @@ public class TCPClient {
|
|||||||
throw new Exception();
|
throw new Exception();
|
||||||
} else {
|
} else {
|
||||||
if (resultHandshake == HandshakeReturnCode.NEW_CLIENT && this.ip != null) {
|
if (resultHandshake == HandshakeReturnCode.NEW_CLIENT && this.ip != null) {
|
||||||
//We check the IP to be sure it's the first time we connect to a WiiU. //TODO: Sending a ID from the WiiU which will be compared?
|
// We check the IP to be sure it's the first time we connect to
|
||||||
|
// a WiiU. //TODO: Sending a ID from the WiiU which will be
|
||||||
|
// compared?
|
||||||
// we are new to the client.
|
// we are new to the client.
|
||||||
ActiveControllerManager.getInstance().attachAllActiveControllers();
|
ActiveControllerManager.getInstance().attachAllActiveControllers();
|
||||||
} else if (resultHandshake == HandshakeReturnCode.SAME_CLIENT) {
|
} else if (resultHandshake == HandshakeReturnCode.SAME_CLIENT) {
|
||||||
@ -86,7 +87,7 @@ public class TCPClient {
|
|||||||
|
|
||||||
public synchronized boolean abort() {
|
public synchronized boolean abort() {
|
||||||
try {
|
try {
|
||||||
shouldRetry = Settings.getMaxTriesForReconnecting();
|
shouldRetry = Settings.MAXIMUM_TRIES_FOR_RECONNECTING;
|
||||||
sock.close();
|
sock.close();
|
||||||
clientID = HandleFoundry.next();
|
clientID = HandleFoundry.next();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -102,9 +103,11 @@ public class TCPClient {
|
|||||||
out.flush();
|
out.flush();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
try {
|
try {
|
||||||
if(shouldRetry++ < Settings.getMaxTriesForReconnecting()){
|
if (shouldRetry++ < Settings.MAXIMUM_TRIES_FOR_RECONNECTING) {
|
||||||
System.out.println("Trying again to connect! Attempt number " + shouldRetry);
|
System.out.println("Trying again to connect! Attempt number " + shouldRetry);
|
||||||
connect(ip); //TODO: this is for reconnecting when the WiiU switches the application. But this breaks disconnecting, woops.
|
connect(ip); // TODO: this is for reconnecting when the WiiU
|
||||||
|
// switches the application. But this breaks
|
||||||
|
// disconnecting, woops.
|
||||||
} else {
|
} else {
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
@ -142,6 +145,6 @@ public class TCPClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isShouldRetry() {
|
public boolean isShouldRetry() {
|
||||||
return this.shouldRetry < Settings.getMaxTriesForReconnecting();
|
return this.shouldRetry < Settings.MAXIMUM_TRIES_FOR_RECONNECTING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ public class UDPClient {
|
|||||||
sock = new DatagramSocket();
|
sock = new DatagramSocket();
|
||||||
host = InetAddress.getByName(ip);
|
host = InetAddress.getByName(ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UDPClient createUDPClient(String ip) {
|
public static UDPClient createUDPClient(String ip) {
|
||||||
UDPClient result = null;
|
UDPClient result = null;
|
||||||
try {
|
try {
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package net.ash.HIDToVPADNetworkClient.network.commands;
|
package net.ash.HIDToVPADNetworkClient.network.commands;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.ash.HIDToVPADNetworkClient.network.NetworkHIDDevice;
|
import net.ash.HIDToVPADNetworkClient.network.NetworkHIDDevice;
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package net.ash.HIDToVPADNetworkClient.network.commands;
|
package net.ash.HIDToVPADNetworkClient.network.commands;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import net.ash.HIDToVPADNetworkClient.network.NetworkHIDDevice;
|
import net.ash.HIDToVPADNetworkClient.network.NetworkHIDDevice;
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ public class PingCommand extends DeviceCommand {
|
|||||||
public PingCommand() {
|
public PingCommand() {
|
||||||
this((short) 0, null);
|
this((short) 0, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PingCommand(int hidHandle, NetworkHIDDevice sender) {
|
private PingCommand(int hidHandle, NetworkHIDDevice sender) {
|
||||||
super(hidHandle, sender);
|
super(hidHandle, sender);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import net.ash.HIDToVPADNetworkClient.network.NetworkHIDDevice;
|
|||||||
|
|
||||||
public class ReadCommand extends DeviceCommand {
|
public class ReadCommand extends DeviceCommand {
|
||||||
@Getter private final byte[] data;
|
@Getter private final byte[] data;
|
||||||
|
|
||||||
public ReadCommand(int hidHandle, byte[] data, NetworkHIDDevice sender) {
|
public ReadCommand(int hidHandle, byte[] data, NetworkHIDDevice sender) {
|
||||||
super(hidHandle, sender);
|
super(hidHandle, sender);
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
@ -29,9 +29,10 @@ import java.util.Random;
|
|||||||
|
|
||||||
public class HandleFoundry {
|
public class HandleFoundry {
|
||||||
// We start with a random value, so we have at each startup a different clientID!
|
// We start with a random value, so we have at each startup a different clientID!
|
||||||
private static int h = new Random().nextInt();
|
private static int h = new Random().nextInt() % 10000;
|
||||||
|
|
||||||
private HandleFoundry(){}
|
private HandleFoundry() {
|
||||||
|
}
|
||||||
|
|
||||||
public static int next() {
|
public static int next() {
|
||||||
return h++;
|
return h++;
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
package net.ash.HIDToVPADNetworkClient.util;
|
package net.ash.HIDToVPADNetworkClient.util;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import purejavahidapi.HidDevice;
|
import purejavahidapi.HidDevice;
|
||||||
@ -30,29 +31,49 @@ import purejavahidapi.PureJavaHidApi;
|
|||||||
|
|
||||||
public class PureJavaHidApiManager {
|
public class PureJavaHidApiManager {
|
||||||
|
|
||||||
private PureJavaHidApiManager(){}
|
private PureJavaHidApiManager() {
|
||||||
|
}
|
||||||
public static boolean MAC_OS_X;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Searches the corresponding HIDDevice for the given path
|
* Searches the corresponding HIDDevice for the given path
|
||||||
* @param path Path of the HIDDevice
|
*
|
||||||
|
* @param path
|
||||||
|
* Path of the HIDDevice
|
||||||
* @return It the device is found, it will be returned. Otherwise null is returned.
|
* @return It the device is found, it will be returned. Otherwise null is returned.
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public static HidDevice getDeviceByPath(String path) throws IOException {
|
public static HidDevice getDeviceByPath(String path) throws IOException {
|
||||||
List<HidDeviceInfo> devList = PureJavaHidApi.enumerateDevices();
|
List<HidDeviceInfo> devList = PureJavaHidApi.enumerateDevices();
|
||||||
|
HidDevice result = null;
|
||||||
for (HidDeviceInfo info : devList) {
|
for (HidDeviceInfo info : devList) {
|
||||||
if (MAC_OS_X) {
|
result = openDeviceByPath(info, path);
|
||||||
if(info.getPath().substring(0, 13).equals(path)){
|
if (result != null) return result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static HidDevice openDeviceByPath(HidDeviceInfo info, String expected_path) throws IOException {
|
||||||
|
if (info == null) return null;
|
||||||
|
String real_path = info.getPath();
|
||||||
|
|
||||||
|
if (Settings.isMacOSX()) real_path = real_path.substring(0, 13);
|
||||||
|
|
||||||
|
if (real_path.equals(expected_path)){
|
||||||
return PureJavaHidApi.openDevice(info);
|
return PureJavaHidApi.openDevice(info);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if(info.getPath().equals(path)){
|
|
||||||
return PureJavaHidApi.openDevice(info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<HidDeviceInfo> getAttachedController() {
|
||||||
|
List<HidDeviceInfo> connectedGamepads = new ArrayList<HidDeviceInfo>();
|
||||||
|
|
||||||
|
for (HidDeviceInfo info : PureJavaHidApi.enumerateDevices()) {
|
||||||
|
if (info.getUsagePage() == 0x05 || info.getUsagePage() == 0x04 || (info.getVendorId() == 0x57e) || (info.getVendorId() == 0x054c)) {
|
||||||
|
connectedGamepads.add(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return connectedGamepads;
|
||||||
|
}
|
||||||
}
|
}
|
@ -26,38 +26,34 @@ import java.io.FileInputStream;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import lombok.extern.java.Log;
|
import lombok.extern.java.Log;
|
||||||
|
import net.ash.HIDToVPADNetworkClient.controller.Controller.ControllerType;
|
||||||
|
import net.ash.HIDToVPADNetworkClient.util.Settings.Platform;
|
||||||
|
|
||||||
//TODO autosave IP addr
|
//TODO autosave IP addr
|
||||||
|
|
||||||
@Log
|
@Log
|
||||||
public class Settings {
|
public class Settings {
|
||||||
private static final String CONFIG_FILE_NAME = "config.properties";
|
private static final String CONFIG_FILE_NAME = "hidtovpad.properties";
|
||||||
|
|
||||||
@Getter
|
public static final int DETECT_CONTROLLER_INTERVAL = 1000;
|
||||||
private static int detectControllerInterval = 1000;
|
public static final int HANDLE_INPUTS_INTERVAL = 15;
|
||||||
@Getter
|
public static final int MAXIMUM_TRIES_FOR_RECONNECTING = 10;
|
||||||
private static int handleInputsInterval = 15;
|
public static final int SLEEP_AFER_POLLING = 10;
|
||||||
@Getter
|
public static final int SENDING_CMD_SLEEP_IF_NOT_CONNECTED = 500;
|
||||||
private static int maxTriesForReconnecting = 10;
|
public static final int PING_INTERVAL = 1000;
|
||||||
@Getter
|
public static final int PROCESS_CMD_INTERVAL = 10;
|
||||||
private static int sleepAfterPolling = 10;
|
|
||||||
/**
|
|
||||||
* What does this even mean?
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
private static int sendingCmdSleepIfNotConnected = 500;
|
|
||||||
@Getter
|
|
||||||
private static int pingInterval = 1000;
|
|
||||||
@Getter
|
|
||||||
private static int processCmdInterval = 10;
|
|
||||||
@Getter
|
|
||||||
private static String ipAddr = "192.168.0.35"; //@Maschell, you're welcome
|
|
||||||
|
|
||||||
private Settings() {}
|
@Getter @Setter private static String ipAddr = "192.168.0.35"; // @Maschell, you're welcome
|
||||||
|
|
||||||
|
private Settings() {
|
||||||
|
}
|
||||||
|
|
||||||
public static void loadSettings() {
|
public static void loadSettings() {
|
||||||
File configDir = new File(getConfigDir());
|
File configDir = new File(getConfigDir());
|
||||||
@ -65,7 +61,7 @@ public class Settings {
|
|||||||
log.info("Creating " + configDir.getAbsolutePath() + "...");
|
log.info("Creating " + configDir.getAbsolutePath() + "...");
|
||||||
configDir.mkdirs();
|
configDir.mkdirs();
|
||||||
}
|
}
|
||||||
File configFile = new File(getConfigDir() + CONFIG_FILE_NAME);
|
File configFile = getConfigFile();
|
||||||
if (!configFile.exists()) {
|
if (!configFile.exists()) {
|
||||||
log.info("Creating " + configFile.getAbsolutePath() + " with default values...");
|
log.info("Creating " + configFile.getAbsolutePath() + " with default values...");
|
||||||
try {
|
try {
|
||||||
@ -88,55 +84,29 @@ public class Settings {
|
|||||||
log.severe("Error while loading config file!");
|
log.severe("Error while loading config file!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.warning("Using default values");
|
log.warning("Using default values");
|
||||||
}
|
|
||||||
|
|
||||||
String s_detectControllerInterval = prop.getProperty("detectControllerInterval");
|
|
||||||
String s_handleInputsInterval = prop.getProperty("handleInputsInterval");
|
|
||||||
String s_maxTriesForReconnecting = prop.getProperty("maxTriesForReconnecting");
|
|
||||||
String s_sleepAfterPolling = prop.getProperty("sleepAfterPolling");
|
|
||||||
String s_sendingCmdSleepIfNotConnected = prop.getProperty("sendingCmdSleepIfNotConnected");
|
|
||||||
String s_pingInterval = prop.getProperty("pingInterval");
|
|
||||||
String s_processCmdInterval = prop.getProperty("processCmdInterval");
|
|
||||||
String s_ipAddr = prop.getProperty("ipAddr");
|
|
||||||
|
|
||||||
int detectControllerInterval, handleInputsInterval, maxTriesForReconnecting, sleepAfterPolling, sendingCmdSleepIfNotConnected, pingInterval, processCmdInterval;
|
|
||||||
|
|
||||||
try {
|
|
||||||
detectControllerInterval = Integer.parseInt(s_detectControllerInterval);
|
|
||||||
handleInputsInterval = Integer.parseInt(s_handleInputsInterval);
|
|
||||||
maxTriesForReconnecting = Integer.parseInt(s_maxTriesForReconnecting);
|
|
||||||
sleepAfterPolling = Integer.parseInt(s_sleepAfterPolling);
|
|
||||||
sendingCmdSleepIfNotConnected = Integer.parseInt(s_sendingCmdSleepIfNotConnected);
|
|
||||||
pingInterval = Integer.parseInt(s_pingInterval);
|
|
||||||
processCmdInterval = Integer.parseInt(s_processCmdInterval);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
log.warning("Config file contains invalid values!");
|
|
||||||
log.warning("Reconstructing...");
|
|
||||||
saveSettings(configFile);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings.detectControllerInterval = detectControllerInterval;
|
Settings.ipAddr = prop.getProperty("ipAddr");
|
||||||
Settings.handleInputsInterval = handleInputsInterval;
|
|
||||||
Settings.maxTriesForReconnecting = maxTriesForReconnecting;
|
|
||||||
Settings.sleepAfterPolling = sleepAfterPolling;
|
|
||||||
Settings.sendingCmdSleepIfNotConnected = sendingCmdSleepIfNotConnected;
|
|
||||||
Settings.pingInterval = pingInterval;
|
|
||||||
Settings.processCmdInterval = processCmdInterval;
|
|
||||||
Settings.ipAddr = s_ipAddr;
|
|
||||||
|
|
||||||
log.info("Loaded config successfully!");
|
log.info("Loaded config successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static File getConfigFile() {
|
||||||
|
return new File(getConfigDir() + CONFIG_FILE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveSettings() {
|
||||||
|
File configFile = getConfigFile();
|
||||||
|
if (configFile.exists()) {
|
||||||
|
log.info("Settings saved.");
|
||||||
|
saveSettings(configFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void saveSettings(File configFile) {
|
private static void saveSettings(File configFile) {
|
||||||
Properties prop = new Properties();
|
Properties prop = new Properties();
|
||||||
prop.setProperty("detectControllerInterval", Integer.toString(Settings.detectControllerInterval));
|
|
||||||
prop.setProperty("handleInputsInterval", Integer.toString(Settings.handleInputsInterval));
|
|
||||||
prop.setProperty("maxTriesForReconnecting", Integer.toString(Settings.maxTriesForReconnecting));
|
|
||||||
prop.setProperty("sleepAfterPolling", Integer.toString(Settings.sleepAfterPolling));
|
|
||||||
prop.setProperty("sendingCmdSleepIfNotConnected", Integer.toString(Settings.sendingCmdSleepIfNotConnected));
|
|
||||||
prop.setProperty("pingInterval", Integer.toString(Settings.pingInterval));
|
|
||||||
prop.setProperty("processCmdInterval", Integer.toString(Settings.processCmdInterval));
|
|
||||||
prop.setProperty("ipAddr", Settings.ipAddr);
|
prop.setProperty("ipAddr", Settings.ipAddr);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -157,13 +127,35 @@ public class Settings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String getConfigDir() {
|
private static String getConfigDir() {
|
||||||
|
return "config/";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isLinux() {
|
||||||
|
return getPlattform() == Platform.LINUX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isWindows() {
|
||||||
|
return getPlattform() == Platform.WINDOWS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMacOSX() {
|
||||||
|
return getPlattform() == Platform.MAC_OS_X;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Platform getPlattform() {
|
||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
if (os.contains("Windows")) {
|
|
||||||
return System.getenv("APPDATA") + "/HIDToVPADNetworkClient/";
|
if (os.contains("Linux")) {
|
||||||
|
return Platform.LINUX;
|
||||||
|
} else if (os.contains("Windows")) {
|
||||||
|
return Platform.WINDOWS;
|
||||||
} else if (os.contains("Mac OS X")) {
|
} else if (os.contains("Mac OS X")) {
|
||||||
return System.getProperty("user.home") + "/Library/Application Support/HIDToVPADNetworkClient/";
|
return Platform.MAC_OS_X;
|
||||||
} else { //Linux
|
}
|
||||||
return System.getProperty("user.home") + "/.config/HIDToVPADNetworkClient/";
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum Platform {
|
||||||
|
LINUX, WINDOWS, MAC_OS_X, UNKNOWN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,11 +23,14 @@ package net.ash.HIDToVPADNetworkClient.util;
|
|||||||
|
|
||||||
public class Utilities {
|
public class Utilities {
|
||||||
|
|
||||||
private Utilities(){}
|
private Utilities() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Let me just sleep!
|
* Let me just sleep!
|
||||||
* @param ms sleep duration in ms
|
*
|
||||||
|
* @param ms
|
||||||
|
* sleep duration in ms
|
||||||
*/
|
*/
|
||||||
public static void sleep(int ms) {
|
public static void sleep(int ms) {
|
||||||
try {
|
try {
|
||||||
@ -38,7 +41,9 @@ public class Utilities{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a byte array to a formated String
|
* Convert a byte array to a formated String
|
||||||
* @param ba byte array
|
*
|
||||||
|
* @param ba
|
||||||
|
* byte array
|
||||||
* @return String representing the binary data
|
* @return String representing the binary data
|
||||||
*/
|
*/
|
||||||
public static String ByteArrayToString(byte[] ba) {
|
public static String ByteArrayToString(byte[] ba) {
|
||||||
@ -52,7 +57,9 @@ public class Utilities{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a signed short value to a unsigned byte
|
* Converts a signed short value to a unsigned byte
|
||||||
* @param value short value
|
*
|
||||||
|
* @param value
|
||||||
|
* short value
|
||||||
* @return converted value
|
* @return converted value
|
||||||
*/
|
*/
|
||||||
public static short signedShortToByte(int value) {
|
public static short signedShortToByte(int value) {
|
||||||
@ -61,7 +68,9 @@ public class Utilities{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a signed short value to a unsigned byte
|
* Converts a signed short value to a unsigned byte
|
||||||
* @param value short value
|
*
|
||||||
|
* @param value
|
||||||
|
* short value
|
||||||
* @return converted value
|
* @return converted value
|
||||||
*/
|
*/
|
||||||
public static short signedShortToByte(short value) {
|
public static short signedShortToByte(short value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user