Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
App_Technologies
portabledsb
Commits
166462a9
Commit
166462a9
authored
Dec 30, 2015
by
Brendan Long
Browse files
Convert AllJoyn errors to strings before printing.
parent
e9166608
Changes
4
Hide whitespace changes
Inline
Side-by-side
Bridge/Bridge.cpp
View file @
166462a9
...
...
@@ -46,7 +46,7 @@ bridge::DeviceSystemBridge::Initialize()
st
=
AllJoynInit
();
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to initialize AllJoyn:
0x%x"
,
st
);
DSBLOG_WARN
(
"Failed to initialize AllJoyn:
%s"
,
QCC_StatusText
(
st
)
)
;
goto
Leave
;
}
m_alljoynInitialized
=
true
;
...
...
@@ -77,7 +77,7 @@ bridge::DeviceSystemBridge::InitializeInternal()
st
=
InitializeAdapter
();
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to intialize adapter:
0x%x"
,
st
);
DSBLOG_WARN
(
"Failed to intialize adapter:
%s"
,
QCC_StatusText
(
st
)
)
;
goto
Leave
;
}
...
...
@@ -90,14 +90,14 @@ bridge::DeviceSystemBridge::InitializeInternal()
st
=
InitializeDevices
();
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to initialize devices:
0x%x"
,
st
);
DSBLOG_WARN
(
"Failed to initialize devices:
%s"
,
QCC_StatusText
(
st
)
)
;
goto
Leave
;
}
st
=
RegisterAdapterSignalHandlers
(
true
);
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to register adapter signal handlers:
0x%x"
,
st
);
DSBLOG_WARN
(
"Failed to register adapter signal handlers:
%s"
,
QCC_StatusText
(
st
)
)
;
goto
Leave
;
}
...
...
@@ -113,7 +113,7 @@ bridge::DeviceSystemBridge::Shutdown()
st
=
ShutdownInternal
();
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"failed to shutdown internal:
0x%x"
,
st
);
DSBLOG_WARN
(
"failed to shutdown internal:
%s"
,
QCC_StatusText
(
st
)
)
;
return
st
;
}
...
...
@@ -234,7 +234,7 @@ bridge::DeviceSystemBridge::RegisterAdapterSignalHandlers(bool isRegister)
int
ret
=
m_adapter
->
RegisterSignalListener
((
*
itr
)
->
GetName
(),
m_adapterSignalListener
,
NULL
,
handle
);
if
(
ret
!=
0
)
{
DSBLOG_WARN
(
"failed to register signal listener on adapter:
0x%x"
,
st
);
DSBLOG_WARN
(
"failed to register signal listener on adapter:
%s"
,
QCC_StatusText
(
st
)
)
;
if
(
st
==
ER_OK
)
ret
=
st
;
}
...
...
@@ -253,7 +253,7 @@ bridge::DeviceSystemBridge::RegisterAdapterSignalHandlers(bool isRegister)
int
ret
=
m_adapter
->
UnregisterSignalListener
(
*
begin
);
if
(
ret
!=
0
)
{
DSBLOG_WARN
(
"failed to unregister signal listener on adapter:
0x%x"
,
st
);
DSBLOG_WARN
(
"failed to unregister signal listener on adapter:
%s"
,
QCC_StatusText
(
st
)
)
;
if
(
st
==
ER_OK
)
st
=
ER_FAIL
;
}
...
...
@@ -296,7 +296,7 @@ bridge::DeviceSystemBridge::UpdateDevice(shared_ptr<IAdapterDevice> const& dev,
{
m_deviceList
.
erase
(
itr
);
if
((
st
=
itr
->
second
->
Shutdown
())
!=
ER_OK
)
DSBLOG_WARN
(
"failed to shutdown BridgeDevice:
0x%x"
,
st
);
DSBLOG_WARN
(
"failed to shutdown BridgeDevice:
%s"
,
QCC_StatusText
(
st
)
)
;
}
return
st
;
...
...
Bridge/ConfigManager.cpp
View file @
166462a9
...
...
@@ -92,14 +92,14 @@ ConfigManager::ConnectToAllJoyn()
st
=
m_busAttachment
->
Connect
();
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to connect to AllJoyn bus: %
d
"
,
st
);
DSBLOG_WARN
(
"Failed to connect to AllJoyn bus: %
s
"
,
QCC_StatusText
(
st
)
)
;
return
st
;
}
st
=
m_busAttachment
->
RequestName
(
m_serviceName
.
c_str
(),
DBUS_NAME_FLAG_REPLACE_EXISTING
|
DBUS_NAME_FLAG_DO_NOT_QUEUE
);
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to get name %s on AllJoyn bus: %
d
"
,
m_serviceName
.
c_str
(),
st
);
DSBLOG_WARN
(
"Failed to get name %s on AllJoyn bus: %
s
"
,
m_serviceName
.
c_str
(),
QCC_StatusText
(
st
)
)
;
return
st
;
}
...
...
@@ -107,14 +107,14 @@ ConfigManager::ConnectToAllJoyn()
st
=
m_busAttachment
->
BindSessionPort
(
m_sessionPort
,
sessionOpts
,
*
this
);
if
(
!
st
)
{
DSBLOG_WARN
(
"Failed to bind session port: %
d
"
,
st
);
DSBLOG_WARN
(
"Failed to bind session port: %
s
"
,
QCC_StatusText
(
st
)
)
;
return
st
;
}
st
=
m_busAttachment
->
AdvertiseName
(
m_serviceName
.
c_str
(),
sessionOpts
.
transports
);
if
(
!
st
)
{
DSBLOG_WARN
(
"Failed to advertise service name: %
d
"
,
st
);
DSBLOG_WARN
(
"Failed to advertise service name: %
s
"
,
QCC_StatusText
(
st
)
)
;
return
st
;
}
...
...
@@ -159,7 +159,7 @@ ConfigManager::SessionJoined(ajn::SessionPort, ajn::SessionId id, const char*)
QStatus
st
=
m_busAttachment
->
SetSessionListener
(
id
,
this
);
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to set session listener: %
d
"
,
st
);
DSBLOG_WARN
(
"Failed to set session listener: %
s
"
,
QCC_StatusText
(
st
)
)
;
return
;
}
...
...
@@ -167,7 +167,7 @@ ConfigManager::SessionJoined(ajn::SessionPort, ajn::SessionId id, const char*)
st
=
m_busAttachment
->
SetLinkTimeout
(
id
,
timeout
);
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to set session link timeout to %"
PRIu32
": %
d
"
,
timeout
,
st
);
DSBLOG_WARN
(
"Failed to set session link timeout to %"
PRIu32
": %
s
"
,
timeout
,
QCC_StatusText
(
st
)
)
;
return
;
}
}
...
...
Bridge/DeviceMain.cpp
View file @
166462a9
...
...
@@ -46,7 +46,7 @@ bridge::DeviceMain::Initialize()
st
=
AddInterface
(
*
m_interfaceDescription
);
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to add interface to bus object: %
d
"
,
st
);
DSBLOG_WARN
(
"Failed to add interface to bus object: %
s
"
,
QCC_StatusText
(
st
)
)
;
return
st
;
}
...
...
@@ -62,7 +62,7 @@ bridge::DeviceMain::Initialize()
st
=
AddMethodHandler
(
member
,
static_cast
<
ajn
::
MessageReceiver
::
MethodHandler
>
(
&
DeviceMain
::
AJMethod
));
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to add method handler: %
d
"
,
st
);
DSBLOG_WARN
(
"Failed to add method handler: %
s
"
,
QCC_StatusText
(
st
)
)
;
return
st
;
}
}
...
...
@@ -70,7 +70,7 @@ bridge::DeviceMain::Initialize()
st
=
m_parent
.
GetBusAttachment
().
RegisterBusObject
(
*
this
);
if
(
st
!=
ER_OK
)
{
DSBLOG_WARN
(
"Failed to register bus object: %
d
"
,
st
);
DSBLOG_WARN
(
"Failed to register bus object: %
s
"
,
QCC_StatusText
(
st
)
)
;
return
st
;
}
...
...
main.cpp
View file @
166462a9
...
...
@@ -52,7 +52,7 @@ int main(int /*argc*/, char* /*argv*/ [])
st
=
bridge
->
Initialize
();
if
(
st
!=
ER_OK
)
{
DSBLOG_ERROR
(
"failed to initialize bridge:
0x%x"
,
st
);
DSBLOG_ERROR
(
"failed to initialize bridge:
%s"
,
QCC_StatusText
(
st
)
)
;
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment