Ryder Simulator Tutorial

Ryder V2 prototype

Intro

Pre-requisite

Download and setup

npm install -g @lightlabs/ryder-cli-proto
ryder-cli-proto –-help
Status for device COM4: 
-----------------------
Baud: 1200
Parity: None
Data Bits: 7
Stop Bits: 1
Timeout: OFF
XON/XOFF: OFF
CTS handshaking: OFF
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit:
ON RTS circuit: ON
Status for device COM5:
-----------------------
Baud: 1200
Parity: None
Data Bits: 7
Stop Bits: 1
Timeout: OFF
XON/XOFF: OFF
CTS handshaking: OFF
DSR handshaking: OFF
DSR sensitivity: OFF
DTR circuit: ON
RTS circuit: ON
cd Documents/Ryder/ryder-sim-v2-win64_0.0.2
ryder-sim-v2-win64.exe COM4

Setting up device

ryder-cli-proto setup -R 'COM5'
ryder-cli-proto export identity 0 https://ryder.id -R 'COM5'

RyderSerial JS library

npm install @lightlabs/ryderserial-proto
const RyderSerial = require('ryderserial-proto');
let ryder_port = 'COM5';
const options = {
reconnectTime: 1000, // how long to wait before reconnect (ms).
debug: true // enable debug output to stdout.
};
const ryder_serial = new RyderSerial(ryder_port, options);
ryder_serial.on('open', async ()=>
{
const response = await ryder_serial.send(RyderSerial.COMMAND_INFO);
console.log(response);
const appkeyresponse = await request_app_key(0, 'https://ryder.id');
console.log(`Response: ${appkeyresponse}`)
});
async function request_app_key(identity_number,app_domain){
const data = [RyderSerial.COMMAND_EXPORT_APP_KEY,identity_number];
const response = await ryder_serial.send(data);
if (response === RyderSerial.RESPONSE_SEND_INPUT)
{
// Send the app domain terminated by a null byte.
const app_key = await ryder_serial.send(`${app_domain}\0`);
// app key will be RyderSerial.RESPONSE_REJECTED if the user
// presses Cancel, otherwise the response will be in the following
// format:
// "https://ryder.id,app_key_here"
return app_key;
}else{
console.log('Signin rejected by user');
}
}

Get going

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store