Lines Matching refs:exchange
33 static void EndWork(ServiceImpl *service, const Exchange *exchange);
35 static void ProcRequest(Exchange *exchange, ServiceImpl *serviceImpl);
36 static void ProcDirectRequest(Exchange *exchange);
37 static void ProcResponse(Exchange *exchange);
38 static ServiceImpl *CorrectServiceImpl(Exchange *exchange, ServiceImpl *serviceImpl);
101 Exchange exchange = {0}; in SAMGR_ReleaseTaskPool() local
102 exchange.type = MSG_EXIT; in SAMGR_ReleaseTaskPool()
103 QUEUE_Put(pool->queueId, &exchange, 0, DONT_WAIT); in SAMGR_ReleaseTaskPool()
128 Exchange exchange; in TaskEntry() local
129 uint32 msgRcvRet = SAMGR_MsgRecv((MQueueId)argv, (uint8 *)&exchange, sizeof(Exchange)); in TaskEntry()
134 if (exchange.type == MSG_EXIT) { in TaskEntry()
135 SAMGR_FreeMsg(&exchange); in TaskEntry()
139 serviceImpl = CorrectServiceImpl(&exchange, serviceImpl); in TaskEntry()
141 ProcResponse(&exchange); in TaskEntry()
142 ProcDirectRequest(&exchange); in TaskEntry()
143 ProcRequest(&exchange, serviceImpl); in TaskEntry()
144 EndWork(serviceImpl, &exchange); in TaskEntry()
145 SAMGR_FreeMsg(&exchange); in TaskEntry()
151 static void ProcRequest(Exchange *exchange, ServiceImpl *serviceImpl) in ProcRequest() argument
153 if (serviceImpl == NULL || exchange->type == MSG_ACK || exchange->type == MSG_DIRECT) { in ProcRequest()
157 DEFAULT_MessageHandle(serviceImpl, &(exchange->id), &(exchange->request)); in ProcRequest()
159 if (exchange->type == MSG_CON) { in ProcRequest()
160 SAMGR_SendResponse(&exchange->request, &exchange->response); in ProcRequest()
164 static void ProcResponse(Exchange *exchange) in ProcResponse() argument
166 if (exchange->handler == NULL) { in ProcResponse()
170 if (exchange->type != MSG_ACK) { in ProcResponse()
174 exchange->handler(&exchange->request, &exchange->response); in ProcResponse()
177 static void ProcDirectRequest(Exchange *exchange) in ProcDirectRequest() argument
179 if (exchange->handler == NULL) { in ProcDirectRequest()
183 if (exchange->type != MSG_DIRECT) { in ProcDirectRequest()
187 exchange->handler(&exchange->request, &exchange->response); in ProcDirectRequest()
190 static ServiceImpl *CorrectServiceImpl(Exchange *exchange, ServiceImpl *serviceImpl) in CorrectServiceImpl() argument
192 if (exchange->type == MSG_ACK) { in CorrectServiceImpl()
197 if (serviceImpl == NULL || serviceImpl->serviceId != exchange->id.serviceId) { in CorrectServiceImpl()
198 serviceImpl = SAMGR_GetServiceByID(exchange->id.serviceId); in CorrectServiceImpl()
228 static void EndWork(ServiceImpl *service, const Exchange *exchange) in EndWork() argument
244 name, exchange->id.featureId, exchange->type, exchange->request.msgId, interval); in EndWork()