xref: /aosp_15_r20/external/pigweed/pw_chre/host_link.cc (revision 61c4878ac05f98d0ceed94b57d316916de578985)
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 "public/pw_chre/host_link.h"
21 #include "pw_chre/host_link.h"
22 
23 namespace chre {
24 
25 // TODO: b/301477662 - Implement these, possibly by adding a facade.
flushMessagesSentByNanoapp(uint64_t)26 void HostLink::flushMessagesSentByNanoapp(uint64_t) {}
27 
sendMessage(const MessageToHost * message)28 bool HostLink::sendMessage(const MessageToHost* message) {
29   pw::chre::MessageToAp pw_message{
30       .nanoapp_id = message->appId,
31       .message_type = message->toHostData.messageType,
32       .app_permissions = message->toHostData.appPermissions,
33       .message_permissions = message->toHostData.messagePermissions,
34       .host_endpoint = message->toHostData.hostEndpoint,
35       .woke_host = message->toHostData.wokeHost,
36       .data = message->message.data(),
37       .length = message->message.size(),
38       .chre_context = message,
39   };
40   return pw::chre::SendMessageToAp(std::move(pw_message));
41 }
42 
sendNanConfiguration(bool)43 void HostLinkBase::sendNanConfiguration(bool) {}
44 
45 }  // namespace chre
46