capacitor-udp icon indicating copy to clipboard operation
capacitor-udp copied to clipboard

UDP Send ,, what is buffer format requirement?

Open sdetweil opened this issue 4 years ago • 1 comments

doc says UdpPlugin.send({ socketId: yourSocketId, address: targetAddress, port: 6000, buffer: bufferString})

as string should be ok.. but my receiver received garbled string.

debug info from android studio on device.

UdpPlugin, methodName: send, methodData: {"socketId":2,"address":"192.168.2.255","port":8100,"buffer":"DISCOVER_MIRRORSERVER_REQUEST:39813"}

do I need to put this into arrayBuffer and then use your worker class? if it needs to be Base64 of the string, I can do that too.. (already have function that turns string into arrayBuffer)

sdetweil avatar Oct 31 '20 04:10 sdetweil

ok, needs to be base64. javascript. btoa() does that.. my receiver now gets good data

sdetweil avatar Oct 31 '20 04:10 sdetweil