• This isn't ideal though - you have to handle the fact that the data sent will be split up into ~20 byte chunks

    You could create a custom service with NRF.setServices and then handle writes using the onWrite handler. It's more secure, but a bit of a pain to set up.

    As for custom service, not sure if it helps but I implemented AT command handler as a custom service to emulate DS-D6, HX03W fitness trackers so it can be used with original android app. The code is here and for useful bits start from the bottom. Those trackers implement actually two similar/same services 0x190A,0x190B and both have its own set of read and write characteristics similar to nordic UART. If there is something useful there, it is the handleWrite()+handleCommand() methods that will receive 20 byte arrays, join it to string and call handleATLine on complete lines and then get the response as a string and split it to 20 byte replies and fires the notifications with response. Basically if you would replace handleATLine by eval and catch exceptions there it would evaluate javascript like espruino console.

    Also if you would try it beware of uart:false there that kills the console so keep it as true or have a way to call enableNordicUART() to restore it.

About

Avatar for fanoush @fanoush started