!26 Adapt dsoftbus transmission interface

Merge pull request !26 from wangkun/master
This commit is contained in:
openharmony_ci 2021-07-15 10:55:56 +00:00 committed by Gitee
commit a0bd14dd23

View File

@ -474,6 +474,17 @@ Status SoftBusAdapter::SendData(const PipeInfo &pipeInfo, const DeviceId &device
pipeInfo.pipeId.c_str(), info.msgType, sessionId);
return Status::CREATE_SESSION_ERROR;
}
SetOpenSessionId(sessionId);
int state = WaitSessionOpen();
{
lock_guard<mutex> lock(notifyFlagMutex_);
notifyFlag_ = false;
}
ZLOGD("Waited for notification, state:%{public}d", state);
if (state != SOFTBUS_OK) {
ZLOGE("OpenSession callback result error");
return Status::CREATE_SESSION_ERROR;
}
ZLOGD("[SendBytes] start,sessionId is %{public}d, size is %{public}d, session type is %{public}d.",
sessionId, size, attr.dataType);
int32_t ret = SendBytes(sessionId, (void*)ptr, size);
@ -601,6 +612,10 @@ int AppDataListenerWrap::OnSessionOpened(int sessionId, int result)
char mySessionName[SESSION_NAME_SIZE_MAX] = "";
char peerSessionName[SESSION_NAME_SIZE_MAX] = "";
char peerDevId[DEVICE_ID_SIZE_MAX] = "";
if (sessionId == softBusAdapter_->GetOpenSessionId()) {
softBusAdapter_->NotifySessionOpen(result);
}
if (result != SOFTBUS_OK) {
ZLOGW("session %{public}d open failed, result:%{public}d.", sessionId, result);
return result;