Merge 51426e477b
on remote branch
Change-Id: I265c9857aae869b1cbf90f926d33d58493b47f95
This commit is contained in:
commit
9e9693bda0
12 changed files with 112 additions and 94 deletions
|
@ -255,7 +255,7 @@ bool GnssConfiguration::setBlacklistedSource(
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN;
|
copyToSource.constellation = GNSS_SV_TYPE_UNKNOWN;
|
||||||
LOC_LOGe("Invalid constellation %u", copyFromSource.constellation);
|
LOC_LOGe("Invalid constellation %hhu", copyFromSource.constellation);
|
||||||
retVal = false;
|
retVal = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ void GeofenceAPIClient::geofenceRemoveAll()
|
||||||
// callbacks
|
// callbacks
|
||||||
void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification)
|
void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count);
|
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceBreachNotification.count);
|
||||||
if (mGnssGeofencingCbIface != nullptr) {
|
if (mGnssGeofencingCbIface != nullptr) {
|
||||||
for (size_t i = 0; i < geofenceBreachNotification.count; i++) {
|
for (size_t i = 0; i < geofenceBreachNotification.count; i++) {
|
||||||
GnssLocation gnssLocation;
|
GnssLocation gnssLocation;
|
||||||
|
|
|
@ -517,7 +517,7 @@ void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotificatio
|
||||||
|
|
||||||
void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification)
|
void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count);
|
LOC_LOGD("%s]: (count: %u)", __FUNCTION__, gnssSvNotification.count);
|
||||||
mMutex.lock();
|
mMutex.lock();
|
||||||
auto gnssCbIface(mGnssCbIface);
|
auto gnssCbIface(mGnssCbIface);
|
||||||
auto gnssCbIface_2_0(mGnssCbIface_2_0);
|
auto gnssCbIface_2_0(mGnssCbIface_2_0);
|
||||||
|
@ -561,7 +561,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
|
||||||
auto r = gnssCbIface_2_0->gnssNmeaCb(
|
auto r = gnssCbIface_2_0->gnssNmeaCb(
|
||||||
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
||||||
if (!r.isOk()) {
|
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,
|
__func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length,
|
||||||
r.description().c_str());
|
r.description().c_str());
|
||||||
}
|
}
|
||||||
|
@ -569,7 +569,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
|
||||||
auto r = gnssCbIface->gnssNmeaCb(
|
auto r = gnssCbIface->gnssNmeaCb(
|
||||||
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
static_cast<V1_0::GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
||||||
if (!r.isOk()) {
|
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,
|
__func__, gnssNmeaNotification.nmea, gnssNmeaNotification.length,
|
||||||
r.description().c_str());
|
r.description().c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,7 +170,7 @@ void MeasurementAPIClient::measurementClose() {
|
||||||
void MeasurementAPIClient::onGnssMeasurementsCb(
|
void MeasurementAPIClient::onGnssMeasurementsCb(
|
||||||
GnssMeasurementsNotification gnssMeasurementsNotification)
|
GnssMeasurementsNotification gnssMeasurementsNotification)
|
||||||
{
|
{
|
||||||
LOC_LOGD("%s]: (count: %zu active: %d)",
|
LOC_LOGD("%s]: (count: %u active: %d)",
|
||||||
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
|
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
|
||||||
if (mTracking) {
|
if (mTracking) {
|
||||||
mMutex.lock();
|
mMutex.lock();
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
GNSS_CFLAGS := \
|
GNSS_CFLAGS := \
|
||||||
-Werror \
|
-Werror \
|
||||||
-Wno-error=unused-parameter \
|
-Wno-error=unused-parameter \
|
||||||
-Wno-error=format \
|
|
||||||
-Wno-error=macro-redefined \
|
-Wno-error=macro-redefined \
|
||||||
-Wno-error=reorder \
|
-Wno-error=reorder \
|
||||||
-Wno-error=missing-braces \
|
-Wno-error=missing-braces \
|
||||||
|
|
|
@ -404,7 +404,7 @@ void LocApiBase::reportSv(GnssSvNotification& svNotify)
|
||||||
"QZSS", "BEIDOU", "GALILEO" };
|
"QZSS", "BEIDOU", "GALILEO" };
|
||||||
|
|
||||||
// print the SV info before delivering
|
// print the SV info before delivering
|
||||||
LOC_LOGV("num sv: %zu\n"
|
LOC_LOGV("num sv: %u\n"
|
||||||
" sv: constellation svid cN0"
|
" sv: constellation svid cN0"
|
||||||
" elevation azimuth flags",
|
" elevation azimuth flags",
|
||||||
svNotify.count);
|
svNotify.count);
|
||||||
|
|
|
@ -249,7 +249,7 @@ public:
|
||||||
mId(NETWORKINFO_DATA_ITEM_ID) {
|
mId(NETWORKINFO_DATA_ITEM_ID) {
|
||||||
memset (&mAllNetworkHandles, NETWORK_HANDLE_UNKNOWN,
|
memset (&mAllNetworkHandles, NETWORK_HANDLE_UNKNOWN,
|
||||||
sizeof (mAllNetworkHandles));
|
sizeof (mAllNetworkHandles));
|
||||||
mAllNetworkHandles[type] = networkHandle;
|
mAllNetworkHandles[initialType] = networkHandle;
|
||||||
}
|
}
|
||||||
virtual ~NetworkInfoDataItemBase() {}
|
virtual ~NetworkInfoDataItemBase() {}
|
||||||
inline virtual DataItemId getId() { return mId; }
|
inline virtual DataItemId getId() { return mId; }
|
||||||
|
|
|
@ -714,8 +714,6 @@ GnssAdapter::setConfigCommand()
|
||||||
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
|
loc_gps_cfg_s gpsConf = ContextBase::mGps_conf;
|
||||||
loc_sap_cfg_s_type sapConf = ContextBase::mSap_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
|
//cache the injected configuration with GnssConfigRequested struct
|
||||||
GnssConfig gnssConfigRequested = {};
|
GnssConfig gnssConfigRequested = {};
|
||||||
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT |
|
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT |
|
||||||
|
@ -745,6 +743,9 @@ GnssAdapter::setConfigCommand()
|
||||||
adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY);
|
adapter.mLocApi->convertLppeUp(gpsConf.LPPE_UP_TECHNOLOGY);
|
||||||
gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(),
|
gnssConfigRequested.blacklistedSvIds.assign(adapter.mBlacklistedSvIds.begin(),
|
||||||
adapter.mBlacklistedSvIds.end());
|
adapter.mBlacklistedSvIds.end());
|
||||||
|
mApi.sendMsg(new LocApiMsg(
|
||||||
|
[&adapter, gpsConf, sapConf, oldServerUrl,
|
||||||
|
oldMoServerUrl, gnssConfigRequested] () {
|
||||||
adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested,
|
adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested,
|
||||||
gnssConfigRequested);
|
gnssConfigRequested);
|
||||||
|
|
||||||
|
@ -1039,6 +1040,15 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||||
mConfig(config),
|
mConfig(config),
|
||||||
mCount(count),
|
mCount(count),
|
||||||
mIds(ids) {}
|
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()
|
inline virtual ~MsgGnssUpdateConfig()
|
||||||
{
|
{
|
||||||
delete[] mIds;
|
delete[] mIds;
|
||||||
|
@ -1066,7 +1076,7 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
|
||||||
newGpsLock = GNSS_CONFIG_GPS_LOCK_MO;
|
newGpsLock = GNSS_CONFIG_GPS_LOCK_MO;
|
||||||
}
|
}
|
||||||
if (newGpsLock == ContextBase::mGps_conf.GPS_LOCK ||
|
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);
|
gnssConfigNeedEngineUpdate.flags &= ~(GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT);
|
||||||
}
|
}
|
||||||
ContextBase::mGps_conf.GPS_LOCK = newGpsLock;
|
ContextBase::mGps_conf.GPS_LOCK = newGpsLock;
|
||||||
|
@ -1299,6 +1309,16 @@ GnssAdapter::gnssGetConfigCommand(GnssConfigFlagsMask configMask) {
|
||||||
mConfigMask(configMask),
|
mConfigMask(configMask),
|
||||||
mIds(ids),
|
mIds(ids),
|
||||||
mCount(count) {}
|
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()
|
inline virtual ~MsgGnssGetConfig()
|
||||||
{
|
{
|
||||||
delete[] mIds;
|
delete[] mIds;
|
||||||
|
|
|
@ -123,7 +123,7 @@ bool XtraSystemStatusObserver::updateLockStatus(GnssConfigGpsLock lock) {
|
||||||
|
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
ss << "gpslock";
|
ss << "gpslock";
|
||||||
ss << " " << lock;
|
ss << " " << mGpsLock;
|
||||||
string s = ss.str();
|
string s = ss.str();
|
||||||
return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) );
|
return ( LocIpc::send(*mSender, (const uint8_t*)s.data(), s.size()) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
GNSS_CFLAGS := \
|
GNSS_CFLAGS := \
|
||||||
-Werror \
|
-Werror \
|
||||||
-Wno-error=unused-parameter \
|
-Wno-error=unused-parameter \
|
||||||
-Wno-error=format \
|
|
||||||
-Wno-error=macro-redefined \
|
-Wno-error=macro-redefined \
|
||||||
-Wno-error=reorder \
|
-Wno-error=reorder \
|
||||||
-Wno-error=missing-braces \
|
-Wno-error=missing-braces \
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace loc_util {
|
||||||
|
|
||||||
#define SOCK_OP_AND_LOG(buf, length, opable, rtv, exe) \
|
#define SOCK_OP_AND_LOG(buf, length, opable, rtv, exe) \
|
||||||
if (nullptr == (buf) || 0 == (length)) { \
|
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)) { \
|
} else if (!(opable)) { \
|
||||||
LOC_LOGe("Invalid object: operable - %d", (opable)); \
|
LOC_LOGe("Invalid object: operable - %d", (opable)); \
|
||||||
} else { \
|
} else { \
|
||||||
|
@ -60,7 +60,7 @@ namespace loc_util {
|
||||||
|
|
||||||
const char Sock::MSG_ABORT[] = "LocIpc::Sock::ABORT";
|
const char Sock::MSG_ABORT[] = "LocIpc::Sock::ABORT";
|
||||||
const char Sock::LOC_IPC_HEAD[] = "$MSGLEN$";
|
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 {
|
socklen_t addrlen) const {
|
||||||
ssize_t rtv = -1;
|
ssize_t rtv = -1;
|
||||||
SOCK_OP_AND_LOG(buf, len, isValid(), rtv, sendto(buf, len, flags, destAddr, addrlen));
|
SOCK_OP_AND_LOG(buf, len, isValid(), rtv, sendto(buf, len, flags, destAddr, addrlen));
|
||||||
|
|
|
@ -164,7 +164,7 @@ public:
|
||||||
inline Sock(int sid, const uint32_t maxTxSize = 8192) : mMaxTxSize(maxTxSize), mSid(sid) {}
|
inline Sock(int sid, const uint32_t maxTxSize = 8192) : mMaxTxSize(maxTxSize), mSid(sid) {}
|
||||||
inline ~Sock() { close(); }
|
inline ~Sock() { close(); }
|
||||||
inline bool isValid() const { return -1 != mSid; }
|
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;
|
socklen_t addrlen) const;
|
||||||
ssize_t recv(const shared_ptr<ILocIpcListener>& dataCb, int flags, struct sockaddr *srcAddr,
|
ssize_t recv(const shared_ptr<ILocIpcListener>& dataCb, int flags, struct sockaddr *srcAddr,
|
||||||
socklen_t *addrlen, int sid = -1) const;
|
socklen_t *addrlen, int sid = -1) const;
|
||||||
|
|
Loading…
Reference in a new issue