Bluetext is a Windows console chat application that uses the low-level Winsock2 library for Bluetooth communication, written in C++.
Motivation
I was motivated to create this project because I wanted to learn C++. I have a tendency to envision grand projects that might be overly ambitious, but even if the final result isn’t perfect, I’ve gained a significant amount of knowledge and experience from it. With this project I've been able to explore and learn the inner workings of both C++ and Bluetooth communication using Winsock2, while providing a huge challenge to implement an actual functional application.
Structure
It’s designed in a single thread manner, with a continuous loop that manages user interaction and updates the ‘UI’ as needed. The core functionality revolves around:
- Initialization - Setting up the Winsock2 library and configuring Bluetooth sockets as either a server or client.
- User Interaction - Retrieving input from the console and displaying real-time events.
- Bluetooth Communication - Handling data transmission and receiving via Bluetooth sockets.
- Error Handling - Implementing basic error handling to handle potential errors gracefully, such as connection drops or invalid input.
Lessons Learned
- C++ Fundamentals - Working on this project deepened my knowledge and understanding of C++ concepts, including memory management and pointers.
- Networking Basics - Using sockets provided me with insights about how low level networking works, especially in the context of Bluetooth communication.
- Problem-Solving - Debugging and overcoming challenges, such as connection issues or handling data streams, enhanced my problem-solving skills.
Potential Improvements
- Security Features - Adding encryption to Bluetooth communications would ensure privacy to the users
- Error Handling - Adding better more concise error handling to provide detailed feedback and recovery options for common issues.
- Code Organization - Refactoring parts of the code like commands could improve readability and maintainability.