• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 The Pigweed Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 //     https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 
15 #include "chre/platform/host_link.h"
16 
17 #include <algorithm>
18 
19 #include "chre/core/host_comms_manager.h"
20 #include "pw_chre/host_link.h"
21 
22 namespace chre {
23 
24 // TODO: b/301477662 - Implement these, possibly by adding a facade.
flushMessagesSentByNanoapp(uint64_t)25 void HostLink::flushMessagesSentByNanoapp(uint64_t) {}
26 
sendMessage(const MessageToHost * message)27 bool HostLink::sendMessage(const MessageToHost* message) {
28   pw::chre::MessageToAp pw_message{
29       .nanoapp_id = message->appId,
30       .message_type = message->toHostData.messageType,
31       .app_permissions = message->toHostData.appPermissions,
32       .message_permissions = message->toHostData.messagePermissions,
33       .host_endpoint = message->toHostData.hostEndpoint,
34       .woke_host = message->toHostData.wokeHost,
35       .data = message->message.data(),
36       .length = message->message.size(),
37       .chre_context = message,
38   };
39   return pw::chre::SendMessageToAp(std::move(pw_message));
40 }
41 
sendNanConfiguration(bool)42 void HostLinkBase::sendNanConfiguration(bool) {}
43 
44 }  // namespace chre
45