forked from f1xpl/openauto
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate out reusable logic for handling the bluetooth wifi connect.
- Loading branch information
1 parent
b5ba8ad
commit dd65bef
Showing
5 changed files
with
219 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
#include <google/protobuf/message_lite.h> | ||
#include "IBluetoothManager.hpp" | ||
#include "autoapp/Configuration/IConfiguration.hpp" | ||
|
||
class BluetoothConnection { | ||
public: | ||
BluetoothConnection(std::string SSID, std::string Password, std::string IpAddress, std::string MacAddress, uint32_t Port); | ||
void messageHandler(); | ||
void sendMessage(google::protobuf::MessageLite &message, IBluetoothManager::wifiMessages type); | ||
void handleWifiInfoRequest(); | ||
void handleWifiSecurityRequest(__attribute__((unused)) uint8_t *buffer, __attribute__((unused)) uint16_t length); | ||
static int handleWifiInfoRequestResponse(uint8_t *buffer, uint16_t length); | ||
|
||
protected: | ||
std::string ipAddress; | ||
std::string macAddress; | ||
std::string ssid; | ||
std::string password; | ||
uint32_t port; | ||
|
||
virtual ssize_t read(char *buf, ssize_t size) = 0; | ||
virtual ssize_t write(char *buf, ssize_t size) = 0; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.