Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ws = new WebSocket('ws://localhost:3000/cable'); //current server + '/cable'
- ws.send(JSON.stringify({"command":"subscribe","identifier":'{"channel": "BroadcastChannel","channel_name":"6270fce5-5ed8-4234-8736-2e25d59d086f"}'})); // channel_name - UID юзера
- table_json = {
- "device_token_name":"helo", // try use what u send on session new as token_name file
- "data_type":"SOCKET_VIEW",
- "tablet_uid":"efe8f483-6b20-45a6-98e1-111a7cf49e89", // TABLET UID
- "status":"INSERT_UPDATE",
- "data": [
- {
- "_description":"",
- "_enabledStatus":0,
- "_id":1,
- "_isAuto":0,
- "_isNormalClose":1,
- "_name":"newr",
- "_operationCode":"4",
- "_operationCodeId":4,
- "_pinId":4,
- "_pinIsInterrupt":1,
- "_pinIsOccupied":1,
- "_pinNumber":03
- }
- ]
- }
- ws.send(JSON.stringify({"command":"message","identifier":'{"channel": "BroadcastChannel","channel_name":"6270fce5-5ed8-4234-8736-2e25d59d086f"}',"data":JSON.stringify(table_json.data[0])}));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement