tango_helper.cc
Go to the documentation of this file.
1 // Copyright 2016 Intermodalics All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://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,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #include "tango_helper.h"
15 
16 #include <glog/logging.h>
19 
20 namespace tango_helper {
21 bool IsTangoVersionOk(JNIEnv* env, jobject activity) {
22  int version;
23  TangoErrorType result = TangoSupport_getTangoVersion(env, activity, &version);
24  if (result != TANGO_SUCCESS || version < TANGO_CORE_MINIMUM_VERSION) {
25  LOG(ERROR) << "Tango Core version is out of "
26  "date, minimum version required: " << TANGO_CORE_MINIMUM_VERSION <<
27  ", version used: " << version;
28  return false;
29  }
30  return true;
31 }
32 
33 bool SetBinder(JNIEnv* env, jobject binder) {
34  TangoErrorType result = TangoService_setBinder(env, binder);
35  if (result != TANGO_SUCCESS) {
36  LOG(ERROR) << "Failed to bind Tango service with error code: " << result;
37  return false;
38  }
39  return true;
40 }
41 } // tango_helper
bool IsTangoVersionOk(JNIEnv *env, jobject activity)
Definition: tango_helper.cc:21
TangoErrorType
bool SetBinder(JNIEnv *env, jobject binder)
Definition: tango_helper.cc:33
TangoErrorType TangoSupport_getTangoVersion(void *jni_env, void *activity, int *version)
TANGO_SUCCESS
const int TANGO_CORE_MINIMUM_VERSION
Definition: tango_helper.h:20
TangoErrorType TangoService_setBinder(void *jni_env, void *iBinder)


TangoRosStreamer
Author(s):
autogenerated on Mon Jun 10 2019 15:37:54