I'd like to refactor some of the modules in this project and because of the mockBluetooth (#5) I've decided that the beagleblue module is a good place to start.
Since there might be additional bluetooth connections in the future we need a data structure to hold all the information pertaining to a connection (android, glass, arduinio, etc). This will probably take the form of a struct array. With this we can eliminate a few of the functions that have nearly identical operations (beagleblue_android_send, beagleblue_glass_send, etc). The function beagleblue_set_mode the function socket() can be replaced with hci_open_dev as stated in #9. Also some of the names can be fixed so that they reflect the coding style outlined on the wikiNote: do not make changes until we have a testable system.
[x] create data structure to hold bluetooth connection info
[x] refactor functions to use data structure
[ ] eliminate duplicate functions
[ ] #8
[ ] switch socket() in beagleblue_set_mode() to hci_open_dev()
creating a data structure to hold the bluetooth connection,
refactroring beagleblue to use this new data structure,
and making beagleblue_set_mode() public
were all fixed in pull request #40
I'd like to refactor some of the modules in this project and because of the mockBluetooth (#5) I've decided that the beagleblue module is a good place to start. Since there might be additional bluetooth connections in the future we need a data structure to hold all the information pertaining to a connection (android, glass, arduinio, etc). This will probably take the form of a struct array. With this we can eliminate a few of the functions that have nearly identical operations (beagleblue_android_send, beagleblue_glass_send, etc). The function beagleblue_set_mode the function socket() can be replaced with hci_open_dev as stated in #9. Also some of the names can be fixed so that they reflect the coding style outlined on the wiki Note: do not make changes until we have a testable system.
Related issues: #5 #8 #9 #22 #30