Merge remote-tracking branch 'origin/development'

pull/1/head
Kevin Abraham 2019-07-04 13:23:48 -04:00
commit 68bd1d8c00
7 changed files with 55 additions and 1 deletions

View File

@ -18,6 +18,8 @@
syntax="proto2";
option optimize_for=SPEED;
import "SensorChannelData.proto";
import "AVChannelData.proto";
import "InputChannelData.proto";
@ -26,6 +28,7 @@ import "BluetoothChannelData.proto";
import "NavigationChannelData.proto";
import "VendorExtensionChannelData.proto";
import "MediaChannelData.proto";
import "WifiChannelData.proto";
package gb.xxy.trial.proto.data;
@ -40,4 +43,5 @@ message ChannelDescriptor
optional NavigationChannel navigation_channel = 8;
optional MediaInfoChannel media_infoChannel = 9;
optional VendorExtensionChannel vendor_extension_channel = 12;
optional WifiChannel wifi_channel=16;
}

View File

@ -0,0 +1,30 @@
/*
* This file is part of aasdk library project.
* Copyright (C) 2018 f1x.studio (Michal Szwaj)
*
* aasdk is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* aasdk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with aasdk. If not, see <http://www.gnu.org/licenses/>.
*/
syntax="proto3";
option optimize_for=SPEED;
package gb.xxy.hr.proto.data;
message WifiChannel
{
string ssid = 1;
}

View File

@ -22,6 +22,7 @@
#include <aasdk_proto/AVChannelStartIndicationMessage.pb.h>
#include <aasdk_proto/ChannelOpenRequestMessage.pb.h>
#include <aasdk_proto/VideoFocusRequestMessage.pb.h>
#include <aasdk_proto/AVChannelStopIndicationMessage.pb.h>
#include <f1x/aasdk/Messenger/Timestamp.hpp>
#include <f1x/aasdk/Common/Data.hpp>
#include <f1x/aasdk/Error/Error.hpp>
@ -46,6 +47,7 @@ public:
virtual void onChannelOpenRequest(const proto::messages::ChannelOpenRequest& request) = 0;
virtual void onAVChannelSetupRequest(const proto::messages::AVChannelSetupRequest& request) = 0;
virtual void onAVChannelStartIndication(const proto::messages::AVChannelStartIndication& indication) = 0;
virtual void onAVChannelStopIndication(const proto::messages::AVChannelStopIndication& indication) = 0;
virtual void onAVMediaWithTimestampIndication(messenger::Timestamp::ValueType, const common::DataConstBuffer& buffer) = 0;
virtual void onAVMediaIndication(const common::DataConstBuffer& buffer) = 0;
virtual void onVideoFocusRequest(const proto::messages::VideoFocusRequest& request) = 0;

View File

@ -47,6 +47,7 @@ private:
void messageHandler(messenger::Message::Pointer message, IVideoServiceChannelEventHandler::Pointer eventHandler);
void handleAVChannelSetupRequest(const common::DataConstBuffer& payload, IVideoServiceChannelEventHandler::Pointer eventHandler);
void handleStartIndication(const common::DataConstBuffer& payload, IVideoServiceChannelEventHandler::Pointer eventHandler);
void handleStopIndication(const common::DataConstBuffer& payload, IVideoServiceChannelEventHandler::Pointer eventHandler);
void handleChannelOpenRequest(const common::DataConstBuffer& payload, IVideoServiceChannelEventHandler::Pointer eventHandler);
void handleVideoFocusRequest(const common::DataConstBuffer& payload, IVideoServiceChannelEventHandler::Pointer eventHandler);
void handleAVMediaWithTimestampIndication(const common::DataConstBuffer& payload, IVideoServiceChannelEventHandler::Pointer eventHandler);

View File

@ -101,6 +101,9 @@ void VideoServiceChannel::messageHandler(messenger::Message::Pointer message, IV
case proto::ids::AVChannelMessage::START_INDICATION:
this->handleStartIndication(payload, std::move(eventHandler));
break;
case proto::ids::AVChannelMessage::STOP_INDICATION:
this->handleStopIndication(payload, std::move(eventHandler));
break;
case proto::ids::AVChannelMessage::AV_MEDIA_WITH_TIMESTAMP_INDICATION:
this->handleAVMediaWithTimestampIndication(payload, std::move(eventHandler));
break;
@ -146,6 +149,19 @@ void VideoServiceChannel::handleStartIndication(const common::DataConstBuffer& p
}
}
void VideoServiceChannel::handleStopIndication(const common::DataConstBuffer& payload, IVideoServiceChannelEventHandler::Pointer eventHandler)
{
proto::messages::AVChannelStopIndication indication;
if(indication.ParseFromArray(payload.cdata, payload.size))
{
eventHandler->onAVChannelStopIndication(indication);
}
else
{
eventHandler->onChannelError(error::Error(error::ErrorCode::PARSE_PAYLOAD));
}
}
void VideoServiceChannel::handleChannelOpenRequest(const common::DataConstBuffer& payload, IVideoServiceChannelEventHandler::Pointer eventHandler)
{
proto::messages::ChannelOpenRequest request;

View File

@ -51,6 +51,7 @@ void TCPWrapper::asyncConnect(boost::asio::ip::tcp::socket& socket, const std::s
boost::system::error_code TCPWrapper::connect(boost::asio::ip::tcp::socket& socket, const std::string& hostname, uint16_t port)
{
boost::system::error_code ec;
socket.set_option(boost::asio::ip::tcp::no_delay(true), ec);
socket.connect(boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(hostname), port), ec);
return ec;
}

View File

@ -108,7 +108,7 @@ void USBEndpoint::transfer(libusb_transfer *transfer, Promise::Pointer promise)
// guarantee that endpoint will live until all transfers are finished
if(self_ == nullptr)
{
self_ = self;
self_ = std::move(self);
}
transfers_.insert(std::make_pair(transfer, std::move(promise)));