picojson::object& obj = event.get<picojson::object>();
obj.insert(make_pair("listenerId", picojson::value("ReceiveNDEFListener")));
obj.insert(make_pair("id", picojson::value(static_cast<double>(NFCAdapter::GetInstance()->GetPeerId()))));
-
+ obj.insert(make_pair("action",picojson::value("onsuccess")));
NFCMessageUtils::ReportNdefMessageFromData(raw_data, size, obj);
NFCAdapter::GetInstance()->RespondAsync(event.serialize().c_str());
var listener = function(msg) {
var data = undefined;
if ('onsuccess' === msg.action && _my_id === msg.id) {
- data = new NDEFMessage(msg);
+ data = new tizen.NDEFMessage(toRecordsArray(msg.records));
}
- args.listener[msg.action](data);
+ args.listener(data);
};
var result = native_.callSync('NFCPeer_setReceiveNDEFListener', {'id' : _my_id});
tizen.NDEFMessage = function(data) {
validator_.isConstructorCall(this, tizen.NDEFMessage);
var records_ = [];
-
try {
if (arguments.length >= 1) {
if (type_.isArray(data)) {
languageCode_ = converter_.toString(languageCode);
if (!type_.isNullOrUndefined(internal_) && (internal_ instanceof InternalRecordData)) {
- tizen.NDEFRecord.call(this, internal_.tnf_, internal_.type_, internal_.payload_, internal_.id_);
+ tizen.NDEFRecord.call(this, internal_.tnf, internal_.type, internal_.payload, internal_.id);
} else {
var result = native_.callSync(
'NDEFRecordText_constructor', {
uri_ = converter_.toString(uri);
if (!type_.isNullOrUndefined(internal_) && (internal_ instanceof InternalRecordData)) {
- tizen.NDEFRecord.call(this, internal_.tnf_, internal_.type_, internal_.payload_, internal_.id_);
+ tizen.NDEFRecord.call(this, internal_.tnf, internal_.type, internal_.payload, internal_.id);
} else {
var result = native_.callSync(
'NDEFRecordURI_constructor', {
data_ = toByteArray(data, Math.pow(2, 32) - 1);
if (!type_.isNullOrUndefined(internal_) && (internal_ instanceof InternalRecordData)) {
- tizen.NDEFRecord.call(this, internal_.tnf_, internal_.type_, internal_.payload_, internal_.id_);
+ tizen.NDEFRecord.call(this, internal_.tnf, internal_.type, internal_.payload, internal_.id);
} else {
var result = native_.callSync(
'NDEFRecordMedia_constructor', {