How to use read_req method in wpt

Best JavaScript code snippet using wpt

Rcs620s.js

Source:Rcs620s.js Github

copy

Full Screen

1#!/usr/bin/env node2/**3 * a (very preliminary) node implementation of the RC-620S FeliCa reader serial communication4 * with minimal dependencies.5 *6 * NOTE : before using, you should :7 *8 * (0) install npm package "serialport" globally; this package requires9 * the newest version of g++ (the Raspi3B should be fine without this step)10 *11 * sudo apt-get install gcc-4.8 g++-4.812 * sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 2013 * sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 5014 * sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 2015 * sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 5016 *17 *18 * (1) connect your RC-S620S to your Pi19 * RC-S620:VDD --> Pi:5V or 3.3V rail20 * RC-S620:GND --> Pi:GND21 * RC-S620:RxD --> Pi:UART0-TxD22 * RC-S620:TxD --> Pi:UART0-RxD23 *24 *25 * for the UART0-TxD and UART0-RxD pin number, google : Raspberry Pi GPIO26 * e.g. Raspi3B's UART0-TXD is pin #8 and UART0-RXD is pin #1027 *28 * (2) disable boot console in serial port ; modify /boot/cmdline.txt29 * change 'console=ttyAMA0,115200' --> 'console=tty1'30 * (3) for Raspberry Pi 3 models, create/append to /boot.config.txt31 * 'dtoverlay=pi3-miniuart-bt'32 *33 * NOTE : lots of code was translated from :34 * @link https://qiita.com/rukihena/items/476d48e1e8d8fc6b98bf35 */36'use strict'37const SerialPort = require('serialport'),38 {range, serial, int2strbinLE, read_number} = require('./felicaca_utils')39// -- the following function is for debug only --40//function buffer2hex(buf) {41// var out = []42// for (const value of buf.values()) {43// let o = Number(value).toString(16)44// out.push(((o.length < 2) ? '0' : '') + o)45// }46// return out.join(' ')47//}48/**49 *50 * @param {...Buffer|string} _51 * @returns {Buffer}52 */53function concat_buffer(_) {54 var ingredients = []55 for (var i = 0; i < arguments.length; ++i) {56 var arg = arguments[i]57 if (arg instanceof Buffer) ingredients.push(arg);58 else if (typeof arg === 'number') ingredients.push(Buffer.from(String.fromCharCode(arg), 'ascii'));59 else if (typeof arg === 'string') ingredients.push(Buffer.from(arg, 'ascii'));60 else throw 'expecting number,string,Buffer ; received : ' + JSON.stringify(arg);61 }62 return Buffer.concat(ingredients)63}64// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -65class Rcs620s {66 /**67 *68 * @param {string} port69 * path to the unix port of the connection70 * @param {number} [baudrate=115200]71 * @param {function} [on_ready]72 * called when the serial port is open and ready to use73 * if omitted then you should inspect property: is_ready74 * to determine when the serial port is ready for use75 * @param {number} [timeout=1000]76 * felica timeout in milliseconds77 */78 constructor(port = '/dev/ttyAMA0', baudrate = 115200, on_ready = '', timeout = 1000) {79 //console.log(`creating SerialPort ; port = ${port}`)80 this._timeout = typeof timeout === 'number' && timeout ? timeout : 100081 this._ser = new SerialPort(port, {baudRate: baudrate})82 this._busy = false83 this._on_ready = ''84 this._is_ready = false85 if (typeof on_ready === 'function') this._on_ready = on_ready;86 this._ser.on('open', () => {87 // console.log('now open')88 this._is_ready = true89 if (typeof this._on_ready === 'function')90 this._on_ready.apply(this);91 })92 /**93 * @type {Buffer}94 * @private95 */96 this._read_buffer = ''97 this._read_queue = []98 this._ser.on('data', buffer => {99 if (!this._read_buffer) {100 this._read_buffer = buffer101 //console.log(`[read-queue] received ${buffer.length} bytes =`, buffer)102 return103 }104 this._read_buffer = Buffer.concat([this._read_buffer, buffer])105 //console.log(`[read-queue] received ${buffer.length} bytes =`, this._read_buffer)106 })107 this._read_timer = setInterval(() => {108 if (!this._read_queue || !this._read_queue.length) return;109 //console.log(colors.magenta('read timer'))110 var read_req = this._read_queue[0],111 now = (new Date).getTime()112 if (now >= read_req.time_expire) {113 read_req.ng_callback('timeout')114 this._read_buffer.shift() // delete the first item from the queues115 return116 }117 if (!this._read_buffer) return;118 let bytes_to_take = this._read_buffer.length >= read_req.bytes_needed119 ? read_req.bytes_needed120 : this._read_buffer.length121 read_req.buffers.push(this._read_buffer.slice(0, bytes_to_take))122 read_req.bytes_needed -= bytes_to_take123 this._read_buffer = this._read_buffer.slice(bytes_to_take)124 // check if the request has fulfilled125 let out_buffer = Buffer.concat(read_req.buffers),126 check_ok127 if (!read_req.bytes_needed) {128 // no more bytes needed; perform a check then either accept or reject it129 if (read_req.check) {130 check_ok = false131 if ('function' === typeof read_req.check)132 check_ok = read_req.check.apply(this, [out_buffer]);133 else if ('string' === typeof read_req.check)134 check_ok = read_req.check === out_buffer.toString('hex');135 else136 console.warn('[warn] expecting function or string in variable element "check" ; received : ',137 read_req.check);138 }139 else check_ok = true;140 if (!check_ok) {141 console.warn(`check failed; read_req.check=`, JSON.stringify(read_req.check))142 read_req.ng_callback('check-failed')143 }144 // console.log(colors.green.bold('emitting buffer :'), out_buffer)145 read_req.ok_callback(out_buffer)146 this._read_queue.shift() // delete the first item from the queues147 }148 }, 10)149 }150 /**151 * @param {number} length152 * number of bytes to expect to receive153 * @param {function|string} check154 * if string, it must be a hex string, e.g. '00112233'155 * if function, then the result Buffer is passed; to accept this data buffer, return TRUE156 * @param {number} [timeout]157 * in millisecond158 * @return {Promise}159 * if successful, resolves with : function(buffer) {..}160 * if fail, rejects with : function(err_str) {..}161 * @protected162 */163 _read(length, check = '', timeout) {164 // console.log(`[read-queue] queuing read request for ${length} bytes`)165 if (typeof timeout !== 'number' || timeout) timeout = this._timeout;166 return new Promise((ok, ng) => {167 let now = (new Date).getTime()168 this._read_queue.push({169 time_in: now,170 time_expire: now + timeout,171 bytes_needed: length,172 buffers: [],173 check: check,174 ok_callback: ok,175 ng_callback: ng176 })177 })178 }179 close(timeout = 1000) {180 return new Promise((ok, ng) => {181 var timer = 0182 this._ser.on('close', () => {183 if (timer) clearTimeout(timer);184 ok()185 })186 this._ser.close()187 setTimeout(() => ng('timeout'), timeout)188 })189 }190 /**191 * @param {function} func192 */193 set on_ready(func) {194 if (typeof func === 'function') {195 this._on_ready = func;196 if (this._is_ready) func.apply(this);197 }198 }199 /**200 *201 * @return {boolean}202 */203 get is_ready() {204 return this._is_ready205 }206 /**207 *208 * @param {Buffer} buffer209 * @returns {Promise}210 * if success, resolves with no arguments211 * if fail, rejects with err_reason_str212 * @private213 */214 _write_serial(buffer) {215 if (!(buffer instanceof Buffer)) throw `expecting Buffer instance ; received : ${buffer}`;216 // console.log(colors.red.bold('writing :'), buffer2hex(buffer))217 return new Promise((ok, ng) => {218 if (this._ser) {219 this._ser.write(buffer)220 this._ser.drain(() => ok())221 }222 else ng('serial-port-not-ready');223 })224 }225 /**226 *227 * @param {...Buffer|string} _228 * @returns {Promise}229 * @private230 */231 _concat_and_write_serial(_) {232 let buffer = concat_buffer.apply(this, [].slice.call(arguments))233 return this._write_serial(buffer)234 }235 /**236 *237 * @param {number} length238 * @param {string} [encoding]239 * if non-empty string, then response will be encoded in this encoding240 * @param {function} [check_func]241 * should be : function (res_buffer_or_str) {..}242 * return true to accept this response243 * @returns {Buffer|string|false}244 * if fail returns false245 * @private246 */247 _read_serial(length, encoding, check_func) {248 console.log(`reading ${length} bytes from :`, this._data_in)249 let res = this._data_in_get(length)250 console.log('...', res)251 if (!res || !res.length) return false;252 if (encoding) res = res.toString(encoding);253 if (typeof check_func === 'function' && !check_func(res)) return false;254 console.log('read :', res)255 return res;256 }257 /**258 * @param {Buffer} buffer:259 * @return {number}260 */261 static _calculate_checksum(buffer) {262 var check_sum = 0263 for (const value of buffer.values()) {264 check_sum += value265 }266 // console.log('sum:', check_sum)267 let dcs = (-check_sum) & 0xff268 // console.log('dcs:', dcs)269 return dcs270 }271 /**272 *273 * @param {string|Buffer} command274 * @return {Promise}275 * @private276 */277 _card_command(command) {278 // console.log(colors.bgBlue.cyan.bold('[ex-commmand]'), command)279 return new Promise((ok, ng) => {280 let command_timeout = this._timeout >= (0x10000 / 2) ? 0xffff : this._timeout * 2,281 command_buffer = concat_buffer(282 '\xd4\xa0',283 int2strbinLE(command_timeout, 2),284 String.fromCharCode(command.length + 1),285 command286 )287 this._rw_command(command_buffer, buf =>288 buf.length >= 4289 && buf.toString('hex').indexOf('d5a100') === 0290 && buf.length === buf[3] + 3291 ).then(292 buffer => {293 let card_command_out = buffer.slice(4)294 // console.log(colors.bgBlue.cyan.bold('[ex-commmand OK]'), card_command_out)295 ok(card_command_out)296 },297 error => ng({error: 'ex-command-failed', error2: error})298 )299 })300 }301 /**302 * @param {string|Buffer} command to send303 * @param {function|string} [check]304 * if function, then the result Buffer will be passed; you should return a true to indicate acceptance305 * if string, then the buffer is converted to string and compared against this string306 * @return {Promise}307 * if success, resolves with : function (result_buffer) {..}308 * if fail, rejects with : function (err_string) {..}309 *310 */311 _rw_command(command, check) {312 return new Promise((overall_ok, overall_ng) => {313 var me = this,314 self = this.constructor,315 send_buffer = command instanceof Buffer ? command : Buffer.from(command, 'ascii'),316 len = send_buffer.length,317 dcs = self._calculate_checksum(send_buffer)318 //console.log('-------------------------------------\nwill send command :', buffer2hex(send_buffer))319 this._data_in = ''320 this._ser.flush(() => {321 //322 // 0. send: payload length323 // 1. send: payload324 // 2. send: checksum325 // 3. recv: 6-byte response326 //327 let req = '\x00\x00\xff',328 promise0329 if (len <= 255) {330 // normal frame331 promise0 = me._concat_and_write_serial(req,332 String.fromCharCode(len),333 String.fromCharCode((-len) & 0xff))334 }335 else {336 // extended frame337 // 未テストです338 let buffer1 = concat_buffer(req, '\xff\xff',339 String.fromCharCode((len >> 8) & 0xff),340 String.fromCharCode((len >> 0) & 0xff)341 )342 promise0 = me._concat_and_write_serial(buffer1,343 String.fromCharCode(self._calculate_checksum(buffer1.slice(2)))344 )345 }346 promise0.then(347 () => {348 let promise1 = me._write_serial(send_buffer)349 promise1.then(350 () => {351 let promise2 = me._concat_and_write_serial(dcs, '\x00')352 promise2.then(353 () => {354 // receive an ACK355 // console.log(colors.blue('expecting ack'))356 me._read(6, '0000ff00ff00').then(357 res_buffer => {358 // console.log(colors.blue.bold('got ack'))359 // got an ACK! receive a message360 me._read(5, buf => buf.toString('hex').indexOf('0000ff') === 0).then(361 response_body => {362 // got a message; determine response length363 let response_len = 0364 if (response_body[3] === 0xff && response_body[4] === 0xff) {365 // ???366 response_body = this._read_serial(3)367 if (!response_body || self._calculate_checksum(response_body) !== 0)368 return this._cancel().then(() => overall_ng('response-checksum-error'));369 response_len = String.fromCharCode(370 (response_body[5] << 8) | (response_body[6] << 0))371 }372 else {373 if (self._calculate_checksum(response_body.slice(3)) !== 0)374 return this._cancel().then(() => overall_ng('response-checksum-error'));375 response_len = response_body[3];376 }377 if (response_len > self.MAX_RW_RESPONSE_LEN)378 return this._cancel().then(() => overall_ng('response-too-long'));379 // wait for response body380 // console.log(colors.blue(`reading response : ${response_len} bytes`))381 me._read(response_len).then(382 response_body => {383 // console.log(colors.blue.bold(`got response :`), response_body)384 // got response body; compute DCS385 let dcs = self._calculate_checksum(response_body)386 // console.log('* response DCS :', dcs)387 // compare DCS with provided one , which we will read now..388 me._read(2, buf => buf[0] === dcs && buf[1] === 0x00).then(389 dcs_buffer => {390 // checksum OK391 if (check) {392 let check_ok = false393 if (typeof check === 'function')394 check_ok = check.apply(this, [response_body]);395 else if (typeof check === 'string')396 check_ok = response_body.toString('hex') === check;397 else398 console.warn('expecting string or function in "check"; received :', check);399 }400 if (!check)401 return this._cancel().then(() => overall_ng('check-failed'));402 // check OK403 return overall_ok(response_body)404 },405 err => this._cancel().then(() => overall_ng({406 error: 'response-checksum-invalid',407 error2: err408 }))409 )410 },411 err => this._cancel().then(() => overall_ng({412 error: 'read-response-failed',413 error2: err414 }))415 )416 },417 err => this._cancel().then(() => overall_ng({418 error: 'no-valid-message',419 error2: err420 }))421 )422 },423 err => this._cancel().then(() => overall_ng({424 error: 'no-ack',425 error2: err426 }))427 )428 },429 err => overall_ng({error: 'promise2-failed', error2: err})430 ) // promise2.then431 },432 err => overall_ng({error: 'promise1-failed', error2: err})433 ) // promise1.then434 },435 err => overall_ng({error: 'promise0-failed', error2: err})436 ) // promise0.then437 }) // flush438 })439 } // end _send_and_receive440 /**441 * sends a cancel, duh442 * @returns {Promise}443 * if successful, resolves with no arguments;444 * if fail, resolves with one argument: err_str445 * @private446 */447 _cancel() {448 var me = this449 return new Promise(ok => {450// console.log('sending cancel command ...')451 me._concat_and_write_serial('\x00\x00\xff\x00\xff\x00').then(452 () => {453 setTimeout(() => {454 me._ser.flush()455 me._data_in = ''456 ok()457 }, 10)458 },459 err_str => ok(err_str)460 )461 })462 }463 init_device() {464 let me = this465 return new Promise((ok, ng) => {466 // console.log('serial port is now open')467 // 1. open device468 me._rw_command('\xd4\x32\x02\x00\x00\x00', 'd533').then(469 response_buffer1 => {470 // console.log('## open device OK')471 // 2. RFConfiguration (max retries)472 me._rw_command('\xd4\x32\x05\x00\x00\x00', 'd533').then(473 response_buffer2 => {474 // console.log('## RFConfiguration OK')475 // RFConfiguration (additional wait time = 24ms)476 this._rw_command('\xd4\x32\x81\xb7', 'd533').then(477 response_buffer3 => {478 // console.log('## RFConfiguration 2 OK')479 ok()480 },481 err => ng({error: 'RFConfiguration-2-failed', error2: err})482 )483 },484 err => ng({error: 'RFConfiguration-1-failed', error2: err})485 )486 },487 err => ng({error: 'open-device-failed', error2: err})488 )489 })490 }491 polling(system_code) {492 if (this._busy)493 return new Promise((ok, ng) => ng('busy'));494 this._busy = true495 // console.log("### polling")496 let me = this497 return new Promise((ok, ng) => {498 me._rw_command(499 concat_buffer('\xd4\x4a\x01\x01\x00', system_code, '\x00\x0f'),500 buf => {501 let hex = buf.toString('hex');502 return buf && (503 hex.indexOf('d54b01011201') === 0 || hex.indexOf('d54b00') === 0504 )505 }506 ).then(507 response_buffer1 => {508 me._busy = false509 let hex = response_buffer1.toString('hex');510 if (hex.indexOf('d54b01011201') === 0) {511 let idm = response_buffer1.slice(6, 6 + 8),512 pmn = response_buffer1.slice(14, 14 + 8)513 ok({idm: idm, pmn: pmn})514 }515 else ok();516 },517 err => {518 me._busy = false519 ng({error: 'InListPassiveTarget-failed', error2: err})520 }521 )522 })523 }524 /**525 *526 * @param {...Buffer|string} _527 * @returns {Buffer}528 * @private529 */530 static _concat_buffer(_) {531 let concat_from = []532 for (let i = 0; i < arguments.length; ++i) {533 let arg = arguments[i]534 concat_from.push(arg instanceof Buffer ? arg : new Buffer(arg, 'ascii'))535 }536 return Buffer.concat(concat_from)537 }538 _request_service(idm, service_code) {539 let me = this,540 self = this.constructor541 return new Promise((ok, ng) => {542 // construct command : 02 <IDM> 01 <SERVICE_CODE>543 let command = self._concat_buffer('\x02', idm, '\x01', service_code),544 res_prefix_expected = self._concat_buffer('\x03', idm).toString('hex')545 // console.log('requesting service; sending command:', command, '; expecting res-prefix:', res_prefix_expected)546 // console.log(colors.bgMagenta.yellow.bold('sending card-command'))547 this._card_command(command, buf => {548 // console.log(colors.bgMagenta.yellow.bold('request-service : checking buffer: '), buf)549 return buf550 && buf.length === 12551 && buf.toString('hex').indexOf(res_prefix_expected) === 0552 && buf.slice(10).toString('hex') !== 'ffff'553 }554 ).then(555 response_buffer => ok(),556 err => ng({error: 'request-service-failed', error2: err})557 )558 })559 }560 _read_without_encryption(idm, service_code, block_number) {561 // 暗号化なしで読む562 let me = this,563 self = this.constructor564 return new Promise((ok, ng) => {565 let command = self._concat_buffer('\x06', idm, '\x01', // サービス数566 service_code, '\x01',// ブロック数(なぜか複数指定するとエラーが返る)567 '\x80', String.fromCharCode(block_number)568 ),569 res_prefix_expected = self._concat_buffer('\x07', idm).toString('ascii')570 this._card_command(command, buf =>571 buf && buf.length === 28572 && (buf.toString('ascii').indexOf(res_prefix_expected) === 0)573 ).then(574 response_buffer => ok(response_buffer.slice(12)),575 err => ng({error: 'rw-command-failed', error2: err})576 )577 })578 }579 _read_without_encryption2(idm, service_code, block_number, length) {580 let me = this581 me._busy = true582 // console.log(colors.bgCyan.yellow.bold(`read without encryption; block ${block_number} , len ${length}`))583 return new Promise((ok, ng) => {584 let tasks = range(length).map(585 i => {586 return () => new Promise((task_ok, task_ng) => {587 me._read_without_encryption(idm, service_code, block_number + i).then(588 buf => task_ok(buf),589 err => {590 console.warn(colors.bgRed.yellow.bold(`read-without-encryption-failed ; block: ${block_number + i} ; error :`), err)591 return task_ng({592 error: 'read-without-encryption-failed',593 error2: err,594 block_number: block_number + i595 })596 }597 )598 })599 }600 )601 serial(tasks).then(602 results => {603 me._busy = false604 // console.log('tasks completed!')605 ok(Buffer.concat(results))606 },607 err => {608 me._busy = false609 return ng({error: 'read-without-encryption2-task-error', error2: err})610 }611 )612 })613 }614 read_block(idm, service_code, block_number, length) {615 // console.log(colors.bgWhite.black(' ### reading block ### '))616 // 存在確認してから読む617 let me = this618 return new Promise((ok, ng) => {619 me._request_service(idm, service_code).then(620 () => {621 // console.log(colors.bgMagenta.yellow.bold('request service OK!'))622 me._read_without_encryption2(idm, service_code, block_number, length).then(623 buf => ok(buf),624 err => ng({error: 'read-without-encryption2-failed', error2: err})625 )626 },627 err => ng({error: 'request-service-failed', error2: err})628 )629 })630 }631 read_service(idm, sevice) {632 var self = this.constructor633 if (!sevice.service_code || !sevice.blocks)634 throw 'expecting service_dict to be {service_code:xx, blocks:xx}';635 return new Promise((read_service_ok, read_service_ng) => {636 let service_code = sevice.service_code,637 blocks = sevice.blocks,638 processing = sevice.processing,639 funcs = [];640 for (let i = 0; i < blocks; ++i) {641 funcs.push(() => this.read_block(idm, service_code, i, blocks))642 }643 // run each func sequentially644 serial(funcs).then(645 results => read_service_ok(processing(results)),646 err => read_service_ng(err)647 )648 })649 }650}651Rcs620s.SYSTEM_CODE = {652 SUICA: '\x00\x03',653 COMMON: '\xfe\x00',654 SETAMARU: '\x80\x2B',655 IRUCA: '\x80\xDE'656}657Rcs620s.SERVICES = {658 SUICA: {659 // 属性情報 : http://jennychan.web.fc2.com/format/suica.html#008B660 PROPERTIES: {661 service_code: '\x8b\x00', blocks: 1, processing: results => {662 let data = results[0]663 if (!data) return;664 return {665 // card_type: 'wip',666 // card_region: 'wip',667 balance: read_number(data, 11, 2, 'LE')668 }669 }670 },671 // -- below are work in progress --672 USAGE_HISTORY: {service_code: '\x0f\x09', blocks: 20}, // 利用履歴673 TICKET_HISTORY: {service_code: '\x8f\x10', blocks: 3}, // 改札入出場履歴674 SF_TICKET_HISTORY: {service_code: '\xcb\x10', blocks: 3}, // SF入場駅記録675 FARE_HISTORY: {service_code: '\x4b\x81', blocks: 36} // 料金 発券/改札記録676 }677}678Rcs620s.MAX_RW_RESPONSE_LEN = 265...

Full Screen

Full Screen

structnrf__block__dev__s_1_1nrf__block__dev__ops__s.js

Source:structnrf__block__dev__s_1_1nrf__block__dev__ops__s.js Github

copy

Full Screen

1var structnrf__block__dev__s_1_1nrf__block__dev__ops__s =2[3 [ "geometry", "structnrf__block__dev__s_1_1nrf__block__dev__ops__s.html#a1323f9132ddbfc1a40372eaaf5d2c188", null ],4 [ "init", "structnrf__block__dev__s_1_1nrf__block__dev__ops__s.html#a6152bfd8b6bff60b1cea6fa7bbeb7922", null ],5 [ "ioctl", "structnrf__block__dev__s_1_1nrf__block__dev__ops__s.html#a0fb56a4c456fa68b1227378dd8386bc8", null ],6 [ "read_req", "structnrf__block__dev__s_1_1nrf__block__dev__ops__s.html#a97dd0ac6ca243709e46b1ecf22cdca19", null ],7 [ "uninit", "structnrf__block__dev__s_1_1nrf__block__dev__ops__s.html#af6c47f6e7c7a1a93bdd85aa128ed2c14", null ],8 [ "write_req", "structnrf__block__dev__s_1_1nrf__block__dev__ops__s.html#a02e07a8988494e28521fa62608e95150", null ]...

Full Screen

Full Screen

enumvalues_72.js

Source:enumvalues_72.js Github

copy

Full Screen

1var searchData=2[3 ['read_5freq',['READ_REQ',['../group__ble__ancs__c.html#gga55a6187b0668d07e30b962f572933bd4a9de983b172c0f6472f18eb69b73fdfca',1,'READ_REQ():&#160;ancs_tx_buffer.h'],['../group__ble__ancs__c.html#gga55a6187b0668d07e30b962f572933bd4a9de983b172c0f6472f18eb69b73fdfca',1,'READ_REQ():&#160;ots_tx_buffer.h']]],4 ['reserved0',['RESERVED0',['../group__ant__sdk__profiles__bsc__page4.html#gga77cd522377caccea2ba3af2a21a78806aea61bb45ae2ff33663da99c18318dd56',1,'ant_bsc_page_4.h']]],5 ['reserved1',['RESERVED1',['../group__ant__sdk__profiles__bsc__page4.html#gga77cd522377caccea2ba3af2a21a78806a3401f88113645c341c269d49d044a020',1,'ant_bsc_page_4.h']]]...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2wpt.read_req(url, function(error, data) {3 if (error) {4 console.log(error);5 } else {6 console.log(data);7 }8});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt-api.js');2 if (err) {3 console.log(err);4 } else {5 console.log(data);6 }7});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2var config = require('./config.js');3var options = {4}5wpt.read_req(options, function (err, data) {6 if (err) {7 console.log(err);8 }9 else {10 console.log(data);11 }12})

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2var fs = require('fs');3 console.log(data);4 fs.writeFile("output.json", JSON.stringify(data, null, 4), function(err) {5 if(err) {6 console.log(err);7 } else {8 console.log("JSON saved to output.json");9 }10 }); 11});12var wpt = require('./wpt.js');13var fs = require('fs');14 console.log(data);15 fs.writeFile("output.json", JSON.stringify(data, null, 4), function(err) {16 if(err) {17 console.log(err);18 } else {19 console.log("JSON saved to output.json");20 }21 }); 22});23var wpt = require('./wpt.js');24var fs = require('fs');25 console.log(data);26 fs.writeFile("output.json", JSON.stringify(data, null, 4), function(err) {27 if(err) {28 console.log(err);29 } else {30 console.log("JSON saved to output.json");31 }32 }); 33});34var wpt = require('./wpt.js');35var fs = require('fs');36 console.log(data);37 fs.writeFile("output.json", JSON.stringify(data, null, 4), function(err) {38 if(err) {39 console.log(err);40 } else {41 console.log("JSON saved to output.json");42 }43 }); 44});45var wpt = require('./wpt.js');46var fs = require('fs');

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful