Merge 51426e477b on remote branch

Change-Id: I265c9857aae869b1cbf90f926d33d58493b47f95
This commit is contained in:
Linux Build Service Account 2019-06-02 15:08:39 -07:00
commit 9e9693bda0
12 changed files with 112 additions and 94 deletions

View file

@ -255,7 +255,7 @@ bool GnssConfiguration::setBlacklistedSource(
break;
default:
copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN;
LOC_LOGe("Invalid constellation %u", copyFromSource.constellation);
LOC_LOGe("Invalid constellation %hhu", copyFromSource.constellation);
retVal = false;
break;
}

View file

@ -141,7 +141,7 @@ void GeofenceAPIClient::geofenceRemoveAll()
// callbacks
void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification)
{
LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count);
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceBreachNotification.count);
if (mGnssGeofencingCbIface != nullptr) {
for (size_t i = 0; i < geofenceBreachNotification.count; i++) {
GnssLocation gnssLocation;

View file

@ -517,7 +517,7 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio
void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification)
{
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count);
LOC_LOGD("%s]: (count: %u)", __FUNCTION__, gnssSvNotification.count);
mMutex.lock();
auto gnssCbIface(mGnssCbIface);
auto gnssCbIface_2_0(mGnssCbIface_2_0);
@ -561,7 +561,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
auto r = gnssCbIface_2_0->gnssNmeaCb(
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssCbIface_2_0 nmea=%s length=%zu description=%s",
LOC_LOGE("%s] Error from gnssCbIface_2_0 nmea=%s length=%u description=%s",
__func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length,
r.description().c_str());
}
@ -569,7 +569,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
auto r = gnssCbIface->gnssNmeaCb(
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s",
LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%u description=%s",
__func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length,
r.description().c_str());
}

View file

