Example #1
0
// # tizen bridge
void iotjs_tizen_func(const char* command, const char* message, void* handle) {
  DDDLOG("%s, cmd: %s, msg: %s", __func__, command, message);

  if (strncmp(command, "getResPath", strlen("getResPath")) == 0) {
    char* app_res_path = app_get_resource_path();
    iotjs_bridge_set_msg(handle, app_res_path);
    if (app_res_path != NULL) {
      free(app_res_path);
    }
  } else if (strncmp(command, "getDataPath", strlen("getDataPath")) == 0) {
    char* app_data_path = app_get_data_path();
    iotjs_bridge_set_msg(handle, app_data_path);
    if (app_data_path != NULL) {
      free(app_data_path);
    }
  } else if (strncmp(command, "launchAppControl", strlen("launchAppControl")) ==
             0) {
    iotjs_error_t err = tizen_send_launch_request(message, handle);
    if (err == IOTJS_ERROR_NONE) {
      iotjs_bridge_set_msg(handle, "OK");
    }

  } else {
    iotjs_bridge_set_err(handle, "Can't find command");
  }
}
Example #2
0
void Adaptor::GetDataStoragePath( std::string& path)
{
    path = "";
#ifdef OVER_TIZEN_SDK_2_2
    char *pathInt = app_get_data_path();
    if ( pathInt )
    {
        path = pathInt;
        free( pathInt );
    }
#endif
}