{"action":"closed","issue":{"url":"https://api.github.com/repos/voodootikigod/node-serialport/issues/653","repository_url":"https://api.github.com/repos/voodootikigod/node-serialport","labels_url":"https://api.github.com/repos/voodootikigod/node-serialport/issues/653/labels{/name}","comments_url":"https://api.github.com/repos/voodootikigod/node-serialport/issues/653/comments","events_url":"https://api.github.com/repos/voodootikigod/node-serialport/issues/653/events","html_url":"https://github.com/voodootikigod/node-serialport/issues/653","id":124932399,"number":653,"title":"Y U NO readSync?","user":{"login":"claudio-destro","id":11568024,"avatar_url":"https://avatars.githubusercontent.com/u/11568024?v=3","gravatar_id":"","url":"https://api.github.com/users/claudio-destro","html_url":"https://github.com/claudio-destro","followers_url":"https://api.github.com/users/claudio-destro/followers","following_url":"https://api.github.com/users/claudio-destro/following{/other_user}","gists_url":"https://api.github.com/users/claudio-destro/gists{/gist_id}","starred_url":"https://api.github.com/users/claudio-destro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudio-destro/subscriptions","organizations_url":"https://api.github.com/users/claudio-destro/orgs","repos_url":"https://api.github.com/users/claudio-destro/repos","events_url":"https://api.github.com/users/claudio-destro/events{/privacy}","received_events_url":"https://api.github.com/users/claudio-destro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-05T09:57:42Z","updated_at":"2016-03-27T02:39:38Z","closed_at":"2016-03-27T02:39:38Z","body":"Hi!\r\n\r\nI am facing an impractical (at least to me) loss of a readSync function (or similar).\r\n\r\nSome context: I am refactoring my old LPC (ARM) programmer from Java code to Typescript + Electron.\r\n\r\nThe protocol between client (master) and LPC (slave) is **always** initiated by the client and is the following:\r\n\r\nclient: write uuencoded line to LPC\r\nLPC: ack by sending back the line\r\n...\r\nafter a variable number of lines (defined by protocol), the client stops sending data and LPC executes the command and then sends back a result code:\r\n...\r\nLPC: execute command and send a response code\r\nclient: read response and take action\r\n\r\nI don't know if it is a real issue or just my loss of knowledge, but this forced me to write some convoluted code involving:\r\n- buffering received data (not too bad since I send *one* line at a time)\r\n- using setTimeout/clearTimeout and (worse) callbacks to wait for acknowledges\r\n\r\nIMHO things should be much straightforward if some kind of xxxSync functions are provided: if you act as a master (not a slave) you have always to wait for responses from the slave.\r\n\r\nAm I doing something wrong? Could you point me to some example?\r\n\r\nThank you in advance.\r\nRegards!\r\nClaudio\r\n"}}