More DAP WIP.

This commit is contained in:
Martín Lucas Golini
2024-12-17 22:01:49 -03:00
parent e4ee5f1c09
commit 8b2f178615
10 changed files with 243 additions and 111 deletions

View File

@@ -6,8 +6,21 @@ namespace ecode {
BusSocket::BusSocket( const Connection& connection ) : mConnection( connection ) {}
bool BusSocket::start() {
return mSocket.connect( IpAddress( mConnection.host ), mConnection.port ) ==
Socket::Status::Done;
bool res =
mSocket.connect( IpAddress( mConnection.host ), mConnection.port ) == Socket::Status::Done;
if ( res )
setState( State::Running );
return res;
}
bool BusSocket::close() {
if ( mState == State::Running ) {
mSocket.disconnect();
setState( State::Closed );
return true;
}
return false;
}
void BusSocket::startAsyncRead( ReadFn readFn ) {