libs: Add smohook for getting cmdline opts
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <opts.h>
|
||||
#include <componentThread.h>
|
||||
#include "broadcastListener.h"
|
||||
#include "core.h"
|
||||
|
||||
namespace livoxProto1 {
|
||||
namespace comms {
|
||||
@@ -96,7 +97,7 @@ void BroadcastListener::broadcastMsgInd(
|
||||
if (deviceExists(broadcastCode))
|
||||
{
|
||||
// Device already exists, just log the update
|
||||
if (OptionParser::getOptions().verbose)
|
||||
if (getProtoState().smoCallbacks.OptionParser_getOptions().verbose)
|
||||
{
|
||||
std::cout << __func__
|
||||
<< ": Received broadcast from known device: "
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
|
||||
// Connection successful, add device to collection
|
||||
context->deviceManager.devices.push_back(context->pendingDevice);
|
||||
if (OptionParser::getOptions().verbose)
|
||||
if (getProtoState().smoCallbacks.OptionParser_getOptions().verbose)
|
||||
{
|
||||
std::cout << __func__ << ": Successfully connected and added device "
|
||||
<< context->pendingDevice->discoveredDevice.deviceIdentifier
|
||||
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
// Fail early - if handshake failed, try next method
|
||||
if (!success)
|
||||
{
|
||||
if (OptionParser::getOptions().verbose)
|
||||
if (getProtoState().smoCallbacks.OptionParser_getOptions().verbose)
|
||||
{
|
||||
std::cout << __func__ << ": Trying to connect to device by "
|
||||
<< "identifier" << "\n";
|
||||
@@ -222,7 +222,7 @@ void Device::connectReq(smo::Callback<Device::connectReqCbFn> callback)
|
||||
auto request = std::make_shared<ConnectReq>(*this, std::move(callback));
|
||||
|
||||
// Try connecting to known device first
|
||||
if (OptionParser::getOptions().verbose) {
|
||||
if (getProtoState().smoCallbacks.OptionParser_getOptions().verbose) {
|
||||
std::cout << __func__ << ": Trying to connect to known device" << "\n";
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ void Device::connectToKnownDeviceReq(
|
||||
return;
|
||||
}
|
||||
|
||||
if (OptionParser::getOptions().verbose)
|
||||
if (getProtoState().smoCallbacks.OptionParser_getOptions().verbose)
|
||||
{
|
||||
std::cout << __func__ << ": Detected SMO listening IP for known device "
|
||||
<< request->device.discoveredDevice.deviceIdentifier
|
||||
@@ -402,7 +402,7 @@ void Device::connectByDeviceIdentifierReq(
|
||||
// For heuristic construction, always use the provided smoIp.
|
||||
request->device.detectedSmoListeningIp = request->device.smoIp;
|
||||
|
||||
if (OptionParser::getOptions().verbose)
|
||||
if (getProtoState().smoCallbacks.OptionParser_getOptions().verbose)
|
||||
{
|
||||
std::cout << __func__ << ": About to try to connect to device by "
|
||||
<< "identifier (" << discoveredDevice.deviceIdentifier << ")"
|
||||
@@ -720,7 +720,7 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
if (OptionParser::getOptions().verbose)
|
||||
if (getProtoState().smoCallbacks.OptionParser_getOptions().verbose)
|
||||
{
|
||||
std::cout << __func__ << ": Handshake successful with "
|
||||
<< deviceIP << "("
|
||||
@@ -1512,7 +1512,7 @@ protected:
|
||||
response->command.cmd_id == 0x04 &&
|
||||
response->ret_code == 0x00))
|
||||
{
|
||||
if (OptionParser::getOptions().verbose)
|
||||
if (getProtoState().smoCallbacks.OptionParser_getOptions().verbose)
|
||||
{
|
||||
std::cout << __func__ << ": Failed to en/disable pcloud data "
|
||||
"for device "
|
||||
|
||||
Reference in New Issue
Block a user