Skip to content

Commit

Permalink
Fixed IndexOutOfBoundsException when deleting.
Browse files Browse the repository at this point in the history
Added Readme.
  • Loading branch information
tunjid committed Mar 12, 2017
1 parent bd91561 commit 210829c
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,6 @@ private class DeletionHandler extends Snackbar.Callback implements View.OnClickL

@Override
public void onDismissed(Snackbar snackbar, int event) {
if (!deletedItems.isEmpty() && switches.size() != originalListSize) {
switches.remove(originalPosition);
switchList.getAdapter().notifyItemRemoved(originalPosition);
}
isDeleting = false;
saveSwitches();
}
Expand Down
Binary file added breadboard.fzz
Binary file not shown.
35 changes: 35 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
BLE RC Switch Control
=======

### About

This Project contains an Android app and an Arduino sketch to sniff 433/315Mhz device codes
from a remote, and reproduce the same codes, essentially replacing the remote.

### The Arduino GATT Server

The Arduino GATT server is comprised of:

1. An Arduino Mega
2. The BLE112 Module from Silicon Labs
3. A Generic RF Receiver
4. A Generic RF Transmitter

An Arduino Mega, while not necessary is preferred because of the avaialabilty of more than 1 hardware serial.
An Uno is fine provided debug messages are fed to a software serial, but the BLE communication should always use a hardware serial
as it is way more Reliable.

### The Android GATT Client

The Android GATT client provides a convenient UI for the server. After following the prompts to
a connect to a Arduino server, the app will automatically attempt to connect to it whenever it is within range.

The app assumes the switches it controls has 2 states, ON and OFF. To Create a switch, the app prompts a user to sniff the ON code and OFF code
consecutively, after which a switch will be created with a UI to toggle between the ON and OFF states. Once a switch is created, it is persisted
in the app unless it is deleted with a swipe on the UI. Long pressing a switch brings up a dialog to rename the switch.

![alt text](http://i.imgur.com/MnurD22.png "Connections")




0 comments on commit 210829c

Please sign in to comment.