@ -170,7 +170,7 @@ void MeasurementAPIClient::measurementClose() {
void MeasurementAPIClient::onGnssMeasurementsCb(
GnssMeasurementsNotification gnssMeasurementsNotification)
{
LOC_LOGD("%s]: (count: %zu active: %d)",
LOC_LOGD("%s]: (count: %u active: %d)",
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
if (mTracking) {
mMutex.lock();

View file

@ -1,7 +1,6 @@
GNSS_CFLAGS := \
-Werror \
-Wno-error=unused-parameter \
-Wno-error=format \
-Wno-error=macro-redefined \
-Wno-error=reorder \
-Wno-error=missing-braces \

View file

@ -404,7 +404,7 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify)
"QZSS", "BEIDOU", "GALILEO" };
// print the SV info before delivering
LOC_LOGV("num sv: %zu\n"
LOC_LOGV("num sv: %u\n"
" sv: constellation svid cN0"
" elevation azimuth flags",
svNotify.count);

View file

@ -249,7 +249,7 @@ public:
mId(NETWORKINFO_DATA_ITEM_ID) {
memset (&mAllNetworkHandles, NETWORK_HANDLE_UNKNOWN,
sizeof (mAllNetworkHandles));
mAllNetworkHandles[type] = networkHandle;
mAllNetworkHandles[initialType] = networkHandle;
}
virtual ~NetworkInfoDataItemBase() {}
inline virtual DataItemId getId() { return mId; }

View file

@ -714,8 +714,6 @@ GnssAdapter::setConfigCommand()
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
loc_sap_cfg_s_type sapConf = ContextBase::mSap_conf;
mApi.sendMsg(new LocApiMsg(
[&adapter, gpsConf, sapConf, oldServerUrl, oldMoServerUrl] () {
//cache the injected configuration with GnssConfigRequested struct
GnssConfig gnssConfigRequested = {};
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT |
@ -745,6 +743,9 @@ GnssAdapter::setConfigCommand()
adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY);
gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(),
adapter.mBlacklistedSvIds.end());
mApi.sendMsg(new LocApiMsg(
[&adapter, gpsConf, sapConf, oldServerUrl,
oldMoServerUrl, gnssConfigRequested] () {
adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested,
gnssConfigRequested);
@ -1039,9 +1040,18 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
mConfig(config),
mCount(count),
mIds(ids) {}
inline MsgGnssUpdateConfig(const MsgGnssUpdateConfig& obj) :
MsgGnssUpdateConfig(obj.mAdapter, obj.mApi, obj.mConfig,
new uint32_t[obj.mCount], obj.mCount) {
if (mIds != nullptr) {
for (int i = 0; i < mCount; ++i) {
mIds[i] = obj.mIds[i];
}
}
}
inline virtual ~MsgGnssUpdateConfig()
{
delete [] mIds;
delete[] mIds;
}
inline virtual void proc() const {
@ -1066,7 +1076,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
newGpsLock = GNSS_CONFIG_GPS_LOCK_MO;
}
if (newGpsLock == ContextBase::mGps_conf.GPS_LOCK ||
0 != mAdapter.getAfwControlId()) {
0 != mAdapter.getAfwControlId() || NULL != adapter.mNfwCb) {
gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT);
}
ContextBase::mGps_conf.GPS_LOCK = newGpsLock;
@ -1299,6 +1309,16 @@ GnssAdapter::gnssGetConfigCommand(GnssConfigFlagsMask configMask) {
mConfigMask(configMask),
mIds(ids),
mCount(count) {}
inline MsgGnssGetConfig(const MsgGnssGetConfig& obj) :
MsgGnssGetConfig(obj.mAdapter, obj.mApi, obj.mConfigMask,
new uint32_t[obj.mCount], obj.mCount) {
if (mIds != nullptr) {
for (int i = 0; i < mCount; ++i) {
mIds[i] = obj.mIds[i];
}
}
}
inline virtual ~MsgGnssGetConfig()
{
delete[] mIds;

View file

@ -123,7 +123,7 @@ bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) {
stringstream ss;
ss << "gpslock";
ss << " " << lock;
ss << " " << mGpsLock;
string s = ss.str();
return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) );
}

View file

@ -1,7 +1,6 @@
GNSS_CFLAGS := \
-Werror \
-Wno-error=unused-parameter \
-Wno-error=format \
-Wno-error=macro-redefined \
-Wno-error=reorder \
-Wno-error=missing-braces \

View file

@ -48,7 +48,7 @@ namespace loc_util {
#define SOCK_OP_AND_LOG(buf, length, opable, rtv, exe) \
if (nullptr == (buf) || 0 == (length)) { \
LOC_LOGe("Invalid inputs: buf - %p, length - %d", (buf), (length)); \
LOC_LOGe("Invalid inputs: buf - %p, length - %u", (buf), (length)); \
} else if (!(opable)) { \
LOC_LOGe("Invalid object: operable - %d", (opable)); \
} else { \
@ -60,7 +60,7 @@ namespace loc_util {
const char Sock::MSG_ABORT[] = "LocIpc::Sock::ABORT";
const char Sock::LOC_IPC_HEAD[] = "$MSGLEN$";
ssize_t Sock::send(const void *buf, size_t len, int flags, const struct sockaddr *destAddr,
ssize_t Sock::send(const void *buf, uint32_t len, int flags, const struct sockaddr *destAddr,
socklen_t addrlen) const {
ssize_t rtv = -1;
SOCK_OP_AND_LOG(buf, len, isValid(), rtv, sendto(buf, len, flags, destAddr, addrlen));

View file

@ -164,7 +164,7 @@ public:
inline Sock(int sid, const uint32_t maxTxSize = 8192) : mMaxTxSize(maxTxSize), mSid(sid) {}
inline ~Sock() { close(); }
inline bool isValid() const { return -1 != mSid; }
ssize_t send(const void *buf, size_t len, int flags, const struct sockaddr *destAddr,
ssize_t send(const void *buf, uint32_t len, int flags, const struct sockaddr *destAddr,
socklen_t addrlen) const;
ssize_t recv(const shared_ptr<ILocIpcListener>& dataCb, int flags, struct sockaddr *srcAddr,
socklen_t *addrlen, int sid = -1) const;