Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: interface for ESP wifi module added #1911

Merged
merged 1 commit into from
Aug 6, 2019

Conversation

neel1998
Copy link
Member

@neel1998 neel1998 commented Aug 6, 2019

Fixes #1891

Changes: User can connect to pslab using wifi

Screenshot/s for the changes:
20190806_161910

Checklist: [Please tick following check boxes with [x] if the respective task is completed]

  • I have used resources from strings.xml, dimens.xml and colors.xml without hard-coding them
  • No modifications done at the end of resource files strings.xml, dimens.xml or colors.xml
  • I have reformatted code in every file included in this PR [CTRL+ALT+L]
  • My code does not contain any extra lines or extra spaces
  • I have requested reviews from other members

APK for testing:
esp.zip

@CloudyPadmal the interface seems nice, Once the ESP server is implemented we can add further communication protocols.

@neel1998 neel1998 self-assigned this Aug 6, 2019
@CloudyPadmal
Copy link
Collaborator

Third time I'm seeing you closing and opening new PRs.

This PR is related to #1892

app/build.gradle Outdated
@@ -139,4 +139,5 @@ dependencies {
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'design'
}
implementation "com.squareup.okhttp3:okhttp:4.0.1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move where the other dependencies are and set version in config files.

@neel1998
Copy link
Member Author

neel1998 commented Aug 6, 2019

I am sorry but while trying out the BFG tool ... I had accidentally removed png and XML files from many of my local branches.. if made a new commit using the previous branch....All the png and XML would be again added to the commit. That's why I had to open another PR from new branch. Sorry for the inconvenience.

AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MainActivity.this);
LayoutInflater inflater = MainActivity.this.getLayoutInflater();
View dialogView = inflater.inflate(R.layout.bluetooth_wifi_dialog_layout, null);
dialogBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded

if (espIPAddress.length() == 0) {
Toast.makeText(getContext(), getResources().getString(R.string.incorrect_IP_address_message), Toast.LENGTH_SHORT).show();
} else {
espConnectProgressBar.setVisibility(View.VISIBLE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set in onPreExecute

params.width = ViewGroup.LayoutParams.MATCH_PARENT;
getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
}
private class ESPTask extends AsyncTask<Void, Void, String> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reformat the whole code to add proper indents and spaces. Should be quiet obvious by now.

@@ -18,12 +18,16 @@
<string name="pslab_pinlayout_front">Pin Layout Front</string>
<string name="pslab_pinlayout_back">Pin Layout Back</string>
<string name="bluetooth_connect_menu">Bluetooth Connection</string>
<string name="bluetooth_scan_dialog">USB device not found. Do you want to scan for Bluetooth Connection?</string>

<string name="bluetooth_wifi_scan_dialog">USB device not found. Do you want to scan for Bluetooth or Wifi Connection?</string>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connection -> connection

<string name="bluetooth_scan_dialog">USB device not found. Do you want to scan for Bluetooth Connection?</string>

<string name="bluetooth_wifi_scan_dialog">USB device not found. Do you want to scan for Bluetooth or Wifi Connection?</string>
<string name="bluetooth">Bluetooh</string>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bluetooth

@CloudyPadmal
Copy link
Collaborator

I am sorry but while trying out the BFG tool ... I had accidentally removed png and XML files from many of my local branches.. if made a new commit using the previous branch....All the png and XML would be again added to the commit. That's why I had to open another PR from new branch. Sorry for the inconvenience.

Thing is, when you're making new PRs closing older ones, whole conversations are gone. All the discussions, changes requested; just gone.

Whatever the issue you're having with your local branch, fix it before making any more PRs.

@neel1998
Copy link
Member Author

neel1998 commented Aug 6, 2019

I am sorry but while trying out the BFG tool ... I had accidentally removed png and XML files from many of my local branches.. if made a new commit using the previous branch....All the png and XML would be again added to the commit. That's why I had to open another PR from new branch. Sorry for the inconvenience.

Thing is, when you're making new PRs closing older ones, whole conversations are gone. All the discussions, changes requested; just gone.

Whatever the issue you're having with your local branch, fix it before making any more PRs.

I totally understand your point. And I was using the tool for the first time so made such mistake. Again really sorry for this, won't happen again.

@CloudyPadmal CloudyPadmal added the Status: Review Required Requested reviews from peers and maintainers label Aug 6, 2019
@cweitat cweitat merged commit 8a568ec into fossasia:development Aug 6, 2019
@neel1998 neel1998 added this to the Milestone 11 : Summer 2019 milestone Aug 8, 2019
@CloudyPadmal CloudyPadmal added Feature New addition to the existing app and removed Status: Review Required Requested reviews from peers and maintainers labels Aug 8, 2019
@CloudyPadmal CloudyPadmal changed the title interface for ESP wifi module added feat: interface for ESP wifi module added Aug 8, 2019
@CloudyPadmal CloudyPadmal removed this from the Milestone 11 : Summer 2019 milestone Aug 15, 2019
@neel1998 neel1998 deleted the esp_wifi2 branch August 27, 2019 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New addition to the existing app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add feature to connect to PSLab over wifi using ESP module
3 participants