[Verification] Code compiles without errors.
Change-Id: I5d600c835b3b298beab1460b5388de7319db3a76
Signed-off-by: Rafał Szczekutek <r.szczekutek@samsung.com>
%define tizen_feature_power_support 1
%define tizen_feature_push_support 0
%define tizen_feature_sap_support 0
-%define tizen_feature_se_support 0
+%define tizen_feature_se_support 1
%define tizen_feature_sensor_support 0
%define tizen_feature_sound_support 0
%define tizen_feature_system_setting_support 0
BuildRequires: pkgconfig(capi-media-radio)
%endif
+%if 0%{?tizen_feature_se_support}
+BuildRequires: pkgconfig(smartcard-service)
+BuildRequires: pkgconfig(smartcard-service-common)
+%endif
+
%description
Tizen Web APIs implemented.
--- /dev/null
+{
+ 'includes':[
+ '../common/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'tizen_secureelement',
+ 'type': 'loadable_module',
+ 'sources': [
+ 'secureelement_api.js',
+ 'secureelement_extension.cc',
+ 'secureelement_extension.h',
+ 'secureelement_instance.cc',
+ 'secureelement_instance.h',
+ ],
+ 'includes': [
+ '../common/pkg-config.gypi',
+ ],
+ 'conditions': [
+ [ 'tizen == 1', {
+ 'variables': { 'packages': ['smartcard-service', 'smartcard-service-common'] },
+ }],
+ ],
+ },
+ ],
+}
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var validator_ = xwalk.utils.validator;
+var types_ = validator_.Types;
+var native_ = new xwalk.utils.NativeManager(extension);
+
+//////////////////SEService/////////////////
+
+function SEService() {
+}
+
+SEService.prototype.getReaders = function() {
+ var args = validator_.validateArgs(arguments, [
+ { name: "successCallback", type: types_.FUNCTION },
+ { name: "errorCallback", type: types_.FUNCTION, optional: true, nullable: true }
+ ]);
+};
+
+SEService.prototype.registerSEListener = function() {
+ var args = validator_.validateArgs(arguments, [
+ { name: "listener", type: types_.LISTENER, values: ['onSEReady', 'onSENotReady'] },
+ ]);
+};
+
+SEService.prototype.unregisterSEListener = function() {
+ var args = validator_.validateArgs(arguments, [
+ { name: "id", type: types_.UNSIGNED_LONG },
+ ]);
+}
+
+SEService.prototype.shutdown = function() {
+ console.log('Shutdown');
+ return 'Shutdown';
+};
+
+//////////////////Reader/////////////////
+
+function Reader() {
+ var handle = null;
+ Object.defineProperties(this, {
+ isPresent: {value: false, writable: false, enumerable: true}
+ });
+}
+
+Reader.prototype.getName = function() {
+};
+
+Reader.prototype.openSession = function() {
+ var args = validator_.validateArgs(arguments, [
+ { name: "successCallback", type: types_.FUNCTION },
+ { name: "errorCallback", type: types_.FUNCTION, optional: true, nullable: true }
+ ]);
+}
+
+Reader.prototype.closeSessions = function() {
+}
+
+//////////////////Session/////////////////
+
+function Session() {
+ var handle = null;
+ Object.defineProperties(this, {
+ isClosed: {value: false, writable: false, enumerable: true}
+ });
+}
+
+Session.prototype.openBasicChannel = function() {
+ var args = validator_.validateArgs(arguments, [
+ { name: "aid", type: types_.ARRAY, values: types_.BYTE },
+ { name: "successCallback", type: types_.FUNCTION },
+ { name: "errorCallback", type: types_.FUNCTION, optional: true, nullable: true }
+ ]);
+};
+
+Session.prototype.openLogicalChannel = function() {
+ var args = validator_.validateArgs(arguments, [
+ { name: "aid", type: types_.ARRAY, values: types_.BYTE },
+ { name: "successCallback", type: types_.FUNCTION },
+ { name: "errorCallback", type: types_.FUNCTION, optional: true, nullable: true }
+ ]);
+}
+
+Session.prototype.getATR = function() {
+}
+
+Session.prototype.close = function() {
+}
+
+Session.prototype.closeChannels = function() {
+}
+
+//////////////////Channel/////////////////
+
+function Channel() {
+ var handle = null;
+ Object.defineProperties(this, {
+ isBasicChannel: {value: false, writable: false, enumerable: true}
+ });
+}
+
+Channel.prototype.close = function() {
+};
+
+Channel.prototype.transmit = function() {
+ var args = validator_.validateArgs(arguments, [
+ { name: "command", type: types_.ARRAY, values: types_.BYTE },
+ { name: "successCallback", type: types_.FUNCTION },
+ { name: "errorCallback", type: types_.FUNCTION, optional: true, nullable: true }
+ ]);
+}
+
+Channel.prototype.getSelectResponse = function() {
+}
+
+exports = new SEService();
--- /dev/null
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "secureelement/secureelement_extension.h"
+
+#include "secureelement/secureelement_instance.h"
+
+common::Extension* CreateExtension() {
+ return new SecureElementExtension;
+}
+
+// This will be generated from secureelement_api.js.
+extern const char kSource_secureelement_api[];
+
+SecureElementExtension::SecureElementExtension() {
+ SetExtensionName("tizen.seService");
+ SetJavaScriptAPI(kSource_secureelement_api);
+}
+
+SecureElementExtension::~SecureElementExtension() {}
+
+common::Instance* SecureElementExtension::CreateInstance() {
+ return new extension::secureelement::SecureElementInstance;
+}
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SECUREELEMENT_SECUREELEMENT_EXTENSION_H_
+#define SECUREELEMENT_SECUREELEMENT_EXTENSION_H_
+
+#include "common/extension.h"
+
+class SecureElementExtension : public common::Extension {
+public:
+ SecureElementExtension();
+ virtual ~SecureElementExtension();
+private:
+ // common::Extension implementation.
+ virtual common::Instance* CreateInstance();
+};
+
+#endif // SECUREELEMENT_SECUREELEMENT_EXTENSION_H_
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "secureelement/secureelement_instance.h"
+
+#include "common/picojson.h"
+#include "common/logger.h"
+#include "common/platform_exception.h"
+
+
+namespace extension {
+namespace secureelement {
+
+using namespace common;
+
+SecureElementInstance::SecureElementInstance() {
+ using namespace std::placeholders;
+
+#define REGISTER_SYNC(c,x) \
+ RegisterSyncHandler(c, std::bind(&SecureElementInstance::x, this, _1, _2));
+
+ REGISTER_SYNC("SEService_registerSEListener", RegisterSEListener);
+ REGISTER_SYNC("SEService_unregisterSEListener", UnregisterSEListener);
+ REGISTER_SYNC("SEService_shutdown", Shutdown);
+ REGISTER_SYNC("SEReader_getName", GetName);
+ REGISTER_SYNC("SEReader_closeSessions", CloseSessions);
+ REGISTER_SYNC("SESession_getATR", GetATR);
+ REGISTER_SYNC("SESession_close", CloseSession);
+ REGISTER_SYNC("SESession_closeChannels", CloseChannels);
+ REGISTER_SYNC("SEChannel_close", CloseChannel);
+ REGISTER_SYNC("SEChannel_getSelectResponse", GetSelectResponse);
+#undef REGISTER_SYNC
+
+#define REGISTER(c,x) \
+ RegisterHandler(c, std::bind(&SecureElementInstance::x, this, _1, _2));
+
+ REGISTER("SEService_getReaders", GetReaders);
+ REGISTER("SEReader_openSession", OpenSession);
+ REGISTER("SESession_openBasicChannel", OpenBasicChannel);
+ REGISTER("SESession_openLogicalChannel ", OpenLogicalChannel);
+ REGISTER("SEChannel_transmit", Transmit);
+#undef REGISTER
+}
+
+SecureElementInstance::~SecureElementInstance() {
+}
+
+void SecureElementInstance::RegisterSEListener(
+ const picojson::value& args, picojson::object& out) {
+}
+
+void SecureElementInstance::UnregisterSEListener(
+ const picojson::value& args, picojson::object& out) {
+}
+
+void SecureElementInstance::Shutdown(
+ const picojson::value& args, picojson::object& out) {
+}
+
+void SecureElementInstance::GetName(
+ const picojson::value& args, picojson::object& out) {
+}
+
+void SecureElementInstance::CloseSessions(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::GetATR(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::CloseSession(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::CloseChannels(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::CloseChannel(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::GetSelectResponse(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::GetReaders(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::OpenSession(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::OpenBasicChannel(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::OpenLogicalChannel(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+void SecureElementInstance::Transmit(
+ const picojson::value& args, picojson::object& out) {
+
+}
+
+} // namespace secureelement
+} // namespace extension
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SECUREELEMENT_SECUREELEMENT_INSTANCE_H_
+#define SECUREELEMENT_SECUREELEMENT_INSTANCE_H_
+
+#include "common/extension.h"
+
+namespace extension {
+namespace secureelement {
+
+class SecureElementInstance: public common::ParsedInstance {
+public:
+ SecureElementInstance();
+ virtual ~SecureElementInstance();
+
+private:
+ /* SEService methods */
+ void GetReaders(const picojson::value& args, picojson::object& out);
+ void RegisterSEListener(const picojson::value& args, picojson::object& out);
+ void UnregisterSEListener(const picojson::value& args, picojson::object& out);
+ void Shutdown(const picojson::value& args, picojson::object& out);
+
+ /* Reader methods */
+ void GetName(const picojson::value& args, picojson::object& out);
+ void OpenSession(const picojson::value& args, picojson::object& out);
+ void CloseSessions(const picojson::value& args, picojson::object& out);
+
+ /* Session methods */
+ void OpenBasicChannel(const picojson::value& args, picojson::object& out);
+ void OpenLogicalChannel(const picojson::value& args, picojson::object& out);
+ void GetATR(const picojson::value& args, picojson::object& out);
+ void CloseSession(const picojson::value& args, picojson::object& out);
+ void CloseChannels(const picojson::value& args, picojson::object& out);
+
+ /* Channel methods */
+ void CloseChannel(const picojson::value& args, picojson::object& out);
+ void Transmit(const picojson::value& args, picojson::object& out);
+ void GetSelectResponse(const picojson::value& args, picojson::object& out);
+
+};
+
+} // namespace secureelement
+} // namespace extension
+
+#endif // SECUREELEMENT_SECUREELEMENT_INSTANCE_H_
'bookmark/bookmark.gyp:*',
'systeminfo/systeminfo.gyp:*',
#'radio/radio.gyp:*',
+ 'secureelement/secureelement.gyp:*',
],
},
], # end mobile