GPS GNSS adapter: connectivity support for engine hub

(1) allow engine hub to be able to receive connectivity
status update
(2) fix kw warning in LocIpc.h

Change-Id: I62ac534639003051a8992c143ff273d5ff66ee5a
CRs-fixed: 2198446
This commit is contained in:
Kevin Tang 2018-03-07 10:19:24 -08:00
parent c5ee86bfdc
commit b47eea6b23
4 changed files with 7 additions and 4 deletions

View file

@ -101,6 +101,7 @@ typedef std::function<void(const GnssSvNotification& svNotify, bool fromUlp)>
// potential parameters: message queue: MsgTask * msgTask;
// callback function to report back dr and ppe position and sv report
typedef EngineHubProxyBase* (getEngHubProxyFn)(const MsgTask * msgTask,
IOsObserver* osObserver,
GnssAdapterReportPositionEventCb positionEventCb,
GnssAdapterReportSvEventCb svEventCb);

View file

@ -3310,7 +3310,8 @@ GnssAdapter::initEngHubProxy() {
getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy");
if(getter != nullptr) {
EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, reportPositionEventCb,
EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mSystemStatus->getOsObserver(),
reportPositionEventCb,
reportSvEventCb);
if (hubProxy != nullptr) {
mEngHubProxy = hubProxy;

View file

@ -32,6 +32,7 @@
#include <LocAdapterBase.h>
#include <LocDualContext.h>
#include <UlpProxyBase.h>
#include <IOsObserver.h>
#include <EngineHubProxyBase.h>
#include <LocationAPI.h>
#include <Agps.h>

View file

@ -140,10 +140,10 @@ private:
std::shared_ptr<int> mSocket;
struct sockaddr_un mDestAddr;
inline LocIpcSender(
const std::shared_ptr<int>& mySocket, const char* destSocket) : mSocket(mySocket) {
inline LocIpcSender(const std::shared_ptr<int>& mySocket, const char* destSocket) :
mSocket(mySocket),
mDestAddr({.sun_family = AF_UNIX, {}}) {
if ((nullptr != mSocket) && (-1 != *mSocket) && (nullptr != destSocket)) {
mDestAddr.sun_family = AF_UNIX;
snprintf(mDestAddr.sun_path, sizeof(mDestAddr.sun_path), "%s", destSocket);
}
}