//16进制字符串转ASCII字符
var hexstr = this.transCodeToStr("0613735672291F00FFEE31");
const udp = wx.createUDPSocket();
udp.bind();
if (udp === null) {
console.log('暂不支持')
return;
} else {
wx.showToast({
title: "" + udp,
icon: 'success',
duration: 2000
})
}
udp.send({
address: '192.168.6.116',
port: 60000,
//发送的ascii字符
message: hexstr,
});
},
//16进制字符串转ASCII字符
transCodeToStr: function (codes) {
var asiiresult = '';
for (var i = 0; i < codes.length; i++ , i++) {
var num = "0x" + codes.substring(i, i + 2);
console.log(num);
console.log(String.fromCharCode(num));
console.log(asiiresult);
asiiresult += String.fromCharCode(num);
}
console.log(asiiresult);
return asiiresult;
},
服务端收到的数据
微信开发工具本地抓包抓到的数据:
版本机型相关信息:
请问什么原因导致的?我想发送16进制对应的ASCII字符,该怎么发?请多多指点......不胜感激
版本:1.02.1908222 开发工具调试选择机型:iphone5
https://developers.weixin.qq.com/community/develop/issue/117问题已知,后续版本解决
是哪个微信版本呢?具体机型是?