wwan_world.cc revision a16406ba1a734f21f36a4b0f64b23b062644b6e2
1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <chre.h>
18#include <cinttypes>
19
20#include "chre/util/nanoapp/log.h"
21
22#define LOG_TAG "[WwanWorld]"
23
24namespace chre {
25namespace app {
26
27bool wwanWorldStart() {
28  LOGI("App started as instance %" PRIu32, chreGetInstanceId());
29
30  const char *wwanCapabilitiesStr;
31  uint32_t wwanCapabilities = chreWwanGetCapabilities();
32  switch (wwanCapabilities) {
33    case CHRE_WWAN_GET_CELL_INFO:
34      wwanCapabilitiesStr = "GET_CELL_INFO";
35      break;
36    case CHRE_WWAN_CAPABILITIES_NONE:
37      wwanCapabilitiesStr = "NONE";
38      break;
39    default:
40      wwanCapabilitiesStr = "INVALID";
41  }
42
43  LOGI("Detected WWAN support as: %s (%" PRIu32 ")",
44       wwanCapabilitiesStr, wwanCapabilities);
45  return true;
46}
47
48void wwanWorldHandleEvent(uint32_t senderInstanceId,
49                          uint16_t eventType,
50                          const void *eventData) {
51  // TODO: Implement this.
52}
53
54void wwanWorldStop() {
55  LOGI("Stopped");
56}
57
58}  // namespace app
59}  // namespace chre
60