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; 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;
} }

View file

@ -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;

View file

@ -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());
} }

View file

@ -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();

View file

@ -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 \

View file

@ -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);

View file

@ -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; }

View file

@ -714,90 +714,91 @@ 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( //cache the injected configuration with GnssConfigRequested struct
[&adapter, gpsConf, sapConf, oldServerUrl, oldMoServerUrl] () { GnssConfig gnssConfigRequested = {};
//cache the injected configuration with GnssConfigRequested struct gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT |
GnssConfig gnssConfigRequested = {}; GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT |
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT | GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT |
GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT | GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT;
GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT | gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT; if (0 == adapter.getAfwControlId() || NULL != adapter.mNfwCb) {
gnssConfigRequested.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK;
if (0 == adapter.getAfwControlId() || NULL != adapter.mNfwCb) { }
gnssConfigRequested.gpsLock = gpsConf.GPS_LOCK;
}
if (gpsConf.AGPS_CONFIG_INJECT) { if (gpsConf.AGPS_CONFIG_INJECT) {
gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT | gnssConfigRequested.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT |
GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT | GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT |
GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT | GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT |
GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT; GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
gnssConfigRequested.suplVersion = gnssConfigRequested.suplVersion =
adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER); adapter.mLocApi->convertSuplVersion(gpsConf.SUPL_VER);
gnssConfigRequested.lppProfile = gnssConfigRequested.lppProfile =
adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE); adapter.mLocApi->convertLppProfile(gpsConf.LPP_PROFILE);
gnssConfigRequested.aGlonassPositionProtocolMask = gnssConfigRequested.aGlonassPositionProtocolMask =
gpsConf.A_GLONASS_POS_PROTOCOL_SELECT; gpsConf.A_GLONASS_POS_PROTOCOL_SELECT;
} }
gnssConfigRequested.lppeControlPlaneMask = gnssConfigRequested.lppeControlPlaneMask =
adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY); adapter.mLocApi->convertLppeCp(gpsConf.LPPE_CP_TECHNOLOGY);
gnssConfigRequested.lppeUserPlaneMask = gnssConfigRequested.lppeUserPlaneMask =
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());
adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested, mApi.sendMsg(new LocApiMsg(
gnssConfigRequested); [&adapter, gpsConf, sapConf, oldServerUrl,
oldMoServerUrl, gnssConfigRequested] () {
adapter.gnssUpdateConfig(oldServerUrl, oldMoServerUrl, gnssConfigRequested,
gnssConfigRequested);
// set nmea mask type // set nmea mask type
uint32_t mask = 0; uint32_t mask = 0;
if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) { if (NMEA_PROVIDER_MP == gpsConf.NMEA_PROVIDER) {
mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK; mask |= LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK;
} }
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) { if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) {
mask |= LOC_NMEA_MASK_DEBUG_V02; mask |= LOC_NMEA_MASK_DEBUG_V02;
} }
if (mask != 0) { if (mask != 0) {
adapter.mLocApi->setNMEATypesSync(mask); adapter.mLocApi->setNMEATypesSync(mask);
} }
adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK); adapter.mLocApi->setXtraVersionCheckSync(gpsConf.XTRA_VERSION_CHECK);
adapter.mLocApi->setConstrainedTuncMode( adapter.mLocApi->setConstrainedTuncMode(
gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1, gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENABLED == 1,
(float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD, (float)gpsConf.CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD,
gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET); gpsConf.CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET);
adapter.mLocApi->setPositionAssistedClockEstimatorMode( adapter.mLocApi->setPositionAssistedClockEstimatorMode(
gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1); gpsConf.POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED == 1);
if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID || if (sapConf.GYRO_BIAS_RANDOM_WALK_VALID ||
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID || sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID || sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) { sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID ) {
adapter.mLocApi->setSensorPropertiesSync( adapter.mLocApi->setSensorPropertiesSync(
sapConf.GYRO_BIAS_RANDOM_WALK_VALID, sapConf.GYRO_BIAS_RANDOM_WALK_VALID,
sapConf.GYRO_BIAS_RANDOM_WALK, sapConf.GYRO_BIAS_RANDOM_WALK,
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, sapConf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY,
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, sapConf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY,
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, sapConf.RATE_RANDOM_WALK_SPECTRAL_DENSITY,
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY); sapConf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY);
} }
adapter.mLocApi->setSensorPerfControlConfigSync( adapter.mLocApi->setSensorPerfControlConfigSync(
sapConf.SENSOR_CONTROL_MODE, sapConf.SENSOR_CONTROL_MODE,
sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH, sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH,
sapConf.SENSOR_ACCEL_BATCHES_PER_SEC, sapConf.SENSOR_ACCEL_BATCHES_PER_SEC,
sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH, sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH,
sapConf.SENSOR_GYRO_BATCHES_PER_SEC, sapConf.SENSOR_GYRO_BATCHES_PER_SEC,
sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, sapConf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH,
sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, sapConf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH,
sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, sapConf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH,
sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, sapConf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH,
sapConf.SENSOR_ALGORITHM_CONFIG_MASK); sapConf.SENSOR_ALGORITHM_CONFIG_MASK);
} )); } ));
} }
}; };
@ -1039,9 +1040,18 @@ 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;
} }
inline virtual void proc() const { inline virtual void proc() const {
@ -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;

View file

@ -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()) );
} }

View file

@ -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 \

View file

@ -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));

View file

@ -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;